summaryrefslogtreecommitdiff
path: root/src/uxa
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-03-31 09:59:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-03-31 22:31:06 +0100
commit1be5b715827ef2bbc75ef795c301a1a7ba6e5f09 (patch)
tree6986697780374e7e9d3bd37e95b3516d537d1bd0 /src/uxa
parent8dc716e8667f918af5febc82ed301aeff59d86f0 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/uxa')
-rw-r--r--src/uxa/intel_display.c43
1 files changed, 43 insertions, 0 deletions
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;