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 merge ati driver 18.1.0.



details:   https://anonhg.NetBSD.org/xsrc/rev/4164aa0c42ec
branches:  trunk
changeset: 10039:4164aa0c42ec
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Dec 30 07:34:43 2018 +0000

description:
merge ati driver 18.1.0.

diffstat:

 external/mit/xf86-video-ati-kms/dist/src/radeon_kms.c |  300 +++++++----------
 external/mit/xf86-video-ati-kms/include/config.h      |    8 +-
 2 files changed, 126 insertions(+), 182 deletions(-)

diffs (truncated from 656 to 300 lines):

diff -r 9876922d4b49 -r 4164aa0c42ec external/mit/xf86-video-ati-kms/dist/src/radeon_kms.c
--- a/external/mit/xf86-video-ati-kms/dist/src/radeon_kms.c     Sun Dec 30 07:33:48 2018 +0000
+++ b/external/mit/xf86-video-ati-kms/dist/src/radeon_kms.c     Sun Dec 30 07:34:43 2018 +0000
@@ -212,6 +212,11 @@
            info->accel_state = NULL;
        }
 
+#ifdef USE_GLAMOR
+       if (info->gbm)
+           gbm_device_destroy(info->gbm);
+#endif
+
        pEnt = info->pEnt;
        free(pScrn->driverPrivate);
        pScrn->driverPrivate = NULL;
@@ -254,7 +259,7 @@
     stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8;
     *size = stride;
 
-    return ((uint8_t *)info->front_bo->ptr + row * stride + offset);
+    return ((uint8_t *)info->front_buffer->bo.radeon->ptr + row * stride + offset);
 }
 
 static void
@@ -326,7 +331,6 @@
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     RADEONInfoPtr  info   = RADEONPTR(pScrn);
     PixmapPtr pixmap;
-    struct radeon_surface *surface;
 
     pScreen->CreateScreenResources = info->CreateScreenResources;
     if (!(*pScreen->CreateScreenResources)(pScreen))
@@ -360,14 +364,13 @@
     }
 
     if (info->dri2.enabled || info->use_glamor) {
-       if (info->front_bo) {
+       if (info->front_buffer) {
            PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
-           if (!radeon_set_pixmap_bo(pPix, info->front_bo))
+           if (!radeon_set_pixmap_bo(pPix, info->front_buffer))
                return FALSE;
-           surface = radeon_get_pixmap_surface(pPix);
-           if (surface) {
-               *surface = info->front_surface;
-           }
+
+           if (info->surf_man && !info->use_glamor)
+               *radeon_get_pixmap_surface(pPix) = info->front_surface;
        }
     }
 
@@ -523,7 +526,7 @@
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 
-    drmmode_crtc->scanout_update_pending = FALSE;
+    drmmode_crtc->scanout_update_pending = 0;
     drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending,
                         NULL);
 }
@@ -538,15 +541,6 @@
     drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb,
                         drmmode_crtc->flip_pending);
     radeon_scanout_flip_abort(crtc, event_data);
-
-#ifdef HAVE_PRESENT_H
-    if (drmmode_crtc->present_vblank_event_id) {
-       present_event_notify(drmmode_crtc->present_vblank_event_id,
-                            drmmode_crtc->present_vblank_usec,
-                            drmmode_crtc->present_vblank_msc);
-       drmmode_crtc->present_vblank_event_id = 0;
-    }
-#endif
 }
 
 
@@ -608,7 +602,7 @@
 {
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 
-    drmmode_crtc->scanout_update_pending = FALSE;
+    drmmode_crtc->scanout_update_pending = 0;
 }
 
 void
@@ -636,7 +630,7 @@
 {
     ScreenPtr master_screen = radeon_dirty_master(dirty);
 
-    return master_screen->SyncSharedPixmap != NULL;
+    return !!master_screen->SyncSharedPixmap;
 }
 
 static Bool
@@ -644,7 +638,7 @@
 {
     ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen;
 
-    return slave_screen->SyncSharedPixmap != NULL;
+    return !!slave_screen->SyncSharedPixmap;
 }
 
 static void
@@ -749,7 +743,7 @@
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 
     radeon_prime_scanout_do_update(crtc, 0);
-    drmmode_crtc->scanout_update_pending = FALSE;
+    drmmode_crtc->scanout_update_pending = 0;
 }
 
 static void
@@ -790,7 +784,7 @@
        return;
     }
 
-    drmmode_crtc->scanout_update_pending = TRUE;
+    drmmode_crtc->scanout_update_pending = drm_queue_seq;
 }
 
 static void
@@ -848,7 +842,7 @@
     }
 
     drmmode_crtc->scanout_id = scanout_id;
-    drmmode_crtc->scanout_update_pending = TRUE;
+    drmmode_crtc->scanout_update_pending = drm_queue_seq;
 }
 
 static void
@@ -903,10 +897,10 @@
 
 Bool
 radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
-                        PixmapPtr src_pix, BoxPtr extents)
+                        PixmapPtr src_pix, BoxRec extents)
 {
     drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
-    RegionRec region = { .extents = *extents, .data = NULL };
+    RegionRec region = { .extents = extents, .data = NULL };
     ScrnInfoPtr scrn = xf86_crtc->scrn;
     ScreenPtr pScreen = scrn->pScreen;
     RADEONInfoPtr info = RADEONPTR(scrn);
@@ -915,11 +909,11 @@
 
     if (!xf86_crtc->enabled ||
        !drmmode_crtc->scanout[scanout_id].pixmap ||
-       extents->x1 >= extents->x2 || extents->y1 >= extents->y2)
+       extents.x1 >= extents.x2 || extents.y1 >= extents.y2)
        return FALSE;
 
     pDraw = &drmmode_crtc->scanout[scanout_id].pixmap->drawable;
-    if (!radeon_scanout_extents_intersect(xf86_crtc, extents))
+    if (!radeon_scanout_extents_intersect(xf86_crtc, &extents))
        return FALSE;
 
     if (drmmode_crtc->tear_free) {
@@ -965,9 +959,9 @@
        pScreen->SourceValidate = NULL;
        CompositePicture(PictOpSrc,
                         src, NULL, dst,
-                        extents->x1, extents->y1, 0, 0, extents->x1,
-                        extents->y1, extents->x2 - extents->x1,
-                        extents->y2 - extents->y1);
+                        extents.x1, extents.y1, 0, 0, extents.x1,
+                        extents.y1, extents.x2 - extents.x1,
+                        extents.y2 - extents.y1);
        pScreen->SourceValidate = SourceValidate;
 
  free_dst:
@@ -981,14 +975,12 @@
 
        ValidateGC(pDraw, gc);
        (*gc->ops->CopyArea)(&src_pix->drawable, pDraw, gc,
-                            xf86_crtc->x + extents->x1, xf86_crtc->y + extents->y1,
-                            extents->x2 - extents->x1, extents->y2 - extents->y1,
-                            extents->x1, extents->y1);
+                            xf86_crtc->x + extents.x1, xf86_crtc->y + extents.y1,
+                            extents.x2 - extents.x1, extents.y2 - extents.y1,
+                            extents.x1, extents.y1);
        FreeScratchGC(gc);
     }
 
-    radeon_cs_flush_indirect(scrn);
-
     info->accel_state->force = force;
 
     return TRUE;
@@ -999,7 +991,7 @@
 {
     drmmode_crtc_private_ptr drmmode_crtc = event_data;
 
-    drmmode_crtc->scanout_update_pending = FALSE;
+    drmmode_crtc->scanout_update_pending = 0;
 }
 
 static void
@@ -1015,8 +1007,10 @@
        drmmode_crtc->dpms_mode == DPMSModeOn) {
        if (radeon_scanout_do_update(crtc, drmmode_crtc->scanout_id,
                                     screen->GetWindowPixmap(screen->root),
-                                    &region->extents))
+                                    region->extents)) {
+           radeon_cs_flush_indirect(crtc->scrn);
            RegionEmpty(region);
+       }
     }
 
     radeon_scanout_update_abort(crtc, event_data);
@@ -1074,7 +1068,7 @@
        return;
     }
 
-    drmmode_crtc->scanout_update_pending = TRUE;
+    drmmode_crtc->scanout_update_pending = drm_queue_seq;
 }
 
 static void
@@ -1096,8 +1090,10 @@
     scanout_id = drmmode_crtc->scanout_id ^ 1;
     if (!radeon_scanout_do_update(xf86_crtc, scanout_id,
                                  pScreen->GetWindowPixmap(pScreen->root),
-                                 &region->extents))
+                                 region->extents))
        return;
+
+    radeon_cs_flush_indirect(scrn);
     RegionEmpty(region);
 
     drm_queue_seq = radeon_drm_queue_alloc(xf86_crtc,
@@ -1139,7 +1135,7 @@
     }
 
     drmmode_crtc->scanout_id = scanout_id;
-    drmmode_crtc->scanout_update_pending = TRUE;
+    drmmode_crtc->scanout_update_pending = drm_queue_seq;
 }
 
 static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
@@ -1162,6 +1158,9 @@
            xf86CrtcPtr crtc = xf86_config->crtc[c];
            drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 
+           if (drmmode_crtc->rotate.pixmap)
+               continue;
+
            if (drmmode_crtc->tear_free)
                radeon_scanout_flip(pScreen, info, crtc);
            else if (drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
@@ -1681,8 +1680,7 @@
     pScreen->WindowExposures(pWin, pRegion);
 #endif
 
-    radeon_cs_flush_indirect(pScrn);
-    radeon_bo_wait(info->front_bo);
+    radeon_finish(pScrn, info->front_buffer);
     drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
 }
 
@@ -1762,7 +1760,7 @@
     info->dri2.available = FALSE;
     info->dri2.enabled = FALSE;
     info->dri2.pKernelDRMVersion = drmGetVersion(pRADEONEnt->fd);
-    if (info->dri2.pKernelDRMVersion == NULL) {
+    if (!info->dri2.pKernelDRMVersion) {
        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                   "RADEONDRIGetVersion failed to get the DRM version\n");
        return FALSE;
@@ -1782,7 +1780,7 @@
        return FALSE;
     }
 
-    radeon_drm_queue_init();
+    radeon_drm_queue_init(pScrn);
 
     info->allowColorTiling2D = FALSE;
 
@@ -1917,7 +1915,7 @@
            xf86OutputPtr output = xf86_config->output[i];
 
            /* XXX: double check crtc mode */
-           if ((output->probed_modes != NULL) && (output->crtc == NULL))
+           if (output->probed_modes && !output->crtc)
                output->crtc = xf86_config->crtc[0];
        }
     }
@@ -1980,7 +1978,7 @@
        if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE;
     }
 
-    if (pScrn->modes == NULL
+    if (!pScrn->modes
 #ifdef XSERVER_PLATFORM_BUS
         && !pScrn->is_gpu
 #endif
@@ -2017,12 +2015,8 @@
            return FALSE;
        }
 



Home | Main Index | Thread Index | Old Index