Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / driver / 
xserver-xorg-video-amdgpu


Commits:
6ee85772 by Dave Airlie at 2019-03-07T15:25:19Z
modesetting: add tile property support

This adds tiling support to the driver, it retrieves the tile info from
the kernel and translates it into the server format and exposes the
property.

(Ported from xserver commits 8fb8bbb3062f1a06621ab7030a9e89d5e8367b35
 and 6abdb54a11dac4e8854ff94ecdcb90a14321ab31)
Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

- - - - -
bd4ffd4e by Michel Dänzer at 2019-03-19T17:44:31Z
Bump version for the 19.0.1 release

- - - - -


3 changed files:

- configure.ac
- src/drmmode_display.c
- src/drmmode_display.h


Changes:

=====================================
configure.ac
=====================================
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-amdgpu],
-        [19.0.0],
+        [19.0.1],
         
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/AMDgpu],
         [xf86-video-amdgpu])
 


=====================================
src/drmmode_display.c
=====================================
@@ -2142,6 +2142,51 @@ drmmode_output_mode_valid(xf86OutputPtr output, 
DisplayModePtr pModes)
        return MODE_OK;
 }
 
+static void
+drmmode_output_attach_tile(xf86OutputPtr output)
+{
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0)
+       drmmode_output_private_ptr drmmode_output = output->driver_private;
+       drmModeConnectorPtr koutput = drmmode_output->mode_output;
+       AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(output->scrn);
+       struct xf86CrtcTileInfo tile_info, *set = NULL;
+       int i;
+
+       if (!koutput) {
+               xf86OutputSetTile(output, NULL);
+               return;
+       }
+
+       /* look for a TILE property */
+       for (i = 0; i < koutput->count_props; i++) {
+               drmModePropertyPtr props;
+               props = drmModeGetProperty(pAMDGPUEnt->fd, koutput->props[i]);
+               if (!props)
+                       continue;
+
+               if (!(props->flags & DRM_MODE_PROP_BLOB)) {
+                       drmModeFreeProperty(props);
+                       continue;
+               }
+
+               if (!strcmp(props->name, "TILE")) {
+                       drmModeFreePropertyBlob(drmmode_output->tile_blob);
+                       drmmode_output->tile_blob =
+                               drmModeGetPropertyBlob(pAMDGPUEnt->fd,
+                                                      koutput->prop_values[i]);
+               }
+               drmModeFreeProperty(props);
+       }
+       if (drmmode_output->tile_blob) {
+               if (xf86OutputParseKMSTile(drmmode_output->tile_blob->data,
+                                          drmmode_output->tile_blob->length,
+                                          &tile_info) == TRUE)
+                       set = &tile_info;
+       }
+       xf86OutputSetTile(output, set);
+#endif
+}
+
 static int
 koutput_get_prop_idx(int fd, drmModeConnectorPtr koutput,
         int type, const char *name)
@@ -2213,6 +2258,8 @@ static DisplayModePtr 
drmmode_output_get_modes(xf86OutputPtr output)
        }
        xf86OutputSetEDID(output, mon);
 
+       drmmode_output_attach_tile(output);
+
        /* modes should already be available */
        for (i = 0; i < koutput->count_modes; i++) {
                Mode = xnfalloc(sizeof(DisplayModeRec));
@@ -2230,8 +2277,11 @@ static void drmmode_output_destroy(xf86OutputPtr output)
        drmmode_output_private_ptr drmmode_output = output->driver_private;
        int i;
 
-       if (drmmode_output->edid_blob)
-               drmModeFreePropertyBlob(drmmode_output->edid_blob);
+       drmModeFreePropertyBlob(drmmode_output->edid_blob);
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0)
+       drmModeFreePropertyBlob(drmmode_output->tile_blob);
+#endif
+
        for (i = 0; i < drmmode_output->num_props; i++) {
                drmModeFreeProperty(drmmode_output->props[i].mode_prop);
                free(drmmode_output->props[i].atoms);


=====================================
src/drmmode_display.h
=====================================
@@ -163,6 +163,9 @@ typedef struct {
        drmModeConnectorPtr mode_output;
        drmModeEncoderPtr *mode_encoders;
        drmModePropertyBlobPtr edid_blob;
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0)
+       drmModePropertyBlobPtr tile_blob;
+#endif
        int dpms_enum_id;
        int num_props;
        drmmode_prop_ptr props;



View it on GitLab: 
https://salsa.debian.org/xorg-team/driver/xserver-xorg-video-amdgpu/compare/9534bf3bb33d14cd3a5af08e36ef42b309647fc7...bd4ffd4ebbdf1c43ab9e1ef9ba8b812fd2dde4a4

-- 
View it on GitLab: 
https://salsa.debian.org/xorg-team/driver/xserver-xorg-video-amdgpu/compare/9534bf3bb33d14cd3a5af08e36ef42b309647fc7...bd4ffd4ebbdf1c43ab9e1ef9ba8b812fd2dde4a4
You're receiving this email because of your account on salsa.debian.org.

Reply via email to