From 1fc564fe3494cf0abcc848d0e90bf2232f8fd272 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 16 Dec 2010 09:49:09 +1000 Subject: nv50/xv: use mad in nv12 shader, rather than mul+add Signed-off-by: Ben Skeggs --- src/nv50_accel.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/nv50_accel.c b/src/nv50_accel.c index 0369839..d6c7528 100644 --- a/src/nv50_accel.c +++ b/src/nv50_accel.c @@ -352,7 +352,7 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) OUT_RING (chan, (0 << NV50TCL_CB_DEF_SET_BUFFER_SHIFT) | 0x4000); BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 1); OUT_RING (chan, 0); - BEGIN_RING_NI(chan, tesla, NV50TCL_CB_DATA(0), 28); + BEGIN_RING_NI(chan, tesla, NV50TCL_CB_DATA(0), 24); OUT_RING (chan, 0x80000008); OUT_RING (chan, 0x90000408); OUT_RING (chan, 0x82010400); @@ -367,20 +367,17 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) OUT_RING (chan, 0x82040404); OUT_RING (chan, 0xf0400201); OUT_RING (chan, 0x0000c784); - OUT_RING (chan, 0xc0840008); - OUT_RING (chan, 0xb002060c); - OUT_RING (chan, 0xc0850008); - OUT_RING (chan, 0xb0020810); - OUT_RING (chan, 0xc0860008); - OUT_RING (chan, 0xb0020a14); - OUT_RING (chan, 0xc0870208); - OUT_RING (chan, 0xb0020600); - OUT_RING (chan, 0xc0890208); - OUT_RING (chan, 0xb0020a08); - OUT_RING (chan, 0xc0880205); - OUT_RING (chan, 0x00000780); - OUT_RING (chan, 0xb0000805); - OUT_RING (chan, 0x00004781); + OUT_RING (chan, 0xe084000c); + OUT_RING (chan, 0xe0850010); + OUT_RING (chan, 0xe0860015); + OUT_RING (chan, 0x00014780); + OUT_RING (chan, 0xe0870201); + OUT_RING (chan, 0x0000c780); + OUT_RING (chan, 0xe0890209); + OUT_RING (chan, 0x00014780); + OUT_RING (chan, 0xe0880205); + OUT_RING (chan, 0x00010781); + /* HPOS.xy = ($o0, $o1), HPOS.zw = (0.0, 1.0), then map $o2 - $o5 */ BEGIN_RING(chan, tesla, NV50TCL_VP_RESULT_MAP(0), 2); OUT_RING (chan, 0x41400100); -- cgit v1.2.1 From aa2821a42706ac7b69703d1869e2d00a4ced9f4b Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 20 Dec 2010 11:53:53 +1000 Subject: kill NVSync(), it's rather useless Signed-off-by: Ben Skeggs --- src/nv_dma.c | 21 --------------------- src/nv_driver.c | 2 -- src/nv_proto.h | 1 - 3 files changed, 24 deletions(-) diff --git a/src/nv_dma.c b/src/nv_dma.c index 409f42c..49ed40a 100644 --- a/src/nv_dma.c +++ b/src/nv_dma.c @@ -45,27 +45,6 @@ NVChannelHangNotify(struct nouveau_channel *chan) NVLockedUp(pScrn); } -void NVSync(ScrnInfoPtr pScrn) -{ - NVPtr pNv = NVPTR(pScrn); - struct nouveau_channel *chan = pNv->chan; - struct nouveau_grobj *gr = pNv->Nv2D ? pNv->Nv2D : pNv->NvImageBlit; - - if (pNv->NoAccel) - return; - - /* Wait for nvchannel to go completely idle */ - nouveau_notifier_reset(pNv->notify0, 0); - BEGIN_RING(chan, gr, 0x104, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, gr, 0x100, 1); - OUT_RING (chan, 0); - FIRE_RING (chan); - if (nouveau_notifier_wait_status(pNv->notify0, 0, - NV_NOTIFY_STATE_STATUS_COMPLETED, 2.0)) - NVLockedUp(pScrn); -} - Bool NVInitDma(ScrnInfoPtr pScrn) { diff --git a/src/nv_driver.c b/src/nv_driver.c index ed72194..e2df82e 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -356,8 +356,6 @@ NVLeaveVT(int scrnIndex, int flags) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NVLeaveVT is called.\n"); - NVSync(pScrn); - ret = drmDropMaster(nouveau_device(pNv->dev)->fd); if (ret) ErrorF("Error dropping master: %d\n", ret); diff --git a/src/nv_proto.h b/src/nv_proto.h index ba8ca5e..775b094 100644 --- a/src/nv_proto.h +++ b/src/nv_proto.h @@ -36,7 +36,6 @@ void NVSetPortDefaults (ScrnInfoPtr pScrn, NVPortPrivPtr pPriv); unsigned int nv_window_belongs_to_crtc(ScrnInfoPtr, int, int, int, int); /* in nv_dma.c */ -void NVSync(ScrnInfoPtr pScrn); Bool NVInitDma(ScrnInfoPtr pScrn); void NVTakedownDma(ScrnInfoPtr pScrn); -- cgit v1.2.1 From c2092a458401377f421d9bdfe1d97ce580b99508 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 20 Dec 2010 11:50:57 +1000 Subject: include nv04_pushbuf.h for ring macros, rather than nouveau_pushbuf.h Signed-off-by: Ben Skeggs --- src/nouveau_dri2.c | 1 + src/nouveau_exa.c | 1 + src/nouveau_xv.c | 2 ++ src/nv04_exa.c | 2 ++ src/nv04_xv_blit.c | 2 ++ src/nv10_exa.c | 1 + src/nv30_exa.c | 1 + src/nv30_shaders.c | 1 + src/nv30_xv_tex.c | 1 + src/nv40_exa.c | 1 + src/nv40_xv_tex.c | 1 + src/nv50_accel.h | 2 ++ src/nv50_exa.c | 1 + src/nv_accel_common.c | 1 + src/nv_driver.c | 2 ++ src/nv_include.h | 1 - 16 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c index 2dd6da4..45add0f 100644 --- a/src/nouveau_dri2.c +++ b/src/nouveau_dri2.c @@ -5,6 +5,7 @@ #include "xorg-server.h" #include "nv_include.h" +#include "nouveau_pushbuf.h" #ifdef DRI2 #include "dri2.h" #endif diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c index 4618994..4e9f946 100644 --- a/src/nouveau_exa.c +++ b/src/nouveau_exa.c @@ -21,6 +21,7 @@ */ #include "nv_include.h" +#include "nv04_pushbuf.h" #include "exa.h" static inline Bool diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c index dba153c..c1d4ccb 100644 --- a/src/nouveau_xv.c +++ b/src/nouveau_xv.c @@ -35,6 +35,8 @@ #include "nv_include.h" #include "nv_dma.h" +#include "nv04_pushbuf.h" + #include "vl_hwmc.h" #define IMAGE_MAX_W 2046 diff --git a/src/nv04_exa.c b/src/nv04_exa.c index 2760d4b..f2819d2 100644 --- a/src/nv04_exa.c +++ b/src/nv04_exa.c @@ -23,6 +23,8 @@ #include "nv_include.h" #include "nv_rop.h" +#include "nv04_pushbuf.h" + static void NV04EXASetPattern(ScrnInfoPtr pScrn, CARD32 clr0, CARD32 clr1, CARD32 pat0, CARD32 pat1) diff --git a/src/nv04_xv_blit.c b/src/nv04_xv_blit.c index be39c0d..1b8de4f 100644 --- a/src/nv04_xv_blit.c +++ b/src/nv04_xv_blit.c @@ -34,6 +34,8 @@ #include "nv_include.h" #include "nv_dma.h" +#include "nv04_pushbuf.h" + #define FOURCC_RGB 0x0000003 #define VSYNC_POSSIBLE (pNv->dev->chipset >= 0x11) diff --git a/src/nv10_exa.c b/src/nv10_exa.c index 1acb583..1cf7a5b 100644 --- a/src/nv10_exa.c +++ b/src/nv10_exa.c @@ -28,6 +28,7 @@ #endif #include "nv_include.h" +#include "nv04_pushbuf.h" /* Texture/Render target formats. */ static struct pict_format { diff --git a/src/nv30_exa.c b/src/nv30_exa.c index b34b29c..a4dd37d 100644 --- a/src/nv30_exa.c +++ b/src/nv30_exa.c @@ -25,6 +25,7 @@ #include "nv_include.h" #include "nv30_shaders.h" +#include "nv04_pushbuf.h" typedef struct nv_pict_surface_format { int pict_fmt; diff --git a/src/nv30_shaders.c b/src/nv30_shaders.c index 7316082..fb93ef8 100644 --- a/src/nv30_shaders.c +++ b/src/nv30_shaders.c @@ -22,6 +22,7 @@ #include "nv30_shaders.h" +#include "nv04_pushbuf.h" void NV30_UploadFragProg(NVPtr pNv, nv_shader_t *shader, int *hw_offset) { diff --git a/src/nv30_xv_tex.c b/src/nv30_xv_tex.c index ffa68e4..6d4e089 100644 --- a/src/nv30_xv_tex.c +++ b/src/nv30_xv_tex.c @@ -37,6 +37,7 @@ #include "nv_dma.h" #include "nv30_shaders.h" +#include "nv04_pushbuf.h" extern Atom xvSyncToVBlank, xvSetDefaults; diff --git a/src/nv40_exa.c b/src/nv40_exa.c index ffee0e6..b14a829 100644 --- a/src/nv40_exa.c +++ b/src/nv40_exa.c @@ -22,6 +22,7 @@ #include "nv_include.h" #include "nv30_shaders.h" +#include "nv04_pushbuf.h" typedef struct nv_pict_surface_format { int pict_fmt; diff --git a/src/nv40_xv_tex.c b/src/nv40_xv_tex.c index e0444e8..0910e12 100644 --- a/src/nv40_xv_tex.c +++ b/src/nv40_xv_tex.c @@ -37,6 +37,7 @@ #include "nv_dma.h" #include "nv30_shaders.h" +#include "nv04_pushbuf.h" extern Atom xvSyncToVBlank, xvSetDefaults; diff --git a/src/nv50_accel.h b/src/nv50_accel.h index 9cdbbab..fac5cbb 100644 --- a/src/nv50_accel.h +++ b/src/nv50_accel.h @@ -1,6 +1,8 @@ #ifndef __NV50_ACCEL_H__ #define __NV50_ACCEL_H__ +#include "nv04_pushbuf.h" + /* "Tesla scratch buffer" offsets */ #define PVP_OFFSET 0x00000000 /* Vertex program */ #define PFP_OFFSET 0x00001000 /* Fragment program */ diff --git a/src/nv50_exa.c b/src/nv50_exa.c index e86f903..e8ff5aa 100644 --- a/src/nv50_exa.c +++ b/src/nv50_exa.c @@ -24,6 +24,7 @@ #include "nv_include.h" #include "nv_rop.h" +#include "nv04_pushbuf.h" #include "nv50_accel.h" #include "nv50_texture.h" diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c index 1ade291..b1553f6 100644 --- a/src/nv_accel_common.c +++ b/src/nv_accel_common.c @@ -21,6 +21,7 @@ */ #include "nv_include.h" +#include "nv04_pushbuf.h" Bool nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp, diff --git a/src/nv_driver.c b/src/nv_driver.c index e2df82e..f4aa2bc 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -24,6 +24,8 @@ #include "nv_include.h" +#include "nouveau_pushbuf.h" + #include "xorg-server.h" #include "xf86int10.h" #include "xf86drm.h" diff --git a/src/nv_include.h b/src/nv_include.h index 48f0b21..9cb697a 100644 --- a/src/nv_include.h +++ b/src/nv_include.h @@ -75,7 +75,6 @@ #include "nouveau_drmif.h" #include "nouveau_device.h" #include "nouveau_channel.h" -#include "nouveau_pushbuf.h" #include "nouveau_bo.h" #include "nouveau_grobj.h" #include "nouveau_notifier.h" -- cgit v1.2.1