winsys/radeon: add a flag telling how gfx IBs should be padded
authorMarek Olšák <marek.olsak@amd.com>
Sun, 30 Aug 2015 15:41:23 +0000 (17:41 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 1 Sep 2015 19:51:15 +0000 (21:51 +0200)
This is always false on amdgpu (set by calloc).

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/winsys/radeon/drm/radeon_drm_cs.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index a4a2ae15acd64d2f3023287906803b7e9bf26966..00accd5b3e6fbf6428d259108fbaba9460f0c5c0 100644 (file)
@@ -223,6 +223,7 @@ struct radeon_info {
     boolean                     has_uvd;
     uint32_t                    vce_fw_version;
     boolean                     has_userptr;
+    bool                        gfx_ib_pad_with_type2;
 
     uint32_t                    r300_num_gb_pipes;
     uint32_t                    r300_num_z_pipes;
index 341af55df8b782411a86cb15ba48d0b00a58b839..2c4f990944c8cfc2746a928bb25e4d992a24c8ee 100644 (file)
@@ -466,14 +466,10 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs,
         }
         break;
     case RING_GFX:
-        /* pad DMA ring to 8 DWs to meet CP fetch alignment requirements
+        /* pad GFX ring to 8 DWs to meet CP fetch alignment requirements
          * r6xx, requires at least 4 dw alignment to avoid a hw bug.
-         * hawaii with old firmware needs type2 nop packet.
-         * accel_working2 with value 3 indicates the new firmware.
          */
-        if (cs->ws->info.chip_class <= SI ||
-            (cs->ws->info.family == CHIP_HAWAII &&
-             cs->ws->accel_working2 < 3)) {
+        if (cs->ws->info.gfx_ib_pad_with_type2) {
             while (rcs->cdw & 7)
                 OUT_CS(&cs->base, 0x80000000); /* type2 nop packet */
         } else {
index 384d7280380fe2d40bba59bfe9021a07a4a5c4f6..5d440eb769665d63e98180bcc1a98d10deaea9a2 100644 (file)
@@ -469,6 +469,13 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
         ws->info.cik_macrotile_mode_array_valid = TRUE;
     }
 
+    /* Hawaii with old firmware needs type2 nop packet.
+     * accel_working2 with value 3 indicates the new firmware.
+     */
+    ws->info.gfx_ib_pad_with_type2 = ws->info.chip_class <= SI ||
+                                    (ws->info.family == CHIP_HAWAII &&
+                                     ws->accel_working2 < 3);
+
     return TRUE;
 }