From ad2c70b4121121f1fb53190ea49edf2323c804a9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Aug 2006 12:47:19 -0700 Subject: [PATCH 1/3] Remove some stale XXX-prefixed comments. --- src/i830_video.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/i830_video.c b/src/i830_video.c index e4950424..7a426db6 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -3058,19 +3058,6 @@ BroadwaterDisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, sf_state->sf6.dest_org_vbias = 0x8; sf_state->sf6.dest_org_hbias = 0x8; - /* XXX: Set up the PS kernel (dispatched by WM) for converting YUV to RGB. - * The 3D driver does this as: - * - CONST C0 = { -.5, -.0625, -.5, 1.164 } - CONST C1 = { 1.596, -0.813, 2.018, -.391 } - UYV = TEX ... - UYV.xyz = ADD UYV, C0 - UYV.y = MUL UYV.y, C0.w - RGB.xyz = MAD UYV.xxz, C1, UYV.y - RGB.y = MAD UYV.z, C1.w, RGB.y - * - */ - memcpy (ps_kernel, ps_kernel_static, sizeof (ps_kernel_static)); #if 0 ErrorF ("ps kernel: 0x%08x\n", state_base_offset + ps_kernel_offset); @@ -3088,13 +3075,13 @@ BroadwaterDisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, wm_scratch_offset) >> 10; wm_state->thread2.per_thread_scratch_space = 0; /* 1024 bytes */ wm_state->thread3.dispatch_grf_start_reg = 3; /* XXX */ + wm_state->thread3.const_urb_entry_read_length = 0; + wm_state->thread3.const_urb_entry_read_offset = 0; wm_state->thread3.urb_entry_read_length = 1; /* XXX */ - wm_state->thread3.const_urb_entry_read_length = 0; /* XXX */ - wm_state->thread3.const_urb_entry_read_offset = 0; /* XXX */ wm_state->thread3.urb_entry_read_offset = 0; /* XXX */ wm_state->wm4.stats_enable = 1; wm_state->wm4.sampler_state_pointer = (state_base_offset + src_sampler_offset) >> 5; - wm_state->wm4.sampler_count = 1; /* XXX 1-4 samplers used */ + wm_state->wm4.sampler_count = 1; /* 1-4 samplers used */ wm_state->wm5.max_threads = PS_MAX_THREADS - 1; wm_state->wm5.thread_dispatch_enable = 1; wm_state->wm5.enable_16_pix = 1; From 4525379d95ff292d7322e1a7a516c0bedd1f7543 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Aug 2006 16:03:15 -0700 Subject: [PATCH 2/3] Make the sampler's payload be the WM payload rather than uninitialized data. The sampler's payload happens to be in the same format as the WM payload, though most of the fields are ignored. This appears to fix the program in the presence of multiple PS threads. --- src/wm_prog.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wm_prog.h b/src/wm_prog.h index a8391c4d..297ddcbf 100644 --- a/src/wm_prog.h +++ b/src/wm_prog.h @@ -95,8 +95,8 @@ { 0x00600001, 0x206003be, 0x008d00c0, 0x00000000 }, /* mov (8) m4<1>F g7<8,8,1>F { align1 + } */ { 0x00600001, 0x208003be, 0x008d00e0, 0x00000000 }, -/* send 0 (16) g12<1>UW g8<8,8,1>UW sampler mlen 5 rlen 8 { align1 + } */ - { 0x00800031, 0x21801d29, 0x008d0100, 0x02580001 }, +/* send 0 (16) g12<1>UW g0<8,8,1>UW sampler mlen 5 rlen 8 { align1 + } */ + { 0x00800031, 0x21801d29, 0x008d0000, 0x02580001 }, /* mov (8) g19<1>UW g19<8,8,1>UW { align1 + } */ { 0x00600001, 0x22600129, 0x008d0260, 0x00000000 }, /* add (8) g14<1>F g14<8,8,1>F -0.0627451{ align1 + } */ From d56ffa5f35e3cf4262d66469052b2122fdb24027 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Aug 2006 16:03:50 -0700 Subject: [PATCH 3/3] Bump PS_MAX_THREADS to 32 now that the program doesn't fail. --- src/i830_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i830_video.c b/src/i830_video.c index 7a426db6..107818bc 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -2695,7 +2695,7 @@ static const CARD32 sf_kernel_static[][4] = { /* Our PS kernel uses less than 32 GRF registers (about 20) */ #define PS_KERNEL_NUM_GRF 32 -#define PS_MAX_THREADS 1 +#define PS_MAX_THREADS 32 #define BRW_GRF_BLOCKS(nreg) ((nreg + 15) / 16 - 1)