Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon GART might not be mapp...



details:   https://anonhg.NetBSD.org/src/rev/67dfaa180168
branches:  trunk
changeset: 366211:67dfaa180168
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 13:56:09 2018 +0000

description:
GART might not be mapped with bus_dma.

Still need membar and tlb flush in that case.

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r f4ce4fcdaddf -r 67dfaa180168 sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c       Mon Aug 27 13:55:59 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c       Mon Aug 27 13:56:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_gart.c,v 1.8 2018/08/27 06:37:00 riastradh Exp $        */
+/*     $NetBSD: radeon_gart.c,v 1.9 2018/08/27 13:56:09 riastradh Exp $        */
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *          Jerome Glisse
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_gart.c,v 1.8 2018/08/27 06:37:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_gart.c,v 1.9 2018/08/27 13:56:09 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/radeon_drm.h>
@@ -280,11 +280,10 @@
     unsigned gpu_npages)
 {
 
-       if (rdev->gart.ptr != NULL) {
+       if (rdev->gart.rg_table_map != NULL) {
                const unsigned entsize =
                    rdev->gart.table_size / rdev->gart.num_gpu_pages;
 
-               KASSERT(rdev->gart.rg_table_map != NULL);
                bus_dmamap_sync(rdev->ddev->dmat, rdev->gart.rg_table_map,
                    gpu_pgstart*entsize, gpu_npages*entsize,
                    BUS_DMASYNC_PREWRITE);
@@ -296,15 +295,16 @@
     unsigned gpu_npages)
 {
 
-       if (rdev->gart.ptr != NULL) {
+       if (rdev->gart.rg_table_map != NULL) {
                const unsigned entsize =
                    rdev->gart.table_size / rdev->gart.num_gpu_pages;
 
-               KASSERT(rdev->gart.rg_table_map != NULL);
-               membar_sync();          /* XXX overkill */
                bus_dmamap_sync(rdev->ddev->dmat, rdev->gart.rg_table_map,
                    gpu_pgstart*entsize, gpu_npages*entsize,
                    BUS_DMASYNC_POSTWRITE);
+       }
+       if (rdev->gart.ptr != NULL) {
+               membar_sync();          /* XXX overkill */
                radeon_gart_tlb_flush(rdev);
        }
 }



Home | Main Index | Thread Index | Old Index