From: Fedora X Ninjas <[email protected]> Add support for drivers to set the tiling property. This is used by clients to work out the monitor tiles for DisplayID monitors.
Signed-off-by: Dave Airlie <[email protected]> --- hw/xfree86/modes/xf86Crtc.c | 30 ++++++++++++++++++++++++++++++ hw/xfree86/modes/xf86Crtc.h | 13 +++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 9d592a7..ddf4e7d 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -3026,6 +3026,25 @@ xf86OutputSetEDIDProperty(xf86OutputPtr output, void *data, int data_len) } } +#define TILE_ATOM_NAME "TILE" +static void +xf86OutputSetTileProperty(xf86OutputPtr output, const char *data, int data_len) +{ + Atom tile_atom = MakeAtom(TILE_ATOM_NAME, sizeof(TILE_ATOM_NAME) - 1, TRUE); + + /* This may get called before the RandR resources have been created */ + if (output->randr_output == NULL) + return; + + if (data_len != 0) { + RRChangeOutputProperty(output->randr_output, tile_atom, XA_INTEGER, 8, + PropModeReplace, data_len, (char *)data, FALSE, TRUE); + } + else { + RRDeleteOutputProperty(output->randr_output, tile_atom); + } +} + #endif /* Pull out a phyiscal size from a detailed timing if available. */ @@ -3071,6 +3090,17 @@ handle_detailed_physical_size(struct detailed_monitor_section } } +void +xf86OutputSetTile(xf86OutputPtr output, const char *tile_data, int tile_length) +{ + output->tile_info = tile_data; + output->tile_length = tile_length; +#ifdef RANDR_12_INTERFACE + xf86OutputSetTileProperty(output, tile_data ? tile_data : NULL, + tile_length); +#endif +} + /** * Set the EDID information for the specified output */ diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 692bf40..49101cb 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -226,7 +226,7 @@ typedef struct _xf86CrtcFuncs { } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; -#define XF86_CRTC_VERSION 5 +#define XF86_CRTC_VERSION 6 struct _xf86Crtc { /** @@ -500,7 +500,7 @@ typedef struct _xf86OutputFuncs { (*destroy) (xf86OutputPtr output); } xf86OutputFuncsRec, *xf86OutputFuncsPtr; -#define XF86_OUTPUT_VERSION 2 +#define XF86_OUTPUT_VERSION 3 struct _xf86Output { /** @@ -615,6 +615,9 @@ struct _xf86Output { BoxRec initialTotalArea; BoxRec initialTrackingArea; INT16 initialBorder[4]; + + const char *tile_info; + int tile_length; }; typedef struct _xf86ProviderFuncs { @@ -881,6 +884,12 @@ extern _X_EXPORT void xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon); /** + * Set the TILE information for the specified output + */ +extern _X_EXPORT void +xf86OutputSetTile(xf86OutputPtr output, const char *tile_data, int tile_length); + +/** * Return the list of modes supported by the EDID information * stored in 'output' */ -- 2.1.0 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
