Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xf86-video-ati-kms/dist/src When adding an FB...



details:   https://anonhg.NetBSD.org/xsrc/rev/2d00cb34332d
branches:  trunk
changeset: 10420:2d00cb34332d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Feb 07 23:36:50 2020 +0000

description:
When adding an FB, don't assume that the front buffer is a radeon buffer
(it could be GBM managed instead).

diffstat:

 external/mit/xf86-video-ati-kms/dist/src/drmmode_display.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 710ee975b5d2 -r 2d00cb34332d external/mit/xf86-video-ati-kms/dist/src/drmmode_display.c
--- a/external/mit/xf86-video-ati-kms/dist/src/drmmode_display.c        Mon Dec 30 18:27:50 2019 +0000
+++ b/external/mit/xf86-video-ati-kms/dist/src/drmmode_display.c        Fri Feb 07 23:36:50 2020 +0000
@@ -870,6 +870,7 @@
        Rotation saved_rotation;
        DisplayModeRec saved_mode;
        Bool ret = FALSE;
+       uint32_t handle;
        int i;
        struct drmmode_fb *fb = NULL;
 
@@ -917,10 +918,15 @@
                if (!fb)
                        fb = radeon_pixmap_get_fb(pScreen->GetWindowPixmap(pScreen->root));
                if (!fb) {
+                       if (info->front_buffer->flags & RADEON_BO_FLAGS_GBM) {
+                               handle = gbm_bo_get_handle(info->front_buffer->bo.gbm).u32;
+                       } else {
+                               handle = info->front_buffer->bo.radeon->handle;
+                       }
                        fb = radeon_fb_create(pScrn, pRADEONEnt->fd,
                                              pScrn->virtualX, pScrn->virtualY,
                                              pScrn->displayWidth * info->pixel_bytes,
-                                             info->front_buffer->bo.radeon->handle);
+                                             handle);
                        /* Prevent refcnt of ad-hoc FBs from reaching 2 */
                        drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, NULL);
                        drmmode_crtc->fb = fb;



Home | Main Index | Thread Index | Old Index