xserver: Branch 'master' - 2 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Apr 2 19:40:45 UTC 2018


 hw/xfree86/drivers/modesetting/drmmode_display.c |   28 +++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

New commits:
commit f580116f3c89b3c086655cbd441f84e50115ea78
Author: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Date:   Thu Mar 29 01:07:26 2018 -0400

    modesetting: Fix reported size when using atomic modesetting
    
    The framebuffer can include multiple CRTCs in multi-monitors
    setup. So we shouldn't use the buffer size but the CRTC size
    instead. Rotated displays are shadowed, so we don't need to
    worry about it there.
    
    Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
    Tested-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Daniel Stone <daniels at collabora.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 09eec0814..e23893883 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -562,15 +562,15 @@ drmmode_crtc_set_fb(xf86CrtcPtr crtc, DisplayModePtr mode, uint32_t fb_id,
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_X, x << 16);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_Y, y << 16);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_W,
-                              drmmode->front_bo.width << 16);
+                              crtc->mode.HDisplay << 16);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_H,
-                              drmmode->front_bo.height << 16);
+                              crtc->mode.VDisplay << 16);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_X, 0);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_Y, 0);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_W,
-                              drmmode->front_bo.width);
+                              crtc->mode.HDisplay);
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_H,
-                              drmmode->front_bo.height);
+                              crtc->mode.VDisplay);
 
         if (ret == 0)
             ret = drmModeAtomicCommit(ms->fd, req, flags, data);
commit ce7d5087cfe1d2df756d93b7f567b3c0b0a7f6a8
Author: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Date:   Thu Mar 29 01:07:25 2018 -0400

    modesetting: Ignore alpha channel when importing BOs for modesetting
    
    Fixes a regression caused by modifiers support. For some hw to
    continue working even if not supporting ARGB8888 and ARGB2101010
    formats, we assume that all imported BOs are opaque.
    
    Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
    Tested-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Daniel Stone <daniels at collabora.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 03d2fa226..09eec0814 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -70,12 +70,28 @@ modifiers_ptr(struct drm_format_modifier_blob *blob)
     return (struct drm_format_modifier *)(((char *)blob) + blob->modifiers_offset);
 }
 
+static uint32_t
+get_opaque_format(uint32_t format)
+{
+    switch (format) {
+    case DRM_FORMAT_ARGB8888:
+        return DRM_FORMAT_XRGB8888;
+    case DRM_FORMAT_ARGB2101010:
+        return DRM_FORMAT_XRGB2101010;
+    default:
+        return format;
+    }
+}
+
 Bool
 drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t modifier)
 {
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     int c, i, j;
 
+    /* BO are imported as opaque surface, so let's pretend there is no alpha */
+    format = get_opaque_format(format);
+
     for (c = 0; c < xf86_config->num_crtc; c++) {
         xf86CrtcPtr crtc = xf86_config->crtc[c];
         drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -123,6 +139,9 @@ get_modifiers_set(ScrnInfoPtr scrn, uint32_t format, uint64_t **modifiers,
     int c, i, j, k, count_modifiers = 0;
     uint64_t *tmp, *ret = NULL;
 
+    /* BOs are imported as opaque surfaces, so pretend the same thing here */
+    format = get_opaque_format(format);
+
     *modifiers = NULL;
     for (c = 0; c < xf86_config->num_crtc; c++) {
         xf86CrtcPtr crtc = xf86_config->crtc[c];
@@ -684,6 +703,7 @@ drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo,
             memset(modifiers, 0, sizeof(modifiers));
 
             format = gbm_bo_get_format(bo->gbm);
+            format = get_opaque_format(format);
             for (i = 0; i < num_fds; i++) {
                 handles[i] = gbm_bo_get_handle_for_plane(bo->gbm, i).u32;
                 strides[i] = gbm_bo_get_stride_for_plane(bo->gbm, i);


More information about the xorg-commit mailing list