$ xrandr xrandr: Failed to get size of gamma for output default Screen 0: minimum 320 x 175, current 2560 x 1600, maximum 8192 x 4096 default connected 2560x1600+0+0 0mm x 0mm
The code that prints this is is in xrandr.c
if (cur_mode) { printf (" %dmm x %dmm", (int)output_info->mm_width, (int)output_info->mm_height); }
With:
get_screen (current); get_crtcs (); get_outputs (); (..) for (output = all_outputs; output; output = output->next) { XRROutputInfo *output_info = output->output_info; (..)
And we have in get_outputs()
the core of it, which populates the all_outputs
global, a linked list (see all_outputs_tail
) of all outputs:
for (o = 0; o < res->noutput; o++) { XRROutputInfo *output_info = XRRGetOutputInfo (dpy, res, res->outputs[o]);
noutput
is set in crtc_add_output
:
crtc_add_output (crtc_t *crtc, output_t *output)
Which is called from set_crtcs
:
for (output = all_outputs; output; output = output->next) { if (!output->mode_info) continue; crtc_add_output (output->crtc_info, output); }
So, it looks like we need to ensure XRROutputInfo
is populated correctly. Here it is:
typedef struct _XRROutputInfo { Time timestamp; RRCrtc crtc; char *name; int nameLen; unsigned long mm_width; unsigned long mm_height; Connection connection; SubpixelOrder subpixel_order; int ncrtc; RRCrtc *crtcs; int nclone; RROutput *clones; int nmode; int npreferred; RRMode *modes; } XRROutputInfo;
It is interesting to see subpixel_order
is in there too. Maybe we should add another window property to allow us to change this on the fly (see #559) as there is bound to be software out there that does not use the standard way of figuring out the pixel order and will use hardware calls instead.
We may also want to deal with the gamma warning, which comes from:
size = XRRGetCrtcGammaSize(dpy, output->crtc_info->crtc.xid); if (!size) { warning("Failed to get size of gamma for output %s\n", output->output.string); return; }
This should be simple enough:
typedef struct _XRRCrtcGamma { int size; unsigned short *red; unsigned short *green; unsigned short *blue; } XRRCrtcGamma;
Which is returned by:
XRRCrtcGamma * XRRGetCrtcGamma (Display *dpy, RRCrtc crtc);
I don't think we want to do any gamma correction on the server. The client will do it already when rendering the output. Would be easy to add if we need it.
modified dummy driver which dumps a lot more information about internal data structures
Following the work on #349, down the rabbit hole we go..
XRRGetOutputInfo
is from libXRandR, it gets the mm dimensions from the xRRGetOutputInfoReply
response to a RRGetOutputInfo
X11 server call (subpixelOrder
is in there too).
The server populates xRRGetOutputInfoReply
from the RROutputPtr
it gets using the VERIFY_RR_OUTPUT
macro..
RROutputPtr
is a pointer to RROutputRec
(aka _rrOutput
) which has more or less the same data in it, including mm and subpixel order.
The only place the server creates RROutputRec
is in RROutputCreate
.
But when I dump the outputs in the dummy driver, there aren't any! And if I add one using:
output = RROutputCreate(pScrn->pScreen, "default", 7, NULL); output->mmWidth = pScrn->pScreen->mmWidth; output->mmHeight = pScrn->pScreen->mmHeight;
It shows the output (and more warnings about missing modes for the output):
dummy connected 2560x1600+0+0 (0x55) normal (normal) 677mm x 423mm
but the mm stays at 0...
In the end, I think the "default" output we see is a virtual one. Created where?
I give up. For now.
hacked driver with lots of unsuccessful changes to try to figure out what we need to do
Re-scheduling, see ticket:56#comment:9
No movement on this upstream, re-scheduling.
Milestone renamed
Milestone renamed
Best to deal with this in #56
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/728