drm/radeon: use packet2 for nop on hawaii with old firmware
Subsystems (2)
PATCH 1/4 drm/radeon: use packet2 for nop on hawaii with old firmware
From: Alex Deucher <[email protected]>
Older firmware didn't support the new nop packet.
v2 (Andreas Boll):
- Drop usage of packet3 for new firmware
--- drivers/gpu/drm/radeon/cik.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/cik.c +10 -3
@@ -7900,6 +7900,7 @@ restart_ih:static int cik_startup (struct radeon_device *rdev) {struct radeon_ring *ring; +u32 nop;int r;/* enable pcie gen2/3 link */
@@ -8033,9 +8034,15 @@ static int cik_startup(struct radeon_device *rdev) }cik_irq_set (rdev); +if (rdev->family ==CHIP_HAWAII ) { + nop =RADEON_CP_PACKET2 ; + }else { + nop =PACKET3 (PACKET3_NOP ,0x3FFF ); + } + ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX ]; r =radeon_ring_init (rdev, ring, ring->ring_size,RADEON_WB_CP_RPTR_OFFSET , -PACKET3 (PACKET3_NOP ,0x3FFF )); + nop);if (r)return r;
@@ -8043,7 +8050,7 @@ static int cik_startup(struct radeon_device *rdev)/* type-2 packets are deprecated on MEC, use type-3 instead */ ring = &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX ]; r =radeon_ring_init (rdev, ring, ring->ring_size,RADEON_WB_CP1_RPTR_OFFSET , -PACKET3 (PACKET3_NOP ,0x3FFF )); + nop);if (r)return r; ring->me =1 ;/* first MEC */
@@ -8054,7 +8061,7 @@ static int cik_startup(struct radeon_device *rdev)/* type-2 packets are deprecated on MEC, use type-3 instead */ ring = &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX ]; r =radeon_ring_init (rdev, ring, ring->ring_size,RADEON_WB_CP2_RPTR_OFFSET , -PACKET3 (PACKET3_NOP ,0x3FFF )); + nop);if (r)return r;/* dGPU only have 1 MEC */
Signature · 6 lines
2.0.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 drm/radeon: tweak ACCEL_WORKING2 query for hawaii
From: Alex Deucher <[email protected]>
Return 2 so we can be sure the kernel has the necessary changes for acceleration to work.
Note: This patch depends on these two commits:
- drm/radeon: fix cut and paste issue for hawaii.
- drm/radeon: use packet2 for nop on hawaii with old firmware
--- drivers/gpu/drm/radeon/radeon_kms.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_kms.c +8 -1
@@ -254,7 +254,14 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file }break ;case RADEON_INFO_ACCEL_WORKING2 : - *value = rdev->accel_working; +if (rdev->family ==CHIP_HAWAII ) { +if (rdev->accel_working) + *value =2 ; +else + *value =0 ; + }else { + *value = rdev->accel_working; + }break ;case RADEON_INFO_TILING_CONFIG :if (rdev->family >=CHIP_BONAIRE )
Signature · 1 line
2.0.1
PATCH 3/4 drm/radeon: use packet3 for nop on hawaii with new firmware
In reply to Andreas BollFrom: Alex Deucher <[email protected]>
Older firmware didn't support the new nop packet.
--- drivers/gpu/drm/radeon/cik.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/cik.c +4 -1
@@ -8035,7 +8035,10 @@ static int cik_startup(struct radeon_device *rdev)cik_irq_set (rdev);if (rdev->family ==CHIP_HAWAII ) { - nop =RADEON_CP_PACKET2 ; +if (rdev->new_fw) + nop =PACKET3 (PACKET3_NOP ,0x3FFF ); +else + nop =RADEON_CP_PACKET2 ; }else { nop =PACKET3 (PACKET3_NOP ,0x3FFF ); }
Signature · 1 line
2.0.1
PATCH 4/4 drm/radeon: tweak ACCEL_WORKING2 query for the new firmware for hawaii
In reply to Andreas BollAdjust the previous tweak for hawaii to return 3 if the new firmware is used.
--- drivers/gpu/drm/radeon/radeon_kms.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_kms.c +7 -3
@@ -255,10 +255,14 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_filebreak ;case RADEON_INFO_ACCEL_WORKING2 :if (rdev->family ==CHIP_HAWAII ) { -if (rdev->accel_working) - *value =2 ; -else +if (rdev->accel_working) { +if (rdev->new_fw) + *value =3 ; +else + *value =2 ; + }else { *value =0 ; + } }else { *value = rdev->accel_working; }
Signature · 1 line
2.0.1
Quoted 11 lines · Andreas Boll
From: Alex Deucher <[email protected]>
Older firmware didn't support the new nop packet.
v2 (Andreas Boll):
- Drop usage of packet3 for new firmwareSigned-off-by Alex Deucher <[email protected]>Reviewed-by Christian König <[email protected]> (v1)Signed-off-by Andreas Boll <[email protected]>
Added the series to my 3.17 tree. thanks!
Alex
Quoted 58 lines
--- drivers/gpu/drm/radeon/cik.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)drivers/gpu/drm/radeon/cik.c +10
-4@@ -7900,6 +7900,7 @@ restart_ih:static int cik_startup (struct radeon_device *rdev) {struct radeon_ring *ring; +u32 nop;int r;/* enable pcie gen2/3 link */ @@ -8033,9 +8034,15 @@ static int cik_startup(struct radeon_device *rdev) }cik_irq_set (rdev); +if (rdev->family ==CHIP_HAWAII ) { + nop =RADEON_CP_PACKET2 ; + }else { + nop =PACKET3 (PACKET3_NOP ,0x3FFF ); + } + ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX ]; r =radeon_ring_init (rdev, ring, ring->ring_size,RADEON_WB_CP_RPTR_OFFSET , -PACKET3 (PACKET3_NOP ,0x3FFF )); + nop);if (r)return r;@@ -8043,7 +8050,7 @@ static int cik_startup(struct radeon_device *rdev)/* type-2 packets are deprecated on MEC, use type-3 instead */ ring = &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX ]; r =radeon_ring_init (rdev, ring, ring->ring_size,RADEON_WB_CP1_RPTR_OFFSET , -PACKET3 (PACKET3_NOP ,0x3FFF )); + nop);if (r)return r; ring->me =1 ;/* first MEC */ @@ -8054,7 +8061,7 @@ static int cik_startup(struct radeon_device *rdev)/* type-2 packets are deprecated on MEC, use type-3 instead */ ring = &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX ]; r =radeon_ring_init (rdev, ring, ring->ring_size,RADEON_WB_CP2_RPTR_OFFSET , -PACKET3 (PACKET3_NOP ,0x3FFF )); + nop);if (r)return r;/* dGPU only have 1 MEC */ --2.0.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel