xserver: Branch 'master' - 5 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed May 4 19:38:03 UTC 2016


 hw/xfree86/drivers/modesetting/driver.c |   66 ++++++++++++++++----------------
 hw/xfree86/modes/xf86Crtc.c             |    3 -
 randr/rrprovider.c                      |    2 
 3 files changed, 39 insertions(+), 32 deletions(-)

New commits:
commit 2378adde6770385c06f7efcd32f270d00d49ce3f
Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Apr 29 14:01:33 2016 +1000

    modesetting: set capabilities up after glamor and enable offload caps.
    
    This moves the capabilites setting to after glamor is initialised, and
    enables the offload caps in cases where they work. This enables DRI2
    PRIME support with modesetting.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index abf7e1a..cd59c06 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -820,18 +820,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
         return FALSE;
     ms->drmmode.fd = ms->fd;
 
-    pScrn->capabilities = 0;
-#ifdef DRM_CAP_PRIME
-    ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value);
-    if (ret == 0) {
-        if (value & DRM_PRIME_CAP_IMPORT)
-            pScrn->capabilities |= RR_Capability_SinkOutput;
-#if GLAMOR_HAS_GBM_LINEAR
-        if (value & DRM_PRIME_CAP_EXPORT)
-            pScrn->capabilities |= RR_Capability_SourceOutput;
-#endif
-    }
-#endif
     drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp);
     if (defaultdepth == 24 && defaultbpp == 24)
         bppflags = SupportConvert32to24 | Support24bppFb;
@@ -907,6 +895,22 @@ PreInit(ScrnInfoPtr pScrn, int flags)
         ms->drmmode.pageflip = FALSE;
     }
 
+    pScrn->capabilities = 0;
+#ifdef DRM_CAP_PRIME
+    ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value);
+    if (ret == 0) {
+        if (value & DRM_PRIME_CAP_IMPORT) {
+            pScrn->capabilities |= RR_Capability_SinkOutput;
+            if (ms->drmmode.glamor)
+                pScrn->capabilities |= RR_Capability_SourceOffload;
+        }
+#if GLAMOR_HAS_GBM_LINEAR
+        if (value & DRM_PRIME_CAP_EXPORT && ms->drmmode.glamor)
+            pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
+#endif
+    }
+#endif
+
     if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n");
         goto fail;
commit 258588224d6b35de12f97d9092efa5cb3e426550
Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Apr 29 14:01:32 2016 +1000

    xf86Crtc: don't set the root window property on slave GPUs.
    
    Slave GPUs don't have a root window to set this on, so don't.
    
    This fixes some crashes I saw just playing around.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 6091b5e..4a13c13 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3285,7 +3285,8 @@ xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon)
     }
 
     /* Set the DDC properties for the 'compat' output */
-    if (output == xf86CompatOutput(scrn))
+    /* GPU screens don't have a root window */
+    if (output == xf86CompatOutput(scrn) && !scrn->is_gpu)
         xf86SetDDCproperties(scrn, edid_mon);
 
 #ifdef RANDR_12_INTERFACE
commit a41a171bcbae9aeafac2865faa904f15d9b59925
Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Apr 29 14:01:31 2016 +1000

    modesetting: set driverPrivate to NULL after closing fd.
    
    Otherwise ms_ent_priv will return NULL and things will fall apart.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index c97f33a..abf7e1a 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -635,7 +635,6 @@ FreeRec(ScrnInfoPtr pScrn)
     ms = modesettingPTR(pScrn);
     if (!ms)
         return;
-    pScrn->driverPrivate = NULL;
 
     if (ms->fd > 0) {
         modesettingEntPtr ms_ent;
@@ -656,6 +655,7 @@ FreeRec(ScrnInfoPtr pScrn)
             ms_ent->fd = 0;
         }
     }
+    pScrn->driverPrivate = NULL;
     free(ms->drmmode.Options);
     free(ms);
 
commit fc1f61b75c9712e24ff665f95d62771f39eba1c7
Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Apr 29 14:01:30 2016 +1000

    randr/provider: only allow slave gpu to be offload sources.
    
    The other way around makes no sense.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index bbb8e51..5329f41 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -325,6 +325,8 @@ ProcRRSetProviderOffloadSink(ClientPtr client)
     VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
     if (!(provider->capabilities & RR_Capability_SourceOffload))
         return BadValue;
+    if (!provider->pScreen->isGPU)
+        return BadValue;
 
     if (stuff->sink_provider) {
         VERIFY_RR_PROVIDER(stuff->sink_provider, sink_provider, DixReadAccess);
commit 2d0f151c6195ba94d0320b55227a108e6301a74c
Author: Alex Goins <agoins at nvidia.com>
Date:   Fri Apr 29 14:01:29 2016 +1000

    modesetting: Consistent whitespace in driver.c
    
    For some reason a couple of the dirty functions in driver.c used 8
    spaces per tab instead of 4 like the rest of the file. Fix this to make
    it more consistent and give me more room to work in ms_dirty_update in
    subsequent commits.
    
    v1: N/A
    v2: N/A
    v3: N/A
    v4: Initial commit
    
    Signed-off-by: Alex Goins <agoins at nvidia.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index fe5d5e1..c97f33a 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -568,32 +568,32 @@ static void
 redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
 {
 
-        RegionRec pixregion;
+    RegionRec pixregion;
 
-        PixmapRegionInit(&pixregion, dirty->slave_dst);
-        DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
-        PixmapSyncDirtyHelper(dirty);
+    PixmapRegionInit(&pixregion, dirty->slave_dst);
+    DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+    PixmapSyncDirtyHelper(dirty);
 
-        DamageRegionProcessPending(&dirty->slave_dst->drawable);
-        RegionUninit(&pixregion);
+    DamageRegionProcessPending(&dirty->slave_dst->drawable);
+    RegionUninit(&pixregion);
 }
 
 static void
 ms_dirty_update(ScreenPtr screen)
 {
-        RegionPtr region;
-        PixmapDirtyUpdatePtr ent;
-
-        if (xorg_list_is_empty(&screen->pixmap_dirty_list))
-                return;
-
-        xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) {
-                region = DamageRegion(ent->damage);
-                if (RegionNotEmpty(region)) {
-                        redisplay_dirty(screen, ent);
-                        DamageEmpty(ent->damage);
-                }
+    RegionPtr region;
+    PixmapDirtyUpdatePtr ent;
+
+    if (xorg_list_is_empty(&screen->pixmap_dirty_list))
+        return;
+
+    xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) {
+        region = DamageRegion(ent->damage);
+        if (RegionNotEmpty(region)) {
+            redisplay_dirty(screen, ent);
+            DamageEmpty(ent->damage);
         }
+    }
 }
 
 static void


More information about the xorg-commit mailing list