From 1be5b715827ef2bbc75ef795c301a1a7ba6e5f09 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 31 Mar 2015 09:59:58 +0100 Subject: Add TILE property support (for MST tiled monitors) Based on the patch for modesetting (and lots of work) by Dave Airlie Signed-off-by: Chris Wilson --- src/uxa/intel_display.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/uxa') diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c index 544382a0..a95b3de5 100644 --- a/src/uxa/intel_display.c +++ b/src/uxa/intel_display.c @@ -868,6 +868,48 @@ intel_output_attach_edid(xf86OutputPtr output) xf86OutputSetEDID(output, mon); } +static void +intel_output_attach_tile(xf86OutputPtr output) +{ +#if XF86_OUTPUT_VERSION >= 3 + struct intel_output *intel_output = output->driver_private; + drmModeConnectorPtr koutput = intel_output->mode_output; + struct intel_mode *mode = intel_output->mode; + drmModePropertyBlobPtr blob = NULL; + struct xf86CrtcTileInfo tile_info, *set = NULL; + int i; + + for (i = 0; koutput && i < koutput->count_props; i++) { + drmModePropertyPtr props; + + props = drmModeGetProperty(mode->fd, koutput->props[i]); + if (!props) + continue; + + if (!(props->flags & DRM_MODE_PROP_BLOB)) { + drmModeFreeProperty(props); + continue; + } + + if (!strcmp(props->name, "TILE")) { + blob = drmModeGetPropertyBlob(mode->fd, + koutput->prop_values[i]); + } + drmModeFreeProperty(props); + } + + if (blob) { + if (xf86OutputParseKMSTile(blob->data, + blob->length, + &tile_info)) + set = &tile_info; + drmModeFreePropertyBlob(blob); + } + + xf86OutputSetTile(output, set); +#endif +} + static DisplayModePtr intel_output_panel_edid(xf86OutputPtr output, DisplayModePtr modes) { @@ -923,6 +965,7 @@ intel_output_get_modes(xf86OutputPtr output) int i; intel_output_attach_edid(output); + intel_output_attach_tile(output); if (!koutput) return Modes; -- cgit v1.2.3