r6xx/r7xx: CS parser fixes
Subsystems (2)
PATCH 1/1 r6xx/r7xx: CS parser fixes
These patches include the following fixes:
- Drop some more safe regs that userspace shouldn't hit
- Shader constant base regs need relocs. This allows us to use constant buffers rather than the constant register file. Also we don't want userspace to be able to set arbitrary mc addresses for the const caches.
- Track SQ_CONFIG so we know whether userspace is using the constant register file or constant buffers.
- bump the UMS/KMS version numbers
It'd be nice to get these into 2.6.34.
Alex
From 4ba3ca0bd30f6c3ab3bf5f753e567615d4c30f1f Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 26 Mar 2010 14:52:32 -0400
Subject: [PATCH] drm/radeon/r6xx/r7xx: CS parser fixes
- Drop some more safe regs taht userspace shouldn't hit
- Constant base regs need relocs. This allows us to use constant buffers rather than the constant register file. Also we don't want userspace to be able to set arbitrary mc base values for the const caches.
- Track SQ_CONFIG so we know whether userspace is using the cfile or constant buffers.
--- drivers/gpu/drm/radeon/r600_cs.c | 70 ++++++++++++++++++++++++++++++--- drivers/gpu/drm/radeon/r600d.h | 49 +++++++++++++++++++++++ drivers/gpu/drm/radeon/reg_srcs/r600 | 53 ------------------------- 3 files changed, 112 insertions(+), 60 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +63 -7
@@ -45,6 +45,7 @@ struct r600_cs_track {u32 nbanks;u32 npipes;/* value we track */ +u32 sq_config;u32 nsamples;u32 cb_color_base_last[8 ];struct radeon_bo *cb_color_bo[8 ];
@@ -141,6 +142,8 @@ static void r600_cs_track_init(struct r600_cs_track *track) {int i; +/* assume DX9 mode */ + track->sq_config =DX9_CONSTS ;for (i =0 ; i <8 ; i++) { track->cb_color_base_last[i] =0 ; track->cb_color_size[i] =0 ;
@@ -715,6 +718,9 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx tmp =radeon_get_ib_value (p, idx); ib[idx] =0 ;break ; +case SQ_CONFIG : + track->sq_config =radeon_get_ib_value (p, idx); +break ;case R_028800_DB_DEPTH_CONTROL : track->db_depth_control =radeon_get_ib_value (p, idx);break ;
@@ -869,6 +875,54 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idxcase SQ_PGM_START_VS :case SQ_PGM_START_GS :case SQ_PGM_START_PS : +case SQ_ALU_CONST_CACHE_GS_0 : +case SQ_ALU_CONST_CACHE_GS_1 : +case SQ_ALU_CONST_CACHE_GS_2 : +case SQ_ALU_CONST_CACHE_GS_3 : +case SQ_ALU_CONST_CACHE_GS_4 : +case SQ_ALU_CONST_CACHE_GS_5 : +case SQ_ALU_CONST_CACHE_GS_6 : +case SQ_ALU_CONST_CACHE_GS_7 : +case SQ_ALU_CONST_CACHE_GS_8 : +case SQ_ALU_CONST_CACHE_GS_9 : +case SQ_ALU_CONST_CACHE_GS_10 : +case SQ_ALU_CONST_CACHE_GS_11 : +case SQ_ALU_CONST_CACHE_GS_12 : +case SQ_ALU_CONST_CACHE_GS_13 : +case SQ_ALU_CONST_CACHE_GS_14 : +case SQ_ALU_CONST_CACHE_GS_15 : +case SQ_ALU_CONST_CACHE_PS_0 : +case SQ_ALU_CONST_CACHE_PS_1 : +case SQ_ALU_CONST_CACHE_PS_2 : +case SQ_ALU_CONST_CACHE_PS_3 : +case SQ_ALU_CONST_CACHE_PS_4 : +case SQ_ALU_CONST_CACHE_PS_5 : +case SQ_ALU_CONST_CACHE_PS_6 : +case SQ_ALU_CONST_CACHE_PS_7 : +case SQ_ALU_CONST_CACHE_PS_8 : +case SQ_ALU_CONST_CACHE_PS_9 : +case SQ_ALU_CONST_CACHE_PS_10 : +case SQ_ALU_CONST_CACHE_PS_11 : +case SQ_ALU_CONST_CACHE_PS_12 : +case SQ_ALU_CONST_CACHE_PS_13 : +case SQ_ALU_CONST_CACHE_PS_14 : +case SQ_ALU_CONST_CACHE_PS_15 : +case SQ_ALU_CONST_CACHE_VS_0 : +case SQ_ALU_CONST_CACHE_VS_1 : +case SQ_ALU_CONST_CACHE_VS_2 : +case SQ_ALU_CONST_CACHE_VS_3 : +case SQ_ALU_CONST_CACHE_VS_4 : +case SQ_ALU_CONST_CACHE_VS_5 : +case SQ_ALU_CONST_CACHE_VS_6 : +case SQ_ALU_CONST_CACHE_VS_7 : +case SQ_ALU_CONST_CACHE_VS_8 : +case SQ_ALU_CONST_CACHE_VS_9 : +case SQ_ALU_CONST_CACHE_VS_10 : +case SQ_ALU_CONST_CACHE_VS_11 : +case SQ_ALU_CONST_CACHE_VS_12 : +case SQ_ALU_CONST_CACHE_VS_13 : +case SQ_ALU_CONST_CACHE_VS_14 : +case SQ_ALU_CONST_CACHE_VS_15 : r =r600_cs_packet_next_reloc (p, &reloc);if (r) { dev_warn(p->dev, "bad SET_CONTEXT_REG "
@@ -1226,13 +1280,15 @@ static int r600_packet3_check(struct radeon_cs_parser *p, }break ;case PACKET3_SET_ALU_CONST : - start_reg = (idx_value <<2 ) +PACKET3_SET_ALU_CONST_OFFSET ; - end_reg =4 * pkt->count + start_reg -4 ; -if ((start_reg <PACKET3_SET_ALU_CONST_OFFSET ) || - (start_reg >=PACKET3_SET_ALU_CONST_END ) || - (end_reg >=PACKET3_SET_ALU_CONST_END )) { -DRM_ERROR ("bad SET_ALU_CONST\n" ); -return -EINVAL ; +if (track->sq_config &DX9_CONSTS ) { + start_reg = (idx_value <<2 ) +PACKET3_SET_ALU_CONST_OFFSET ; + end_reg =4 * pkt->count + start_reg -4 ; +if ((start_reg <PACKET3_SET_ALU_CONST_OFFSET ) || + (start_reg >=PACKET3_SET_ALU_CONST_END ) || + (end_reg >=PACKET3_SET_ALU_CONST_END )) { +DRM_ERROR ("bad SET_ALU_CONST\n" ); +return -EINVAL ; + } }break ;case PACKET3_SET_BOOL_CONST :
drivers/gpu/drm/radeon/r600d.h +49 -0
55 lines not on this page · raw message
drivers/gpu/drm/radeon/reg_srcs/r600 +0 -53
76 lines not on this page · raw message
Signature · 1 line
1.5.6.3
From 51669263477a2d3c1aa11599e042a70556aaed55 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 26 Mar 2010 15:24:14 -0400
Subject: [PATCH] drm/radeon/kms: bump the version for r6xx/r7xx const buffer support
--- drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +2 -1
@@ -42,9 +42,10 @@* KMS wrapper. * - 2.0.0 - initial interface * - 2.1.0 - add square tiling interface +* - 2.2.0 - add r6xx/r7xx const buffer support */ #define KMS_DRIVER_MAJOR 2 -#define KMS_DRIVER_MINOR 1 +#define KMS_DRIVER_MINOR 2#define KMS_DRIVER_PATCHLEVEL 0int radeon_driver_load_kms (struct drm_device *dev,unsigned long flags);int radeon_driver_unload_kms (struct drm_device *dev);
Signature · 1 line
1.5.6.3
From dc4b6015c699db871a19bac393a0f6b586c1cda5 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 26 Mar 2010 15:26:51 -0400
Subject: [PATCH] drm/radeon: bump the UMS driver version for r6xx/r7xx const buffer support
--- drivers/gpu/drm/radeon/radeon_drv.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.h +2 -1
@@ -107,9 +107,10 @@* 1.30- Add support for occlusion queries * 1.31- Add support for num Z pipes from GET_PARAM * 1.32- fixes for rv740 setup +* 1.33- Add r6xx/r7xx const buffer support */ #define DRIVER_MAJOR 1 -#define DRIVER_MINOR 32 +#define DRIVER_MINOR 33#define DRIVER_PATCHLEVEL 0enum radeon_cp_microcode_version {
Signature · 1 line
1.5.6.3
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel