summary refs log tree commit diff
path: root/gnu/packages/patches/xorg-server-rotate-fb.patch
blob: f47036b2a7895f4a8d76633ce3358044beeece95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
commit a85e94a50c94b07574c8701a3ff3c1243f4257f4
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Fri Jun 15 08:57:12 2018 +0200

    modesetting: use drmmode_bo_import() for rotate_fb
    
    drmmode_shadow_allocate() still uses drmModeAddFB() which may fail if
    the format is not as expected, preventing from using a rotated output.
    
    Change it to use the new function drmmode_bo_import() which takes care
    of calling the drmModeAddFB2() API.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106715
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Tested-by: Tomas Pelka <tpelka@redhat.com>
    Reviewed-by: Lyude Paul <lyude@redhat.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 859a21a9d..ec11b3f56 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1794,11 +1794,8 @@ drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
         return NULL;
     }
 
-    ret = drmModeAddFB(drmmode->fd, width, height, crtc->scrn->depth,
-                       drmmode->kbpp,
-                       drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo),
-                       drmmode_bo_get_handle(&drmmode_crtc->rotate_bo),
-                       &drmmode_crtc->rotate_fb_id);
+    ret = drmmode_bo_import(drmmode, &drmmode_crtc->rotate_bo,
+                            &drmmode_crtc->rotate_fb_id);
 
     if (ret) {
         ErrorF("failed to add rotate fb\n");