drm/radeon: fix cut and paste issue for hawaii.
Subsystems (3)
PATCH 1/2 drm/radeon: fix cut and paste issue for hawaii.
From: Jerome Glisse <[email protected]>
This is a halfway fix for hawaii acceleration. More fixes to come but hopefully isolated to userspace.
--- drivers/gpu/drm/radeon/cik.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/cik.c +1 -0
@@ -2515,6 +2515,7 @@ static void cik_tiling_mode_table_init(struct radeon_device *rdev) gb_tile_moden =0 ;break ; } + rdev->config.cik.macrotile_mode_array[reg_offset] = gb_tile_moden;WREG32 (GB_MACROTILE_MODE0 + (reg_offset *4 ), gb_tile_moden); } }else if (num_pipe_configs ==8 ) {
Signature · 6 lines
1.8.3.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/radeon: add new info ioctl query for hawaii accel
We need to make sure we have a new enough firmware with the fixed nop packet.
--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)
drivers/gpu/drm/radeon/radeon_kms.c +6 -0
@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;
include/uapi/drm/radeon_drm.h +1 -0
@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21struct drm_radeon_info {uint32_t request;
Signature · 1 line
1.8.3.1
Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Quoted 32 lines · Alex Deucher
We need to make sure we have a new enough firmware with the fixed nop packet.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)drivers/gpu/drm/radeon/radeon_kms.c +6
-0@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;include/uapi/drm/radeon_drm.h +0
-0
include/uapi/drm/radeon_drm.h struct drm_radeon_cs { · line 1016
Quoted 7 lines
include/uapi/drm/radeon_drm.h +1
-0@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21struct drm_radeon_info {uint32_t request;
Please make the RADEON_INFO_ACCEL_WORKING(2) ioctl do the right thing for Hawaii instead of adding yet another one.
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Quoted 37 lines · Michel Dänzer
Quoted 36 lines · Alex Deucher
We need to make sure we have a new enough firmware with the fixed nop packet.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)drivers/gpu/drm/radeon/radeon_kms.c +6
-0@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;include/uapi/drm/radeon_drm.h +1
-0@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21
Quoted 6 lines
include/uapi/drm/radeon_drm.h struct drm_radeon_cs { · line 1016
Quoted 3 lines
include/uapi/drm/radeon_drm.h +0
-0struct drm_radeon_info {uint32_t request;Please make the
RADEON_INFO_ACCEL_WORKING(2)ioctl do the right thing for Hawaii instead of adding yet another one.
Ugh, s/ioctl/info query/ of course.
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Quoted 38 lines · Michel Dänzer
Quoted 37 lines · Michel Dänzer
Quoted 36 lines · Alex Deucher
We need to make sure we have a new enough firmware with the fixed nop packet.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)drivers/gpu/drm/radeon/radeon_kms.c +6
-0@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;include/uapi/drm/radeon_drm.h +1
-0@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21
Quoted 8 lines
Quoted 6 lines
include/uapi/drm/radeon_drm.h struct drm_radeon_cs { · line 1016
Quoted 3 lines
include/uapi/drm/radeon_drm.h +0
-0struct drm_radeon_info {uint32_t request;Please make the
RADEON_INFO_ACCEL_WORKING(2)ioctl do the right thing for Hawaii instead of adding yet another one.Ugh, s/ioctl/info query/ of course.
Hmm, I guess that doesn't work because older kernels returned 1 for those on Hawaii...
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Quoted 46 lines · Michel Dänzer
Quoted 45 lines · Michel Dänzer
Quoted 43 lines · Michel Dänzer
Quoted 32 lines · Alex Deucher
We need to make sure we have a new enough firmware with the fixed nop packet.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)drivers/gpu/drm/radeon/radeon_kms.c +6
-0@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;include/uapi/drm/radeon_drm.h +0
-0include/uapi/drm/radeon_drm.h struct drm_radeon_cs { · line 1016
Quoted 7 lines
include/uapi/drm/radeon_drm.h +1
-0@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21struct drm_radeon_info {uint32_t request;Please make the
RADEON_INFO_ACCEL_WORKING(2)ioctl do the right thing for Hawaii instead of adding yet another one.
Quoted 4 lines
Quoted 1 line
Ugh, s/ioctl/info query/ of course.
Hmm, I guess that doesn't work because older kernels returned 1 for those on Hawaii...
Right. The hawaii problems came down to two things:
1. missing tiling info setup (fixed with Jerome's patch:
http://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-3.17-wip&id=78e758aa27d9d430c61999160ddf72e829c5cf26)
for hawaii. This was due to merging hawaii support after we fixed up CI tiling. Dave already merged this and it should show up in stable.
2. The current Hawaii CP firmware doesn't support the special case 0xffff1000 type 3 NOP packet. The newer firmware version I added support for in 3.17 supports this packet.
So we can either patch mesa to use the type 2 packets for now and allow it to work with kernels with older firmware. The problem is the compute rings don't support type 2 packets anymore and they are deprecated on gfx, plus we'd still have to deal with existing versions of mesa that still use the problematic packet.
It just seemed easier to add a new kernel check.
Alex
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Am 25.07.2014 um 05:05 schrieb Alex Deucher:
Quoted 59 lines · Michel Dänzer
Quoted 39 lines · Michel Dänzer
Quoted 38 lines · Michel Dänzer
Quoted 37 lines · Alex Deucher
Quoted 36 lines
We need to make sure we have a new enough firmware with the fixed nop packet.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)drivers/gpu/drm/radeon/radeon_kms.c +6
-0@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;include/uapi/drm/radeon_drm.h +1
-0@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
include/uapi/drm/radeon_drm.h struct drm_radeon_cs { · line 1016
Quoted 3 lines
include/uapi/drm/radeon_drm.h +0
-0struct drm_radeon_info {uint32_t request;Please make the
RADEON_INFO_ACCEL_WORKING(2)ioctl do the right thing for Hawaii instead of adding yet another one.Ugh, s/ioctl/info query/ of course.
Hmm, I guess that doesn't work because older kernels returned 1 for those on Hawaii...
Right. The hawaii problems came down to two things:
1. missing tiling info setup (fixed with Jerome's patch:
http://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-3.17-wip&id=78e758aa27d9d430c61999160ddf72e829c5cf26)
for hawaii. This was due to merging hawaii support after we fixed up CI tiling. Dave already merged this and it should show up in stable.2. The current Hawaii CP firmware doesn't support the special case
0xffff1000type 3 NOP packet. The newer firmware version I added support for in 3.17 supports this packet.
Quoted 7 lines
So we can either patch mesa to use the type 2 packets for now and allow it to work with kernels with older firmware. The problem is the compute rings don't support type 2 packets anymore and they are deprecated on gfx, plus we'd still have to deal with existing versions of mesa that still use the problematic packet.
It just seemed easier to add a new kernel check.
Can we still make the check a bit more generic? E.g. not so HAWAII specific name and maybe returning more information from the new firmware header?
Something like this,
Christian.
Quoted 6 lines
Alex
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Quoted 66 lines · Christian König
Am 25.07.2014 um 05:05 schrieb Alex Deucher:
Quoted 65 lines · Michel Dänzer
Quoted 39 lines · Michel Dänzer
Quoted 38 lines · Michel Dänzer
Quoted 37 lines · Alex Deucher
Quoted 36 lines
We need to make sure we have a new enough firmware with the fixed nop packet.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++ include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 7 insertions(+)drivers/gpu/drm/radeon/radeon_kms.c +6
-0@@ -529,6 +529,12 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_fileelse *value =1 ;break ; +case RADEON_INFO_HAWAII_ACCEL : +if (rdev->new_fw) + *value =1 ; +else + *value =0 ; +break ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->request);return -EINVAL ;include/uapi/drm/radeon_drm.h +1
-0@@ -1010,6 +1010,7 @@ struct drm_radeon_cs {#define RADEON_INFO_VRAM_USAGE 0x1e#define RADEON_INFO_GTT_USAGE 0x1f#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 +#define RADEON_INFO_HAWAII_ACCEL 0x21Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
include/uapi/drm/radeon_drm.h struct drm_radeon_cs { · line 1016
Quoted 3 lines
include/uapi/drm/radeon_drm.h +0
-0struct drm_radeon_info {uint32_t request;Please make the
RADEON_INFO_ACCEL_WORKING(2)ioctl do the right thing for Hawaii instead of adding yet another one.Ugh, s/ioctl/info query/ of course.
Hmm, I guess that doesn't work because older kernels returned 1 for those on Hawaii...
Right. The hawaii problems came down to two things:
1. missing tiling info setup (fixed with Jerome's patch:
http://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-3.17-wip&id=78e758aa27d9d430c61999160ddf72e829c5cf26)
for hawaii. This was due to merging hawaii support after we fixed up CI tiling. Dave already merged this and it should show up in stable.2. The current Hawaii CP firmware doesn't support the special case
0xffff1000type 3 NOP packet. The newer firmware version I added support for in 3.17 supports this packet.So we can either patch mesa to use the type 2 packets for now and allow it to work with kernels with older firmware. The problem is the compute rings don't support type 2 packets anymore and they are deprecated on gfx, plus we'd still have to deal with existing versions of mesa that still use the problematic packet.
Quoted 7 lines
Quoted 1 line
It just seemed easier to add a new kernel check.
Can we still make the check a bit more generic? E.g. not so HAWAII specific name and maybe returning more information from the new firmware header?
Something like this,
Christian.
I would rather not add anything, let just dump drm version in 3.17 and use that to enable compute and in mean time disable compute for hawaii but enable gfx if we detect 3.16. This would be a lot cleaner and no need for yet another get_info ie we make 3.17 only report accel if new firmware is detected.
Cheers,
Jérôme
Dave Airlie
maintainerRe: [PATCH 2/2] drm/radeon: add new info ioctl query for hawaii accel
Can't we just make the accel2 info return 2 instead of 1? and have userspace know the difference.
be careful to make userspace work so we can return 3 in future. Dave.