drm/radeon: switch UVD code to use UVD_NO_OP for padding
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Aug 2016 14:07:28 +0000 (10:07 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Aug 2016 20:25:05 +0000 (16:25 -0400)
Replace packet2's with packet0 writes to UVD_NO_OP.  The
value written to UVD_NO_OP does not matter.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 files changed:
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/cikd.h
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/evergreend.h
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/nid.h
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon_uvd.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/radeon/rv770d.h
drivers/gpu/drm/radeon/si.c
drivers/gpu/drm/radeon/sid.h

index a0427f0adbab25e9eaf0ba585c9616e0647f3c6d..b1784a1b482a7f173a7d445f845252a67866e23a 100644 (file)
@@ -8207,7 +8207,7 @@ static void cik_uvd_resume(struct radeon_device *rdev)
                return;
 
        ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
-       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, RADEON_CP_PACKET2);
+       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, PACKET0(UVD_NO_OP, 0));
        if (r) {
                dev_err(rdev->dev, "failed initializing UVD ring (%d).\n", r);
                return;
index cead2284fd796790fba849343b8891aa86134031..48db93577c1dacadbf9804d7b21efedcb8023bd0 100644 (file)
 #define UVD_UDEC_ADDR_CONFIG           0xef4c
 #define UVD_UDEC_DB_ADDR_CONFIG                0xef50
 #define UVD_UDEC_DBW_ADDR_CONFIG       0xef54
+#define UVD_NO_OP                      0xeffc
 
 #define UVD_LMI_EXT40_ADDR             0xf498
 #define UVD_GP_SCRATCH4                        0xf4e0
index f95db0c1a17a607200b722daac42997e86a8f664..0b6b5766216faa525728abcc31b157ca95e5a6ee 100644 (file)
@@ -5579,7 +5579,7 @@ static void evergreen_uvd_resume(struct radeon_device *rdev)
                return;
 
        ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
-       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, RADEON_CP_PACKET2);
+       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, PACKET0(UVD_NO_OP, 0));
        if (r) {
                dev_err(rdev->dev, "failed initializing UVD ring (%d).\n", r);
                return;
index c8e3d394cde70033798b696305da88c38a9c0c9c..f3d88ca2aa8fc5b09b0330d32e31baa75cca1a65 100644 (file)
 #define UVD_UDEC_ADDR_CONFIG                           0xef4c
 #define UVD_UDEC_DB_ADDR_CONFIG                                0xef50
 #define UVD_UDEC_DBW_ADDR_CONFIG                       0xef54
+#define UVD_NO_OP                                      0xeffc
 #define UVD_RBC_RB_RPTR                                        0xf690
 #define UVD_RBC_RB_WPTR                                        0xf694
 #define UVD_STATUS                                     0xf6bc
index 4a3d7cab83f7a554aea1a21b309815bc83f1900c..103fc8650197bfe8efd6903ba29ba1c3906ccd2a 100644 (file)
@@ -2062,7 +2062,7 @@ static void cayman_uvd_resume(struct radeon_device *rdev)
                return;
 
        ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
-       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, RADEON_CP_PACKET2);
+       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, PACKET0(UVD_NO_OP, 0));
        if (r) {
                dev_err(rdev->dev, "failed initializing UVD ring (%d).\n", r);
                return;
index 47eb49b77d326ac88d2cfb3ec1de0c4632412257..3c9fec88ea4463e072173025431d0ef2c7bbf74a 100644 (file)
 #define UVD_UDEC_ADDR_CONFIG                           0xEF4C
 #define UVD_UDEC_DB_ADDR_CONFIG                                0xEF50
 #define UVD_UDEC_DBW_ADDR_CONFIG                       0xEF54
+#define UVD_NO_OP                                      0xEFFC
 #define UVD_RBC_RB_RPTR                                        0xF690
 #define UVD_RBC_RB_WPTR                                        0xF694
 #define UVD_STATUS                                     0xf6bc
index 9247e7d207fe2e3079819f7511e43f9895b31cb9..640653606f8612b2ddc83adb0a339b2f4eba9c5e 100644 (file)
@@ -3097,7 +3097,7 @@ static void r600_uvd_resume(struct radeon_device *rdev)
                return;
 
        ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
-       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, RADEON_CP_PACKET2);
+       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, PACKET0(UVD_NO_OP, 0));
        if (r) {
                dev_err(rdev->dev, "failed initializing UVD ring (%d).\n", r);
                return;
index 1ae1f139f14e9ea085c77405ea60e557c6dbe40b..0cd0e7bdee5594dbc30f375dacc773d84acfeb29 100644 (file)
@@ -754,8 +754,10 @@ static int radeon_uvd_send_msg(struct radeon_device *rdev,
        ib.ptr[3] = addr >> 32;
        ib.ptr[4] = PACKET0(UVD_GPCOM_VCPU_CMD, 0);
        ib.ptr[5] = 0;
-       for (i = 6; i < 16; ++i)
-               ib.ptr[i] = PACKET2(0);
+       for (i = 6; i < 16; i += 2) {
+               ib.ptr[i] = PACKET0(UVD_NO_OP, 0);
+               ib.ptr[i+1] = 0;
+       }
        ib.length_dw = 16;
 
        r = radeon_ib_schedule(rdev, &ib, NULL, false);
index 1c120a4c3c9781f6f2892318cf1a968197c51c0b..729ae588c970d4861c1b748d72a451c33eb2187a 100644 (file)
@@ -1738,7 +1738,7 @@ static void rv770_uvd_resume(struct radeon_device *rdev)
                return;
 
        ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
-       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, RADEON_CP_PACKET2);
+       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, PACKET0(UVD_NO_OP, 0));
        if (r) {
                dev_err(rdev->dev, "failed initializing UVD ring (%d).\n", r);
                return;
index 9ef2064b1c9cdfc0392c6154258366387a1bf95a..0271f4c559aecf7b24283756e3cd42d702b1adfa 100644 (file)
 #define UVD_UDEC_TILING_CONFIG                          0xef40
 #define UVD_UDEC_DB_TILING_CONFIG                       0xef44
 #define UVD_UDEC_DBW_TILING_CONFIG                      0xef48
+#define UVD_NO_OP                                      0xeffc
 
 #define        GC_USER_SHADER_PIPE_CONFIG                      0x8954
 #define                INACTIVE_QD_PIPES(x)                            ((x) << 8)
index ae5ee74e69a30a7bd5e763663e57a90834ce5044..7ee9aafbdf744bc0a97f358767e5b2178f24c41a 100644 (file)
@@ -6920,7 +6920,7 @@ static void si_uvd_resume(struct radeon_device *rdev)
                return;
 
        ring = &rdev->ring[R600_RING_TYPE_UVD_INDEX];
-       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, RADEON_CP_PACKET2);
+       r = radeon_ring_init(rdev, ring, ring->ring_size, 0, PACKET0(UVD_NO_OP, 0));
        if (r) {
                dev_err(rdev->dev, "failed initializing UVD ring (%d).\n", r);
                return;
index d1a7b58dd291f8798666276acded0290aae805e2..eb220eecba789aaf40ced21852a8d98441e55a3b 100644 (file)
 #define UVD_UDEC_ADDR_CONFIG                           0xEF4C
 #define UVD_UDEC_DB_ADDR_CONFIG                                0xEF50
 #define UVD_UDEC_DBW_ADDR_CONFIG                       0xEF54
+#define UVD_NO_OP                                      0xEFFC
 #define UVD_RBC_RB_RPTR                                        0xF690
 #define UVD_RBC_RB_WPTR                                        0xF694
 #define UVD_STATUS                                     0xf6bc