rpms/xorg-x11-drv-nouveau/devel .cvsignore, 1.34, 1.35 nouveau-fb-resize.patch, 1.2, 1.3 nouveau-multiple-xserver.patch, 1.3, 1.4 nouveau-nv50-fb-accel.patch, 1.3, 1.4 nouveau-store-vbios.patch, 1.3, 1.4 nouveau-transition-hack.patch, 1.3, 1.4 sources, 1.35, 1.36 xorg-x11-drv-nouveau.spec, 1.41, 1.42
Ben Skeggs
bskeggs at fedoraproject.org
Mon Jul 6 00:12:54 UTC 2009
- Previous message (by thread): rpms/lxmenu-data/F-10 lxmenu-data-0.1.1-menu.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 lxmenu-data.spec, 1.1, 1.2 sources, 1.2, 1.3 lxmenu-data-0.1-menu.patch, 1.1, NONE
- Next message (by thread): rpms/xorg-x11-drv-nouveau/devel nouveau-bicubic-2x.patch,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: bskeggs
Update of /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28454
Modified Files:
.cvsignore nouveau-fb-resize.patch
nouveau-multiple-xserver.patch nouveau-nv50-fb-accel.patch
nouveau-store-vbios.patch nouveau-transition-hack.patch
sources xorg-x11-drv-nouveau.spec
Log Message:
* Mon Jul 7 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.14-1.20090701git6d14327
- update from upstream + bring back additional features found in F11
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/.cvsignore,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -p -r1.34 -r1.35
--- .cvsignore 29 Jun 2009 00:11:59 -0000 1.34
+++ .cvsignore 6 Jul 2009 00:12:23 -0000 1.35
@@ -1 +1 @@
-xf86-video-nouveau-0.0.14-20090625gitc0bf670.tar.bz2
+xf86-video-nouveau-0.0.14-20090701git6d14327.tar.bz2
nouveau-fb-resize.patch:
Index: nouveau-fb-resize.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/nouveau-fb-resize.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- nouveau-fb-resize.patch 17 Apr 2009 02:29:59 -0000 1.2
+++ nouveau-fb-resize.patch 6 Jul 2009 00:12:23 -0000 1.3
@@ -1,25 +1,27 @@
-From 9189921f9822579246be05eec4f97e04cc609e7f Mon Sep 17 00:00:00 2001
+From d061d79be9996d1dfc0295ad1b5cce3b1822d253 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <skeggsb at caspar.localdomain>
Date: Tue, 14 Apr 2009 09:23:07 +1000
-Subject: [PATCH 6/6] f11: support framebuffer resize without driver pixmaps
+Subject: [PATCH 4/5] f11: support framebuffer resize without driver pixmaps
---
- src/drmmode_display.c | 75 +++++++++++++++++++++++++++++++--
- src/nouveau_exa.c | 8 ++-
- src/nv50_randr.c | 6 +++
- src/nv_crtc.c | 16 ++++++-
- src/nv_driver.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++---
+ src/drmmode_display.c | 77 ++++++++++++++++++++++++++++++++---
+ src/nouveau_exa.c | 21 +++++-----
+ src/nouveau_ms.h | 1 +
+ src/nv50_randr.c | 13 +++++-
+ src/nv_crtc.c | 31 +++++++++-----
+ src/nv_driver.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++---
src/nv_type.h | 9 ++++-
- 6 files changed, 205 insertions(+), 17 deletions(-)
+ 7 files changed, 226 insertions(+), 35 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index ca1a60b..c666c9f 100644
+index 7313653..c831127 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
-@@ -1069,6 +1069,59 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+@@ -1075,7 +1075,60 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
}
static Bool
+-drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
+nv_xf86crtc_resize(ScrnInfoPtr pScrn, int width, int height)
+{
+ ScreenPtr pScreen = pScrn->pScreen;
@@ -73,10 +75,11 @@ index ca1a60b..c666c9f 100644
+}
+
+static Bool
- drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
++drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-@@ -1083,10 +1136,23 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
+@@ -1092,10 +1145,23 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
ErrorF("resize called %d %d\n", width, height);
if (!pNv->exa_driver_pixmaps) {
@@ -89,12 +92,12 @@ index ca1a60b..c666c9f 100644
+ drmModeRmFB(drmmode->fd, drmmode->fb_id);
+ drmmode->fb_id = 0;
+
-+ for (i = 0; i < config->num_crtc; i++) {
-+ xf86CrtcPtr crtc = config->crtc[i];
++ for (i = 0; i < xf86_config->num_crtc; i++) {
++ xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+ if (!crtc->enabled)
+ continue;
-+
++
+ xf86CrtcSetMode(crtc, &crtc->mode, crtc->rotation,
+ crtc->x, crtc->y);
+ }
@@ -102,7 +105,7 @@ index ca1a60b..c666c9f 100644
return TRUE;
}
-@@ -1149,7 +1215,7 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
+@@ -1175,7 +1241,7 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
{
@@ -111,7 +114,7 @@ index ca1a60b..c666c9f 100644
drmmode_ptr drmmode;
int i;
-@@ -1173,8 +1239,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
+@@ -1199,8 +1265,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
for (i = 0; i < drmmode->mode_res->count_connectors; i++)
drmmode_output_init(pScrn, drmmode, i);
@@ -122,10 +125,10 @@ index ca1a60b..c666c9f 100644
}
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
-index aee2794..6da7d36 100644
+index 3570301..daf6f72 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
-@@ -279,7 +279,10 @@ nouveau_exa_prepare_access(PixmapPtr ppix, int index)
+@@ -282,7 +282,10 @@ nouveau_exa_prepare_access(PixmapPtr ppix, int index)
} else
if (ppix == pScreen->GetScreenPixmap(pScreen)) {
nouveau_bo_map(pNv->scanout, NOUVEAU_BO_RDWR);
@@ -133,11 +136,21 @@ index aee2794..6da7d36 100644
+ if (pNv->scanout != pNv->FB)
+ ppix->devPrivate.ptr = pNv->scanout->map;
+ else
-+ ppix->devPrivate.ptr = pNv->FB->map + pNv->exa_onscreen->offset;
++ ppix->devPrivate.ptr = pNv->FB->map + pNv->exa_onscreen->offset;
} else {
/* force migration */
return FALSE;
-@@ -543,10 +546,9 @@ Bool
+@@ -304,7 +307,8 @@ nouveau_exa_finish_access(PixmapPtr ppix, int index)
+ if (ppix == pScreen->GetScreenPixmap(pScreen)) {
+ ppix->devPrivate.ptr = NULL;
+ nouveau_bo_unmap(pNv->scanout);
+- nv50_shadow_damage_frontbuffer_fallback(pScrn);
++ if (pNv->Architecture == NV_ARCH_50)
++ nv50_shadow_damage_frontbuffer_fallback(pScrn);
+ }
+ }
+
+@@ -629,10 +633,9 @@ Bool
nouveau_exa_pixmap_is_onscreen(PixmapPtr ppix)
{
ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
@@ -149,47 +162,148 @@ index aee2794..6da7d36 100644
return TRUE;
return FALSE;
+@@ -679,9 +682,7 @@ nouveau_exa_init(ScreenPtr pScreen)
+ nouveau_bo_map(pNv->FB, NOUVEAU_BO_RDWR);
+ exa->memoryBase = pNv->FB->map;
+ nouveau_bo_unmap(pNv->FB);
+- exa->offScreenBase = NOUVEAU_ALIGN(pScrn->virtualX, 64) *
+- NOUVEAU_ALIGN(pScrn->virtualY, 64) *
+- (pScrn->bitsPerPixel / 8);
++ exa->offScreenBase = 0x1000; /* just a little to keep "0" special */
+ exa->memorySize = pNv->FB->size;
+
+ if (pNv->Architecture < NV_ARCH_50) {
+@@ -722,10 +723,8 @@ nouveau_exa_init(ScreenPtr pScreen)
+ }
+
+ /* Needed for frontbuffer fallbacks (to ensure it accesses the linear fb). */
+- if (pNv->Architecture >= NV_ARCH_50) {
+- exa->PrepareAccess = nouveau_exa_prepare_access;
+- exa->FinishAccess = nouveau_exa_finish_access;
+- }
++ exa->PrepareAccess = nouveau_exa_prepare_access;
++ exa->FinishAccess = nouveau_exa_finish_access;
+
+ exa->MarkSync = nouveau_exa_mark_sync;
+ exa->WaitMarker = nouveau_exa_wait_marker;
+diff --git a/src/nouveau_ms.h b/src/nouveau_ms.h
+index 535f16e..681146a 100644
+--- a/src/nouveau_ms.h
++++ b/src/nouveau_ms.h
+@@ -129,6 +129,7 @@ struct nouveau_crtc {
+
+ uint32_t cursor_fg, cursor_bg;
+ ExaOffscreenArea *shadow;
++ unsigned shadow_pitch;
+ };
+
+ struct nouveau_encoder {
diff --git a/src/nv50_randr.c b/src/nv50_randr.c
-index 6c19780..f44d286 100644
+index e006b38..64c6794 100644
--- a/src/nv50_randr.c
+++ b/src/nv50_randr.c
-@@ -289,8 +289,14 @@ nv50_crtc_set_origin(xf86CrtcPtr crtc, int x, int y)
+@@ -308,8 +308,19 @@ nv50_crtc_set_origin(xf86CrtcPtr crtc, int x, int y)
{
ScrnInfoPtr pScrn = crtc->scrn;
NV50CrtcPrivatePtr nv_crtc = crtc->driver_private;
++ nouveauCrtcPtr nvcrtc = nv_crtc->crtc; /* sigh.. */
+ NVPtr pNv = NVPTR(pScrn);
-
- nv_crtc->crtc->SetFBOffset(nv_crtc->crtc, x, y);
-+ if (nv_crtc->crtc->front_buffer &&
-+ nv_crtc->crtc->front_buffer != pNv->scanout) {
-+ nv_crtc->crtc->SetFB(nv_crtc->crtc, pNv->scanout);
-+ nv_crtc->crtc->ModeSet(nv_crtc->crtc, &crtc->mode);
-+ }
++ uint32_t fb;
++
++ nvcrtc->SetFB(nvcrtc, pNv->scanout);
++ nvcrtc->SetFBOffset(nvcrtc, x, y);
++ nvcrtc->fb_pitch = pScrn->displayWidth * (pScrn->bitsPerPixel >> 3);
++ fb = nvcrtc->front_buffer->offset - pNv->dev->vm_vram_base;
+
+- nv_crtc->crtc->SetFBOffset(nv_crtc->crtc, x, y);
++ NV50CrtcCommand(nvcrtc, NV50_CRTC0_FB_OFFSET, fb >> 8);
++ NV50CrtcCommand(nvcrtc, NV50_CRTC0_FB_PITCH, nvcrtc->fb_pitch | (1<<20));
++ NV50CrtcCommand(nvcrtc, NV50_CRTC0_FB_SIZE, (pScrn->virtualY << 16) |
++ pScrn->virtualX);
NV50DisplayCommand(pScrn, NV50_UPDATE_DISPLAY, 0);
}
diff --git a/src/nv_crtc.c b/src/nv_crtc.c
-index 1d50874..cfa06e1 100644
+index b8524fb..7f9b82b 100644
--- a/src/nv_crtc.c
+++ b/src/nv_crtc.c
-@@ -1154,7 +1154,10 @@ void NVCrtcSetBase(xf86CrtcPtr crtc, int x, int y)
+@@ -953,7 +953,7 @@ nv_crtc_shadow_allocate (xf86CrtcPtr crtc, int width, int height)
+ unsigned long rotate_pitch;
+ int size, align = 64;
+
+- rotate_pitch = pScrn->displayWidth * (pScrn->bitsPerPixel/8);
++ rotate_pitch = NOUVEAU_ALIGN(width, align) * (pScrn->bitsPerPixel/8);
+ size = rotate_pitch * height;
+
+ assert(nv_crtc->shadow == NULL);
+@@ -986,6 +986,7 @@ nv_crtc_shadow_allocate (xf86CrtcPtr crtc, int width, int height)
+ offset = pNv->FBMap + nv_crtc->shadow->offset;
+ #endif /* NOUVEAU_EXA_PIXMAPS */
+
++ nv_crtc->shadow_pitch = rotate_pitch;
+ return offset;
+ }
+
+@@ -996,11 +997,10 @@ static PixmapPtr
+ nv_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
+ {
+ ScrnInfoPtr pScrn = crtc->scrn;
++ struct nouveau_crtc *nv_crtc = to_nouveau_crtc(crtc);
+ #if NOUVEAU_EXA_PIXMAPS
+ ScreenPtr pScreen = pScrn->pScreen;
+- struct nouveau_crtc *nv_crtc = to_nouveau_crtc(crtc);
+ #endif /* NOUVEAU_EXA_PIXMAPS */
+- unsigned long rotate_pitch;
+ PixmapPtr rotate_pixmap;
+ #if NOUVEAU_EXA_PIXMAPS
+ struct nouveau_pixmap *nvpix;
+@@ -1009,8 +1009,6 @@ nv_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
+ if (!data)
+ data = crtc->funcs->shadow_allocate (crtc, width, height);
+
+- rotate_pitch = pScrn->displayWidth * (pScrn->bitsPerPixel/8);
+-
+ #if NOUVEAU_EXA_PIXMAPS
+ /* Create a dummy pixmap, to get a private that will be accepted by the system.*/
+ rotate_pixmap = pScreen->CreatePixmap(pScreen,
+@@ -1027,7 +1025,7 @@ nv_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
+ width, height,
+ pScrn->depth,
+ pScrn->bitsPerPixel,
+- rotate_pitch,
++ nv_crtc->shadow_pitch,
+ data);
+ #endif /* NOUVEAU_EXA_PIXMAPS */
+
+@@ -1051,7 +1049,7 @@ nv_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
+ height,
+ pScrn->depth,
+ pScrn->bitsPerPixel,
+- rotate_pitch,
++ nv_crtc->rotate_pitch,
+ data);
+
+ nvpix = exaGetPixmapDriverPrivate(rotate_pixmap);
+@@ -1154,16 +1152,29 @@ void NVCrtcSetBase(xf86CrtcPtr crtc, int x, int y)
ScrnInfoPtr pScrn = crtc->scrn;
- NVPtr pNv = NVPTR(pScrn);
+ NVPtr pNv = NVPTR(pScrn);
struct nouveau_crtc *nv_crtc = to_nouveau_crtc(crtc);
- uint32_t start = (y * pScrn->displayWidth + x) * pScrn->bitsPerPixel / 8;
+ uint32_t cpp = pScrn->bitsPerPixel / 8;
+ uint32_t start = (y * pScrn->displayWidth + x) * cpp;
+ uint32_t pitch = pScrn->displayWidth * cpp;
-+ NVCrtcRegPtr regp = &pNv->ModeReg.crtc_reg[nv_crtc->head];
++ struct nouveau_crtc_state *regp = nv_crtc->state;
- if (crtc->rotatedData != NULL) /* we do not exist on the real framebuffer */
+- if (crtc->rotatedData != NULL) /* we do not exist on the real framebuffer */
++ if (crtc->rotatedData != NULL) { /* we do not exist on the real framebuffer */
#if NOUVEAU_EXA_PIXMAPS
-@@ -1162,8 +1165,17 @@ void NVCrtcSetBase(xf86CrtcPtr crtc, int x, int y)
+ start = nv_crtc->shadow->offset;
#else
start = pNv->FB->offset + nv_crtc->shadow->offset; /* We do exist relative to the framebuffer */
#endif
- else
-+ else {
++ pitch = nv_crtc->shadow_pitch;
++ } else {
+ if (pNv->exa_onscreen)
+ start += pNv->exa_onscreen->offset;
start += pNv->FB->offset;
@@ -198,16 +312,16 @@ index 1d50874..cfa06e1 100644
+ regp->CRTC[NV_CIO_CR_OFFSET_INDEX] = pitch >> 3;
+ regp->CRTC[NV_CIO_CRE_RPC0_INDEX] =
+ XLATE(pitch >> 3, 8, NV_CIO_CRE_RPC0_OFFSET_10_8);
-+ crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_RPC0_INDEX);
-+ crtc_wr_cio_state(crtc, regp, NV_CIO_CR_OFFSET_INDEX);
++ crtc_wr_cio_state(crtc, NV_CIO_CRE_RPC0_INDEX);
++ crtc_wr_cio_state(crtc, NV_CIO_CR_OFFSET_INDEX);
start &= ~3;
- pNv->ModeReg.crtc_reg[nv_crtc->head].fb_start = start;
+ nv_crtc->state->fb_start = start;
diff --git a/src/nv_driver.c b/src/nv_driver.c
-index f097fb9..0cc81ae 100644
+index 0db0c1c..64f4652 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
-@@ -900,16 +900,112 @@ Bool NVI2CInit(ScrnInfoPtr pScrn)
+@@ -776,16 +776,113 @@ Bool NVI2CInit(ScrnInfoPtr pScrn)
return TRUE;
}
@@ -241,8 +355,9 @@ index f097fb9..0cc81ae 100644
+ }
+
+ if (!pNv->scanout) {
-+ ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN,
-+ 256, pitch * height, &pNv->scanout);
++ ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_MAP | NOUVEAU_BO_PIN |
++ NOUVEAU_BO_VRAM, 256, pitch * height,
++ &pNv->scanout);
+ if (ret) {
+ nouveau_fb_free(pScrn);
+ return ret;
@@ -316,7 +431,7 @@ index f097fb9..0cc81ae 100644
+
+ if (!crtc->enabled)
+ continue;
-+
++
+ xf86CrtcSetMode(crtc, &crtc->mode, crtc->rotation,
+ crtc->x, crtc->y);
+ }
@@ -325,7 +440,7 @@ index f097fb9..0cc81ae 100644
}
static const xf86CrtcConfigFuncsRec nv_xf86crtc_config_funcs = {
-@@ -1423,7 +1519,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
+@@ -1314,7 +1411,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
} else
nv50_output_create(pScrn); /* create randr-1.2 "outputs". */
@@ -335,22 +450,23 @@ index f097fb9..0cc81ae 100644
}
diff --git a/src/nv_type.h b/src/nv_type.h
-index 5396cc8..1a9b9ed 100644
+index 7d7ede9..04b5fa2 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
-@@ -304,8 +304,11 @@ typedef struct _NVRec {
+@@ -204,9 +204,12 @@ typedef struct _NVRec {
volatile CARD8 *PDIO1;
uint8_t cur_head;
+
ExaDriverPtr EXADriverPtr;
Bool exa_driver_pixmaps;
+ Bool wfb_enabled;
+ ExaOffscreenArea * exa_onscreen;
+
ScreenBlockHandlerProcPtr BlockHandler;
CloseScreenProcPtr CloseScreen;
/* Cursor */
-@@ -494,11 +497,15 @@ nouveau_pixmap_offset(PixmapPtr ppix)
+@@ -394,11 +397,15 @@ nouveau_pixmap_offset(PixmapPtr ppix)
{
ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
NVPtr pNv = NVPTR(pScrn);
@@ -368,5 +484,5 @@ index 5396cc8..1a9b9ed 100644
#endif /* __NV_STRUCT_H__ */
--
-1.6.2.2
+1.6.2.5
nouveau-multiple-xserver.patch:
Index: nouveau-multiple-xserver.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/nouveau-multiple-xserver.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- nouveau-multiple-xserver.patch 17 Apr 2009 02:30:00 -0000 1.3
+++ nouveau-multiple-xserver.patch 6 Jul 2009 00:12:24 -0000 1.4
@@ -1,14 +1,14 @@
-From 7811f9211a960dd6396f8e29964dcde2aec6f2e5 Mon Sep 17 00:00:00 2001
-From: Ben Skeggs <skeggsb at gmail.com>
-Date: Mon, 13 Apr 2009 19:25:25 +1000
-Subject: [PATCH 3/6] f11: hack to support multiple xserver instances
+From 4ad2199fcacda97aeb11277e3530f847fd23ca47 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs at redhat.com>
+Date: Sun, 28 Jun 2009 20:35:54 +1000
+Subject: [PATCH 1/5] f12: hack to support multiple xserver instances
---
- src/nv_driver.c | 126 ++++++++++++++++++++++++++++++++++++++++++------------
- 1 files changed, 98 insertions(+), 28 deletions(-)
+ src/nv_driver.c | 98 +++++++++++++++++++++++++++++++++++++++---------------
+ 1 files changed, 71 insertions(+), 27 deletions(-)
diff --git a/src/nv_driver.c b/src/nv_driver.c
-index 92232dd..9f4c96f 100644
+index 3312192..3d49b10 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -21,6 +21,7 @@
@@ -19,7 +19,7 @@ index 92232dd..9f4c96f 100644
#include "nv_include.h"
-@@ -654,14 +655,27 @@ NV50ReleaseDisplay(ScrnInfoPtr pScrn)
+@@ -532,14 +533,27 @@ NV50ReleaseDisplay(ScrnInfoPtr pScrn)
*/
/* Mandatory */
@@ -47,60 +47,38 @@ index 92232dd..9f4c96f 100644
if (!pNv->NoAccel)
NVAccelCommonInit(pScrn);
-@@ -718,6 +732,12 @@ NVLeaveVT(int scrnIndex, int flags)
+@@ -596,6 +610,13 @@ NVLeaveVT(int scrnIndex, int flags)
NVSync(pScrn);
+ if (pNv->dev) {
-+ nouveau_bo_ref(NULL, &pNv->GART);
++ struct nouveau_device_priv *nvdev = nouveau_device(pNv->dev);
+
-+ ioctl(nouveau_device(pNv->dev)->fd, DRM_IOCTL_DROP_MASTER, NULL);
++ nouveau_bo_ref(NULL, &pNv->GART);
++ ioctl(nvdev->fd, DRM_IOCTL_DROP_MASTER, NULL);
+ }
+
if (!pNv->kms_enable) {
if (pNv->Architecture < NV_ARCH_50)
NVRestore(pScrn);
-@@ -1629,11 +1649,81 @@ NVMapMemSW(ScrnInfoPtr pScrn)
+@@ -1528,6 +1549,52 @@ NVMapMemSW(ScrnInfoPtr pScrn)
}
static Bool
+NVMapMemSharedFB(ScrnInfoPtr pScrn)
+{
+ NVPtr pNv = NVPTR(pScrn);
-+ uint64_t handle, size;
-+ void *map;
++ uint64_t handle;
+ int ret;
+
+ ret = nouveau_device_get_param(pNv->dev, 0xdeadcafe00000001, &handle);
+ if (ret)
+ return FALSE;
+
-+ ret = nouveau_device_get_param(pNv->dev, 0xdeadcafe00000002, &size);
++ ret = nouveau_bo_wrap(pNv->dev, handle, &pNv->FB);
+ if (ret)
+ return FALSE;
+
-+ if (nouveau_device(pNv->dev)->mm_enabled) {
-+ ret = nouveau_bo_handle_ref(pNv->dev, handle, &pNv->FB);
-+ if (ret) {
-+ ErrorF("%d\n", ret);
-+ return FALSE;
-+ }
-+
-+ pNv->FB->size = size;
-+ pNv->FB->tiled = (pNv->Architecture == NV_ARCH_50);
-+ return TRUE;
-+ }
-+
-+ ret = drmMap(nouveau_device(pNv->dev)->fd, handle >> 32, size, &map);
-+ if (ret)
-+ return FALSE;
-+
-+ ret = nouveau_bo_fake(pNv->dev, handle & 0xffffffff, NOUVEAU_BO_VRAM |
-+ NOUVEAU_BO_PIN, size, map, &pNv->FB);
-+ if (ret)
-+ return FALSE;
-+
-+ pNv->FB->tiled = (pNv->Architecture == NV_ARCH_50);
+ return TRUE;
+}
+
@@ -125,8 +103,8 @@ index 92232dd..9f4c96f 100644
+ size >> 10);
+ }
+
-+ if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_PIN, 0,
-+ size, &pNv->GART)) {
++ if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_PIN |
++ NOUVEAU_BO_MAP, 0, size, &pNv->GART)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Unable to allocate GART memory\n");
+ }
@@ -136,32 +114,20 @@ index 92232dd..9f4c96f 100644
NVMapMem(ScrnInfoPtr pScrn)
{
NVPtr pNv = NVPTR(pScrn);
- uint64_t res;
- int size;
-+ uint32_t flags;
-
- if (!pNv->dev)
- return NVMapMemSW(pScrn);
-@@ -1650,46 +1740,26 @@ NVMapMem(ScrnInfoPtr pScrn)
+@@ -1558,6 +1625,8 @@ NVMapMem(ScrnInfoPtr pScrn)
size = size * (pScrn->bitsPerPixel >> 3);
- size = size * pScrn->virtualY;
+ size = size * height;
} else {
+ if (NVMapMemSharedFB(pScrn))
+ goto skip_fb;
size = pNv->VRAMPhysicalSize / 2;
}
-- if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN,
-- 0, size, &pNv->FB)) {
-+ flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN;
-+ if (pNv->Architecture >= NV_ARCH_50)
-+ flags |= NOUVEAU_BO_TILED;
-+
-+ if (nouveau_bo_new(pNv->dev, flags, 0, size, &pNv->FB)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+@@ -1568,38 +1637,13 @@ NVMapMem(ScrnInfoPtr pScrn)
"Failed to allocate framebuffer memory\n");
return FALSE;
}
++
+skip_fb:
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Allocated %dMiB VRAM for framebuffer + offscreen pixmaps, "
@@ -184,8 +150,8 @@ index 92232dd..9f4c96f 100644
- size >> 10);
- }
-
-- if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_PIN, 0,
-- size, &pNv->GART)) {
+- if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_PIN |
+- NOUVEAU_BO_MAP, 0, size, &pNv->GART)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Unable to allocate GART memory\n");
- }
@@ -194,9 +160,10 @@ index 92232dd..9f4c96f 100644
- "GART: Allocated %dMiB as a scratch buffer\n",
- (unsigned int)(pNv->GART->size >> 20));
- }
-
+-
/* We don't need to allocate cursors / lut here if we're using
* kernel modesetting
+ **/
--
-1.6.2.2
+1.6.2.5
nouveau-nv50-fb-accel.patch:
Index: nouveau-nv50-fb-accel.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/nouveau-nv50-fb-accel.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- nouveau-nv50-fb-accel.patch 17 Apr 2009 02:30:00 -0000 1.3
+++ nouveau-nv50-fb-accel.patch 6 Jul 2009 00:12:24 -0000 1.4
@@ -1,27 +1,27 @@
-From ae25ecbcb06ea2e32af8c7268ce138645d02274f Mon Sep 17 00:00:00 2001
+From 7215e5332099799538dbe6e69a726bdf8e540709 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <skeggsb at gmail.com>
Date: Mon, 13 Apr 2009 19:30:38 +1000
-Subject: [PATCH 4/6] nv50/f11: accelerate front-buffer rendering, linear shadow for scanout
+Subject: [PATCH 3/5] nv50/f11: accelerate front-buffer rendering, linear shadow for scanout
---
src/Makefile.am | 1 +
- src/drmmode_display.c | 8 +-
- src/nouveau_exa.c | 37 +++++--
+ src/drmmode_display.c | 10 +-
+ src/nouveau_exa.c | 37 ++++--
src/nv50_randr.c | 2 +-
- src/nv50_shadow_damage.c | 275 ++++++++++++++++++++++++++++++++++++++++++++++
+ src/nv50_shadow_damage.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++
src/nv_dri.c | 2 +-
- src/nv_driver.c | 38 ++++++-
+ src/nv_driver.c | 40 ++++++-
src/nv_proto.h | 4 +
src/nv_shadow.c | 8 +-
src/nv_type.h | 4 +
- 10 files changed, 356 insertions(+), 23 deletions(-)
+ 10 files changed, 392 insertions(+), 24 deletions(-)
create mode 100644 src/nv50_shadow_damage.c
diff --git a/src/Makefile.am b/src/Makefile.am
-index 29253a6..0c9e4e9 100644
+index c8016eb..b8c0f8d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -81,6 +81,7 @@ nouveau_drv_la_SOURCES = \
+@@ -83,6 +83,7 @@ nouveau_drv_la_SOURCES = \
nv50_xv.c \
nv50_texture.h \
nv50reg.h \
@@ -30,13 +30,13 @@ index 29253a6..0c9e4e9 100644
nouveau_output.h \
nouveau_connector.h \
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index 4909e51..ca1a60b 100644
+index 7f9b31d..7313653 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
-@@ -214,8 +214,8 @@ drmmode_fb_copy_sw(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
+@@ -201,8 +201,8 @@ drmmode_fb_copy_sw(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
}
- src = (void *)req.vaddr;
-
+ src = src_bo->map;
+
- nouveau_bo_map(pNv->FB, NOUVEAU_BO_WR);
- dst = pNv->FB->map;
+ nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR);
@@ -44,16 +44,25 @@ index 4909e51..ca1a60b 100644
dst += (y * fb->pitch) + (x * (fb->bpp >> 3));
h = fb->height;
-@@ -225,7 +225,7 @@ drmmode_fb_copy_sw(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
+@@ -212,7 +212,7 @@ drmmode_fb_copy_sw(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
dst += pScrn->displayWidth * (pScrn->bitsPerPixel / 8);
}
- nouveau_bo_unmap(pNv->FB);
+ nouveau_bo_unmap(pNv->scanout);
+ nouveau_bo_unmap(src_bo);
+ nouveau_bo_ref(NULL, &src_bo);
drmFree(fb);
- }
+@@ -255,7 +255,7 @@ drmmode_fb_copy_nv50(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id,
+ return;
+ }
+
+- nouveau_bo_ref(pNv->FB, &dst);
++ nouveau_bo_ref(pNv->scanout, &dst);
-@@ -380,7 +380,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+ BEGIN_RING(chan, eng2d, 0x02ac, 1);
+ OUT_RING (chan, 3);
+@@ -372,7 +372,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
ret = drmModeAddFB(drmmode->fd,
pScrn->virtualX, pScrn->virtualY,
pScrn->depth, pScrn->bitsPerPixel,
@@ -63,10 +72,10 @@ index 4909e51..ca1a60b 100644
ErrorF("failed to add fb\n");
return FALSE;
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
-index b7bcc87..aee2794 100644
+index b143633..3570301 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
-@@ -265,7 +265,8 @@ nouveau_exa_wait_marker(ScreenPtr pScreen, int marker)
+@@ -268,7 +268,8 @@ nouveau_exa_wait_marker(ScreenPtr pScreen, int marker)
static Bool
nouveau_exa_prepare_access(PixmapPtr ppix, int index)
{
@@ -76,7 +85,7 @@ index b7bcc87..aee2794 100644
NVPtr pNv = NVPTR(pScrn);
if (pNv->exa_driver_pixmaps) {
-@@ -275,20 +276,33 @@ nouveau_exa_prepare_access(PixmapPtr ppix, int index)
+@@ -278,20 +279,33 @@ nouveau_exa_prepare_access(PixmapPtr ppix, int index)
return FALSE;
ppix->devPrivate.ptr = map;
@@ -114,8 +123,8 @@ index b7bcc87..aee2794 100644
}
static Bool
-@@ -393,8 +407,7 @@ nouveau_exa_pixmap_is_tiled(PixmapPtr ppix)
- if (!nouveau_pixmap_bo(ppix)->tiled)
+@@ -475,8 +489,7 @@ nouveau_exa_pixmap_is_tiled(PixmapPtr ppix)
+ if (!nouveau_pixmap_bo(ppix)->tile_flags)
return false;
} else
- if (pNv->Architecture < NV_ARCH_50 ||
@@ -124,25 +133,25 @@ index b7bcc87..aee2794 100644
return false;
return true;
-@@ -406,7 +419,7 @@ nouveau_exa_pixmap_map(PixmapPtr ppix)
+@@ -490,7 +503,7 @@ nouveau_exa_pixmap_map(PixmapPtr ppix)
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
unsigned delta = nouveau_pixmap_offset(ppix);
-- if (bo->tiled) {
-+ if (NVPTR(xf86Screens[ppix->drawable.pScreen->myNum])->GART && bo->tiled) {
+- if (bo->tile_flags && !pNv->wfb_enabled) {
++ if (pNv->GART && bo->tile_flags && !pNv->wfb_enabled) {
struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
nvpix->map_refcount++;
-@@ -432,7 +445,7 @@ nouveau_exa_pixmap_unmap(PixmapPtr ppix)
- {
+@@ -518,7 +531,7 @@ nouveau_exa_pixmap_unmap(PixmapPtr ppix)
+ NVPtr pNv = NVPTR(pScrn);
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
-- if (bo->tiled) {
-+ if (NVPTR(xf86Screens[ppix->drawable.pScreen->myNum])->GART && bo->tiled) {
+- if (bo->tile_flags && !pNv->wfb_enabled) {
++ if (pNv->GART && bo->tile_flags && !pNv->wfb_enabled) {
struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
if (--nvpix->map_refcount)
-@@ -616,6 +629,12 @@ nouveau_exa_init(ScreenPtr pScreen)
+@@ -708,6 +721,12 @@ nouveau_exa_init(ScreenPtr pScreen)
exa->maxY = 2048;
}
@@ -156,10 +165,10 @@ index b7bcc87..aee2794 100644
exa->WaitMarker = nouveau_exa_wait_marker;
diff --git a/src/nv50_randr.c b/src/nv50_randr.c
-index 657e13a..6c19780 100644
+index 7a88f24..e006b38 100644
--- a/src/nv50_randr.c
+++ b/src/nv50_randr.c
-@@ -99,7 +99,7 @@ nv50_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjuste
+@@ -117,7 +117,7 @@ nv50_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjuste
nv_crtc->crtc->SetFB(nv_crtc->crtc, nv_crtc->shadow);
nv_crtc->crtc->SetFBOffset(nv_crtc->crtc, 0, 0);
} else {
@@ -170,10 +179,10 @@ index 657e13a..6c19780 100644
nv_crtc->crtc->ModeSet(nv_crtc->crtc, mode);
diff --git a/src/nv50_shadow_damage.c b/src/nv50_shadow_damage.c
new file mode 100644
-index 0000000..942aba3
+index 0000000..12ea87d
--- /dev/null
+++ b/src/nv50_shadow_damage.c
-@@ -0,0 +1,275 @@
+@@ -0,0 +1,308 @@
+/*
+ * Copyright 2009 Maarten Maathuis
+ *
@@ -208,37 +217,31 @@ index 0000000..942aba3
+#include "damagestr.h"
+
+/* When driver allocated pixmaps are used we can easily fold this back into exa code. */
-+static void nv50_shadow_damage_blit(PixmapPtr ppix, RegionPtr pRegion)
++
++static void
++nv50_shadow_damage_blit_state_emit(struct nouveau_channel *chan)
+{
-+ ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
++ ScrnInfoPtr pScrn = chan->user_private;
+ NVPtr pNv = NVPTR(pScrn);
-+ struct nouveau_channel *chan = pNv->chan;
-+ struct nouveau_grobj *eng2d = pNv->Nv2D;
++ PixmapPtr ppix = pNv->pspix;
+ struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
-+ unsigned delta = nouveau_pixmap_offset(ppix);
-+ uint32_t fmt;
-+ BoxPtr pbox;
-+ int nbox;
-+
-+ pbox = REGION_RECTS(pRegion);
-+ nbox = REGION_NUM_RECTS(pRegion);
-+ if (!nbox)
-+ return;
++ struct nouveau_grobj *eng2d = pNv->Nv2D;
++ unsigned delta = nouveau_pixmap_offset(ppix), fmt;
+
-+ /* flush_notify is not needed, we check for all the ring space in advance. */
-+ WAIT_RING (chan, 26 + nbox * 13);
++ WAIT_RING (chan, 27 + 13);
+
+ switch (ppix->drawable.depth) {
-+ case 8 : fmt = NV50_2D_SRC_FORMAT_8BPP; break;
-+ case 15: fmt = NV50_2D_SRC_FORMAT_15BPP; break;
-+ case 16: fmt = NV50_2D_SRC_FORMAT_16BPP; break;
-+ case 24: fmt = NV50_2D_SRC_FORMAT_24BPP; break;
-+ case 32: fmt = NV50_2D_SRC_FORMAT_32BPP; break;
-+ default:
-+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-+ "Unknown surface format for bpp=%d\n",
-+ ppix->drawable.depth);
-+ return;
++ case 8 : fmt = NV50_2D_SRC_FORMAT_8BPP; break;
++ case 15: fmt = NV50_2D_SRC_FORMAT_15BPP; break;
++ case 16: fmt = NV50_2D_SRC_FORMAT_16BPP; break;
++ case 24: fmt = NV50_2D_SRC_FORMAT_24BPP; break;
++ case 30: fmt = 0xd1; break;
++ case 32: fmt = NV50_2D_SRC_FORMAT_32BPP; break;
++ default:
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++ "Unknown surface format for bpp=%d\n",
++ ppix->drawable.depth);
++ return;
+ }
+
+ /* tiled source */
@@ -274,8 +277,28 @@ index 0000000..942aba3
+ OUT_RING (chan, ppix->drawable.height);
+ BEGIN_RING(chan, eng2d, NV50_2D_OPERATION, 1);
+ OUT_RING (chan, NV50_2D_OPERATION_SRCCOPY);
++}
++
++static void
++nv50_shadow_damage_blit(PixmapPtr ppix, RegionPtr pRegion)
++{
++ ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
++ NVPtr pNv = NVPTR(pScrn);
++ struct nouveau_channel *chan = pNv->chan;
++ struct nouveau_grobj *eng2d = pNv->Nv2D;
++ BoxPtr pbox;
++ int nbox;
+
++ pbox = REGION_RECTS(pRegion);
++ nbox = REGION_NUM_RECTS(pRegion);
++ if (!nbox)
++ return;
++
++ pNv->pspix = ppix;
++ chan->flush_notify = nv50_shadow_damage_blit_state_emit;
++ chan->flush_notify(chan);
+ while (nbox--) {
++ WAIT_RING (chan, 13);
+ BEGIN_RING(chan, eng2d, NV50_2D_BLIT_DST_X, 12);
+ OUT_RING (chan, pbox->x1);
+ OUT_RING (chan, pbox->y1);
@@ -292,40 +315,34 @@ index 0000000..942aba3
+
+ pbox++;
+ }
++ chan->flush_notify = NULL;
+}
+
+/* For frontbuffer fallbacks. */
-+static void nv50_shadow_damage_blit_back(PixmapPtr ppix, RegionPtr pRegion)
++static void
++nv50_shadow_damage_blit_back_state_emit(struct nouveau_channel *chan)
+{
-+ ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
++ ScrnInfoPtr pScrn = chan->user_private;
+ NVPtr pNv = NVPTR(pScrn);
-+ struct nouveau_channel *chan = pNv->chan;
++ PixmapPtr ppix = pNv->pdpix;
+ struct nouveau_grobj *eng2d = pNv->Nv2D;
+ struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
-+ unsigned delta = nouveau_pixmap_offset(ppix);
-+ uint32_t fmt;
-+ BoxPtr pbox;
-+ int nbox;
++ unsigned delta = nouveau_pixmap_offset(ppix), fmt;
+
-+ pbox = REGION_RECTS(pRegion);
-+ nbox = REGION_NUM_RECTS(pRegion);
-+ if (!nbox)
-+ return;
-+
-+ /* flush_notify is not needed, we check for all the ring space in advance. */
-+ WAIT_RING (chan, 26 + nbox * 13);
++ WAIT_RING (chan, 27 + 13);
+
+ switch (ppix->drawable.depth) {
-+ case 8 : fmt = NV50_2D_SRC_FORMAT_8BPP; break;
-+ case 15: fmt = NV50_2D_SRC_FORMAT_15BPP; break;
-+ case 16: fmt = NV50_2D_SRC_FORMAT_16BPP; break;
-+ case 24: fmt = NV50_2D_SRC_FORMAT_24BPP; break;
-+ case 32: fmt = NV50_2D_SRC_FORMAT_32BPP; break;
-+ default:
-+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-+ "Unknown surface format for bpp=%d\n",
-+ ppix->drawable.depth);
-+ return;
++ case 8 : fmt = NV50_2D_SRC_FORMAT_8BPP; break;
++ case 15: fmt = NV50_2D_SRC_FORMAT_15BPP; break;
++ case 16: fmt = NV50_2D_SRC_FORMAT_16BPP; break;
++ case 24: fmt = NV50_2D_SRC_FORMAT_24BPP; break;
++ case 30: fmt = 0xd1; break;
++ case 32: fmt = NV50_2D_SRC_FORMAT_32BPP; break;
++ default:
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
++ "Unknown surface format for bpp=%d\n",
++ ppix->drawable.depth);
++ return;
+ }
+
+ /* untiled source */
@@ -361,8 +378,28 @@ index 0000000..942aba3
+ OUT_RING (chan, ppix->drawable.height);
+ BEGIN_RING(chan, eng2d, NV50_2D_OPERATION, 1);
+ OUT_RING (chan, NV50_2D_OPERATION_SRCCOPY);
++}
++
++static void
++nv50_shadow_damage_blit_back(PixmapPtr ppix, RegionPtr pRegion)
++{
++ ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
++ NVPtr pNv = NVPTR(pScrn);
++ struct nouveau_channel *chan = pNv->chan;
++ struct nouveau_grobj *eng2d = pNv->Nv2D;
++ BoxPtr pbox;
++ int nbox;
+
++ pbox = REGION_RECTS(pRegion);
++ nbox = REGION_NUM_RECTS(pRegion);
++ if (!nbox)
++ return;
++
++ pNv->pdpix = ppix;
++ chan->flush_notify = nv50_shadow_damage_blit_back_state_emit;
++ chan->flush_notify(chan);
+ while (nbox--) {
++ WAIT_RING (chan, 13);
+ BEGIN_RING(chan, eng2d, NV50_2D_BLIT_DST_X, 12);
+ OUT_RING (chan, pbox->x1);
+ OUT_RING (chan, pbox->y1);
@@ -379,16 +416,19 @@ index 0000000..942aba3
+
+ pbox++;
+ }
++ chan->flush_notify = NULL;
+}
+
-+static void nv50_shadow_damage_report(DamagePtr pDamage, RegionPtr pRegion, void *closure)
++static void
++nv50_shadow_damage_report(DamagePtr pDamage, RegionPtr pRegion, void *closure)
+{
+ PixmapPtr ppix = closure;
+
+ nv50_shadow_damage_blit(ppix, pRegion);
+}
+
-+void nv50_shadow_damage_frontbuffer_fallback(ScrnInfoPtr pScrn)
++void
++nv50_shadow_damage_frontbuffer_fallback(ScrnInfoPtr pScrn)
+{
+ NVPtr pNv = NVPTR(pScrn);
+ ScreenPtr pScreen = pScrn->pScreen;
@@ -410,7 +450,8 @@ index 0000000..942aba3
+ nv50_shadow_damage_blit_back(ppix, &pDamage->pendingDamage);
+}
+
-+static void nv50_shadow_damage_destroy(DamagePtr pDamage, void *closure)
++static void
++nv50_shadow_damage_destroy(DamagePtr pDamage, void *closure)
+{
+ PixmapPtr ppix = closure;
+ ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
@@ -419,7 +460,8 @@ index 0000000..942aba3
+ pNv->screen_damage = NULL;
+}
+
-+bool nv50_shadow_damage_create(ScrnInfoPtr pScrn)
++bool
++nv50_shadow_damage_create(ScrnInfoPtr pScrn)
+{
+ NVPtr pNv = NVPTR(pScrn);
+ ScreenPtr pScreen = pScrn->pScreen;
@@ -450,10 +492,10 @@ index 0000000..942aba3
+ return true;
+}
diff --git a/src/nv_dri.c b/src/nv_dri.c
-index bd3e5a9..dca6a40 100644
+index f1fe501..68284d2 100644
--- a/src/nv_dri.c
+++ b/src/nv_dri.c
-@@ -337,7 +337,7 @@ Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn)
+@@ -335,7 +335,7 @@ Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn)
pNOUVEAUDRI->depth = pScrn->depth;
pNOUVEAUDRI->bpp = pScrn->bitsPerPixel;
@@ -463,10 +505,10 @@ index bd3e5a9..dca6a40 100644
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[dri] unable to reference front buffer: %d\n", ret);
diff --git a/src/nv_driver.c b/src/nv_driver.c
-index 9f4c96f..a280257 100644
+index 3d49b10..0db0c1c 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
-@@ -686,10 +686,11 @@ NVEnterVT(int scrnIndex, int flags)
+@@ -564,10 +564,11 @@ NVEnterVT(int scrnIndex, int flags)
/* Clear the framebuffer, we don't want to see garbage
* on-screen up until X decides to draw something
*/
@@ -482,7 +524,7 @@ index 9f4c96f..a280257 100644
if (pNv->Architecture == NV_ARCH_50) {
if (!NV50AcquireDisplay(pScrn))
-@@ -1609,6 +1610,8 @@ NVMapMemSW(ScrnInfoPtr pScrn)
+@@ -1509,6 +1510,8 @@ NVMapMemSW(ScrnInfoPtr pScrn)
return FALSE;
pNv->GART = NULL;
@@ -491,7 +533,7 @@ index 9f4c96f..a280257 100644
ret = nouveau_bo_fake(&dev, Cursor0Offset,
NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN,
64 * 64 * 4, pNv->VRAMMap + Cursor0Offset,
-@@ -1760,6 +1763,23 @@ skip_fb:
+@@ -1644,6 +1647,25 @@ skip_fb:
"at offset 0x%X\n",
(uint32_t)(pNv->FB->size >> 20), (uint32_t) pNv->FB->offset);
@@ -503,8 +545,9 @@ index 9f4c96f..a280257 100644
+ scanout_size *= (pScrn->bitsPerPixel >> 3);
+ scanout_size *= pScrn->virtualY;
+
-+ if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN,
-+ 0, scanout_size, &pNv->scanout)) {
++ if (nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_PIN |
++ NOUVEAU_BO_MAP, 0, scanout_size,
++ &pNv->scanout)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to allocate scanout buffer\n");
+ return FALSE;
@@ -512,10 +555,11 @@ index 9f4c96f..a280257 100644
+ } else {
+ nouveau_bo_ref(pNv->FB, &pNv->scanout);
+ }
-
++
/* We don't need to allocate cursors / lut here if we're using
* kernel modesetting
-@@ -1832,6 +1852,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
+ **/
+@@ -1716,6 +1738,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
}
nouveau_bo_ref(NULL, &pNv->FB);
@@ -523,7 +567,7 @@ index 9f4c96f..a280257 100644
nouveau_bo_ref(NULL, &pNv->GART);
nouveau_bo_ref(NULL, &pNv->Cursor);
nouveau_bo_ref(NULL, &pNv->Cursor2);
-@@ -2347,6 +2368,15 @@ NVSaveScreen(ScreenPtr pScreen, int mode)
+@@ -2247,6 +2270,15 @@ NVSaveScreen(ScreenPtr pScreen, int mode)
bool on = xf86IsUnblank(mode);
int i;
@@ -540,10 +584,10 @@ index 9f4c96f..a280257 100644
return vgaHWSaveScreen(pScreen, mode);
diff --git a/src/nv_proto.h b/src/nv_proto.h
-index 43fa62e..f06c757 100644
+index 3a1e1fe..5b82b09 100644
--- a/src/nv_proto.h
+++ b/src/nv_proto.h
-@@ -267,6 +267,10 @@ void nv50_xv_video_stop(ScrnInfoPtr, pointer, Bool);
+@@ -273,6 +273,10 @@ void nv50_xv_video_stop(ScrnInfoPtr, pointer, Bool);
int nv50_xv_port_attribute_set(ScrnInfoPtr, Atom, INT32, pointer);
int nv50_xv_port_attribute_get(ScrnInfoPtr, Atom, INT32 *, pointer);
@@ -587,10 +631,10 @@ index ea1ba35..e15051c 100644
+ nouveau_bo_unmap(pNv->scanout);
}
diff --git a/src/nv_type.h b/src/nv_type.h
-index 2ec4fba..5396cc8 100644
+index 61a148a..7d7ede9 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
-@@ -270,6 +270,7 @@ typedef struct _NVRec {
+@@ -170,6 +170,7 @@ typedef struct _NVRec {
/* Various pinned memory regions */
struct nouveau_bo * FB;
void * FBMap;
@@ -598,7 +642,7 @@ index 2ec4fba..5396cc8 100644
//struct nouveau_bo * FB_old; /* for KMS */
struct nouveau_bo * shadow[2]; /* for easy acces by exa */
struct nouveau_bo * Cursor;
-@@ -278,6 +279,9 @@ typedef struct _NVRec {
+@@ -178,6 +179,9 @@ typedef struct _NVRec {
struct nvbios VBIOS;
struct nouveau_bios_info *vbios;
@@ -609,5 +653,5 @@ index 2ec4fba..5396cc8 100644
Bool HWCursor;
Bool FpScale;
--
-1.6.2.2
+1.6.2.5
nouveau-store-vbios.patch:
Index: nouveau-store-vbios.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/nouveau-store-vbios.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- nouveau-store-vbios.patch 17 Apr 2009 02:30:00 -0000 1.3
+++ nouveau-store-vbios.patch 6 Jul 2009 00:12:24 -0000 1.4
@@ -1,14 +1,14 @@
-From 0a32a04139e0711a0aa2bb4c7885f24b3a963d0c Mon Sep 17 00:00:00 2001
+From 399e2942565702db044741e1b749105675d060fc Mon Sep 17 00:00:00 2001
From: Ben Skeggs <skeggsb at gmail.com>
Date: Mon, 13 Apr 2009 19:13:26 +1000
-Subject: [PATCH 2/6] bios/f11: store a copy of used vbios image in /var/run
+Subject: [PATCH 2/8] bios/f11: store a copy of used vbios image in /var/run
---
src/nv_bios.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/nv_bios.c b/src/nv_bios.c
-index ebf4027..ad4ff1f 100644
+index 182456a..ffd6b1f 100644
--- a/src/nv_bios.c
+++ b/src/nv_bios.c
@@ -22,6 +22,9 @@
@@ -21,7 +21,7 @@ index ebf4027..ad4ff1f 100644
#include "nv_include.h"
#if defined(__FreeBSD__) || defined(__NetBSD__)
-@@ -4492,7 +4495,10 @@ uint8_t * nouveau_bios_embedded_edid(ScrnInfoPtr pScrn)
+@@ -4672,7 +4675,10 @@ uint8_t * nouveau_bios_embedded_edid(ScrnInfoPtr pScrn)
bool NVInitVBIOS(ScrnInfoPtr pScrn)
{
@@ -32,7 +32,7 @@ index ebf4027..ad4ff1f 100644
memset(bios, 0, sizeof(struct nvbios));
-@@ -4503,6 +4509,13 @@ bool NVInitVBIOS(ScrnInfoPtr pScrn)
+@@ -4683,6 +4689,13 @@ bool NVInitVBIOS(ScrnInfoPtr pScrn)
if (bios->length > NV_PROM_SIZE)
bios->length = NV_PROM_SIZE;
nouveau-transition-hack.patch:
Index: nouveau-transition-hack.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/nouveau-transition-hack.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- nouveau-transition-hack.patch 17 Apr 2009 02:30:00 -0000 1.3
+++ nouveau-transition-hack.patch 6 Jul 2009 00:12:24 -0000 1.4
@@ -1,17 +1,17 @@
-From 48c76f574f059d7d98f18baf10e798d8bfd5b968 Mon Sep 17 00:00:00 2001
-From: Ben Skeggs <skeggsb at gmail.com>
-Date: Mon, 13 Apr 2009 19:12:25 +1000
-Subject: [PATCH 1/6] kms/f11: hack in transition support without driver pixmaps
+From b77c1b4e03bf5bac112d0cd2babaaecd6fed40f6 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs at redhat.com>
+Date: Tue, 30 Jun 2009 10:52:07 +1000
+Subject: [PATCH 2/5] f12: transitions
---
- src/drmmode_display.c | 144 ++++++++++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 142 insertions(+), 2 deletions(-)
+ src/drmmode_display.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 145 insertions(+), 2 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
-index aa8befe..4909e51 100644
+index 5e2b5f5..7f9b31d 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
-@@ -185,6 +185,139 @@ drmmode_fb_pixmap(ScrnInfoPtr pScrn, int id, int *w, int *h)
+@@ -171,6 +171,142 @@ drmmode_fb_pixmap(ScrnInfoPtr pScrn, int id, unsigned *w, unsigned *h)
}
static void
@@ -21,7 +21,7 @@ index aa8befe..4909e51 100644
+ drmModeFBPtr fb;
+ NVPtr pNv = NVPTR(pScrn);
+ char *dst = NULL, *src = NULL;
-+ struct drm_nouveau_gem_mmap req;
++ struct nouveau_bo *src_bo = NULL;
+ int ret, h;
+
+ /* This is not what this should look like. Until we can do driver
@@ -34,16 +34,17 @@ index aa8befe..4909e51 100644
+ return;
+ }
+
-+ req.handle = fb->handle;
-+ ret = drmCommandWriteRead(nouveau_device(pNv->dev)->fd,
-+ DRM_NOUVEAU_GEM_MMAP, &req, sizeof(req));
++ ret = nouveau_bo_wrap(pNv->dev, fb->handle, &src_bo);
++ if (ret == 0)
++ ret = nouveau_bo_map(src_bo, NOUVEAU_BO_RD);
+ if (ret) {
+ ErrorF("src bo map: %d\n", ret);
++ nouveau_bo_ref(NULL, &src_bo);
+ drmFree(fb);
+ return;
+ }
-+ src = (void *)req.vaddr;
-+
++ src = src_bo->map;
++
+ nouveau_bo_map(pNv->FB, NOUVEAU_BO_WR);
+ dst = pNv->FB->map;
+ dst += (y * fb->pitch) + (x * (fb->bpp >> 3));
@@ -56,6 +57,8 @@ index aa8befe..4909e51 100644
+ }
+
+ nouveau_bo_unmap(pNv->FB);
++ nouveau_bo_unmap(src_bo);
++ nouveau_bo_ref(NULL, &src_bo);
+ drmFree(fb);
+}
+
@@ -68,9 +71,17 @@ index aa8befe..4909e51 100644
+ struct nouveau_channel *chan = pNv->chan;
+ struct nouveau_grobj *eng2d = pNv->Nv2D;
+ struct nouveau_bo *src = NULL, *dst = NULL;
-+ struct drm_gem_flink req;
+ int ret;
+
++ uint32_t depth_to_gpu(int depth) {
++ switch (depth) {
++ case 16: return 0xe8;
++ case 30: return 0xd1;
++ default:
++ return 0xcf;
++ }
++ }
++
+ /* This is not what this should look like. Until we can do driver
+ * pixmaps, this will be a nasty hack!
+ */
@@ -81,27 +92,19 @@ index aa8befe..4909e51 100644
+ return;
+ }
+
-+ req.handle = fb->handle;
-+ ret = ioctl(nouveau_device(pNv->dev)->fd, DRM_IOCTL_GEM_FLINK, &req);
-+ if (ret) {
-+ ErrorF("name bo: %d\n", ret);
-+ drmFree(fb);
-+ return;
-+ }
-+
-+ ret = nouveau_bo_handle_ref(pNv->dev, req.name, &src);
++ ret = nouveau_bo_wrap(pNv->dev, fb->handle, &src);
+ if (ret) {
+ ErrorF("src bo: %d\n", ret);
+ drmFree(fb);
+ return;
+ }
+
-+ nouveau_bo_ref(pNv->scanout, &dst);
++ nouveau_bo_ref(pNv->FB, &dst);
+
+ BEGIN_RING(chan, eng2d, 0x02ac, 1);
+ OUT_RING (chan, 3);
+ BEGIN_RING(chan, eng2d, 0x0200, 2);
-+ OUT_RING (chan, pScrn->bitsPerPixel == 16 ? 0xe8 : 0xcf);
++ OUT_RING (chan, depth_to_gpu(pScrn->depth));
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, eng2d, 0x0214, 5);
+ OUT_RING (chan, pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
@@ -115,7 +118,7 @@ index aa8befe..4909e51 100644
+ OUT_RING (chan, pScrn->virtualX);
+ OUT_RING (chan, pScrn->virtualY);
+ BEGIN_RING(chan, eng2d, 0x0230, 2);
-+ OUT_RING (chan, fb->bpp == 16 ? 0xe8 : 0xcf);
++ OUT_RING (chan, depth_to_gpu(fb->depth));
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, eng2d, 0x0244, 5);
+ OUT_RING (chan, fb->pitch);
@@ -151,22 +154,22 @@ index aa8befe..4909e51 100644
drmmode_fb_copy(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id, int src_id,
int x, int y)
{
-@@ -194,6 +327,14 @@ drmmode_fb_copy(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id, int src_id,
- PixmapPtr pspix, pdpix;
- int w, h;
+@@ -183,6 +319,14 @@ drmmode_fb_copy(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int dst_id, int src_id,
+ if (!src_id || !dst_id)
+ return;
+ if (!pNv->exa_driver_pixmaps) {
-+ if (pNv->NoAccel)
++ if (pNv->NoAccel || pNv->Architecture < NV_ARCH_50)
+ drmmode_fb_copy_sw(pScrn, drmmode, dst_id, src_id, x, y);
+ else
+ drmmode_fb_copy_nv50(pScrn, drmmode, dst_id, src_id, x, y);
+ return;
+ }
+
- pspix = drmmode_fb_pixmap(pScrn, src_id, NULL, NULL);
+ pspix = drmmode_fb_pixmap(pScrn, src_id, &w, &h);
if (!pspix)
return;
-@@ -292,8 +433,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+@@ -281,8 +425,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
if (drmmode_crtc->rotate_fb_id)
fb_id = drmmode_crtc->rotate_fb_id;
else
@@ -177,5 +180,5 @@ index aa8befe..4909e51 100644
drmmode_crtc->mode_crtc->buffer_id, x, y);
}
--
-1.6.2.2
+1.6.2.5
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/sources,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -p -r1.35 -r1.36
--- sources 29 Jun 2009 00:11:59 -0000 1.35
+++ sources 6 Jul 2009 00:12:24 -0000 1.36
@@ -1 +1 @@
-b08879f18187c12d52101b3be964ce52 xf86-video-nouveau-0.0.14-20090625gitc0bf670.tar.bz2
+2e10f17f6e356996142d0e4724765490 xf86-video-nouveau-0.0.14-20090701git6d14327.tar.bz2
Index: xorg-x11-drv-nouveau.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-nouveau/devel/xorg-x11-drv-nouveau.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -p -r1.41 -r1.42
--- xorg-x11-drv-nouveau.spec 29 Jun 2009 00:11:59 -0000 1.41
+++ xorg-x11-drv-nouveau.spec 6 Jul 2009 00:12:24 -0000 1.42
@@ -7,8 +7,8 @@
# git clone git://git.freedesktop.org/git/nouveau/xf86-video-nouveau
# git-archive --format=tar --prefix=xf86-video-nouveau-0.0.10/ %{git_version} | bzip2 > xf86-video-nouveau-0.0.10-%{gitdate}.tar.bz2
-%define gitdate 20090625
-%define git_version c0bf670
+%define gitdate 20090701
+%define git_version 6d14327
%define snapshot %{gitdate}git%{git_version}
@@ -19,7 +19,7 @@ Name: xorg-x11-drv-nouveau
# need to set an epoch to get version number in sync with upstream
Epoch: 1
Version: %{nouveau_version}
-Release: 0.%{snapshot}%{?dist}
+Release: 1.%{snapshot}%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -43,6 +43,11 @@ Requires: kernel-drm-nouveau = 14
Patch0: nouveau-store-vbios.patch
Patch1: dcbconf_7_4_ignore.diff
+Patch2: nouveau-multiple-xserver.patch
+Patch3: nouveau-transition-hack.patch
+Patch4: nouveau-nv50-fb-accel.patch
+Patch5: nouveau-fb-resize.patch
+Patch6: nouveau-bicubic-2x.patch
%description
X.Org X11 nouveau video driver.
@@ -52,6 +57,11 @@ X.Org X11 nouveau video driver.
%patch0 -p1 -b .vbios
%patch1 -p1 -b .dcbconf
+%patch2 -p1 -b .multix
+%patch3 -p1 -b .transition
+%patch4 -p1 -b .nv50fb
+%patch5 -p1 -b .fbresize
+%patch6 -p1 -b .bicubic
%build
autoreconf -v --install
@@ -75,6 +85,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man4/nouveau.4*
%changelog
+* Mon Jul 7 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.14-1.20090701git6d14327
+- update from upstream + bring back additional features found in F11
+
* Fri Jun 26 2009 Ben Skeggs <bskeggs at redhat.com> 0.0.14-0.20090625gitc0bf670
- rebase onto latest upstream. missing some features that were patched into
F11, they'll come back soon.
- Previous message (by thread): rpms/lxmenu-data/F-10 lxmenu-data-0.1.1-menu.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 lxmenu-data.spec, 1.1, 1.2 sources, 1.2, 1.3 lxmenu-data-0.1-menu.patch, 1.1, NONE
- Next message (by thread): rpms/xorg-x11-drv-nouveau/devel nouveau-bicubic-2x.patch,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list