[xorg-x11-drv-nouveau/f18] update to latest upstream - fixes USB offload
Dave Airlie
airlied at fedoraproject.org
Wed Feb 6 06:02:12 UTC 2013
commit a3cb69e1d0bc7300fe14f4de0a309fbeaaf84e2d
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Feb 6 15:55:59 2013 +1000
update to latest upstream - fixes USB offload
0001-nouveau-add-reverse-prime-support.patch | 105 -----
nouveau-prime.patch | 553 --------------------------
upstream-fixes.patch | 179 +++++++++
xorg-x11-drv-nouveau.spec | 10 +-
4 files changed, 186 insertions(+), 661 deletions(-)
---
diff --git a/upstream-fixes.patch b/upstream-fixes.patch
new file mode 100644
index 0000000..31b5a26
--- /dev/null
+++ b/upstream-fixes.patch
@@ -0,0 +1,179 @@
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index 429e9cc..71c9ff9 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -42,6 +42,7 @@
+ #include "libudev.h"
+ #endif
+
++static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
+ typedef struct {
+ int fd;
+ uint32_t fb_id;
+@@ -345,7 +346,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
+ drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
+
+ fb_id = drmmode->fb_id;
+- if (drmmode_crtc->rotate_fb_id) {
++ if (crtc->randr_crtc->scanout_pixmap)
++ x = y = 0;
++ else if (drmmode_crtc->rotate_fb_id) {
+ fb_id = drmmode_crtc->rotate_fb_id;
+ x = 0;
+ y = 0;
+@@ -536,6 +539,34 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
+ }
+ }
+
++static Bool
++drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
++{
++ ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
++ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
++ PixmapPtr screenpix = screen->GetScreenPixmap(screen);
++
++ if (!ppix) {
++ if (crtc->randr_crtc->scanout_pixmap)
++ PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix);
++ return TRUE;
++ }
++
++ if (ppix->drawable.width > screenpix->drawable.width ||
++ ppix->drawable.height > screenpix->drawable.height) {
++ Bool ret;
++ ret = drmmode_xf86crtc_resize(crtc->scrn, ppix->drawable.width, ppix->drawable.height);
++ if (ret == FALSE)
++ return FALSE;
++
++ screenpix = screen->GetScreenPixmap(screen);
++ screen->width = screenpix->drawable.width = ppix->drawable.width;
++ screen->height = screenpix->drawable.height = ppix->drawable.height;
++ }
++ PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
++ return TRUE;
++}
++
+ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ .dpms = drmmode_crtc_dpms,
+ .set_mode_major = drmmode_set_mode_major,
+@@ -547,6 +578,8 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ .shadow_allocate = drmmode_crtc_shadow_allocate,
+ .shadow_destroy = drmmode_crtc_shadow_destroy,
+ .gamma_set = drmmode_gamma_set,
++
++ .set_scanout_pixmap = drmmode_set_scanout_pixmap,
+ };
+
+
+@@ -567,7 +600,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+ drmmode->mode_res->crtcs[num]);
+ drmmode_crtc->drmmode = drmmode;
+
+- ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP, 0,
++ ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
+ 64*64*4, NULL, &drmmode_crtc->cursor);
+ assert(ret == 0);
+
+diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
+index 036bcff..888e0b3 100644
+--- a/src/nouveau_dri2.c
++++ b/src/nouveau_dri2.c
+@@ -134,6 +134,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
+ {
+ struct nouveau_dri2_buffer *src = nouveau_dri2_buffer(pSrcBuffer);
+ struct nouveau_dri2_buffer *dst = nouveau_dri2_buffer(pDstBuffer);
++ NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
+ RegionPtr pCopyClip;
+ GCPtr pGC;
+ DrawablePtr src_draw, dst_draw;
+@@ -178,6 +179,22 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
+ }
+ pGC->funcs->ChangeClip(pGC, CT_REGION, pCopyClip, 0);
+ ValidateGC(dst_draw, pGC);
++
++ /* If this is a full buffer swap or frontbuffer flush, throttle on
++ * the previous one.
++ */
++ if (dst->base.attachment == DRI2BufferFrontLeft &&
++ REGION_NUM_RECTS(pRegion) == 1) {
++ BoxPtr extents = REGION_EXTENTS(pScreen, pRegion);
++ if (extents->x1 == 0 && extents->y1 == 0 &&
++ extents->x2 == pDraw->width &&
++ extents->y2 == pDraw->height) {
++ struct nouveau_bo *bo = nouveau_pixmap_bo((PixmapPtr)dst_draw);
++ if (bo)
++ nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client);
++ }
++ }
++
+ pGC->ops->CopyArea(src_draw, dst_draw, pGC, 0, 0,
+ pDraw->width, pDraw->height, off_x, off_y);
+
+diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
+index 8191aeb..b8e9bef 100644
+--- a/src/nouveau_exa.c
++++ b/src/nouveau_exa.c
+@@ -139,6 +139,9 @@ nouveau_exa_create_pixmap(ScreenPtr pScreen, int width, int height, int depth,
+ return NULL;
+ }
+
++ if ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED)
++ nvpix->shared = TRUE;
++
+ return nvpix;
+ }
+
+diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c
+index 57e52ff..09c14b3 100644
+--- a/src/nv_accel_common.c
++++ b/src/nv_accel_common.c
+@@ -35,10 +35,15 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
+ NVPtr pNv = NVPTR(scrn);
+ Bool scanout = (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT);
+ Bool tiled = (usage_hint & NOUVEAU_CREATE_PIXMAP_TILED);
++ Bool shared = ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED);
+ union nouveau_bo_config cfg = {};
+ int flags = NOUVEAU_BO_MAP | (bpp >= 8 ? NOUVEAU_BO_VRAM : 0);
+ int cpp = bpp / 8, ret;
+
++ flags = NOUVEAU_BO_MAP;
++ if (bpp >= 8)
++ flags |= shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM;
++
+ if (pNv->Architecture >= NV_ARCH_50) {
+ if (scanout) {
+ if (pNv->tiled_scanout) {
+@@ -48,9 +53,9 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
+ *pitch = NOUVEAU_ALIGN(width * cpp, 256);
+ }
+ } else {
+- if (bpp >= 8)
++ if (bpp >= 8 && !shared)
+ tiled = TRUE;
+- *pitch = NOUVEAU_ALIGN(width * cpp, 64);
++ *pitch = NOUVEAU_ALIGN(width * cpp, shared ? 256 : 64);
+ }
+ } else {
+ if (scanout && pNv->tiled_scanout)
+diff --git a/src/nv_driver.c b/src/nv_driver.c
+index f14c847..9f62fe2 100644
+--- a/src/nv_driver.c
++++ b/src/nv_driver.c
+@@ -452,7 +452,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
+ {
+ RegionRec pixregion;
+
+- PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
++ PixmapRegionInit(&pixregion, dirty->slave_dst);
+
+ DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+ PixmapSyncDirtyHelper(dirty, &pixregion);
+@@ -676,7 +676,7 @@ nouveau_setup_capabilities(ScrnInfoPtr pScrn)
+ if (value & DRM_PRIME_CAP_EXPORT)
+ pScrn->capabilities |= RR_Capability_SourceOutput;
+ if (value & DRM_PRIME_CAP_IMPORT)
+- pScrn->capabilities |= RR_Capability_SourceOffload;
++ pScrn->capabilities |= RR_Capability_SourceOffload | RR_Capability_SinkOutput;
+ }
+ #endif
+ }
diff --git a/xorg-x11-drv-nouveau.spec b/xorg-x11-drv-nouveau.spec
index 8731e1d..86dfd7f 100644
--- a/xorg-x11-drv-nouveau.spec
+++ b/xorg-x11-drv-nouveau.spec
@@ -8,7 +8,7 @@ Name: xorg-x11-drv-nouveau
# need to set an epoch to get version number in sync with upstream
Epoch: 1
Version: 1.0.6
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -21,7 +21,8 @@ Source0: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-nouvea
%endif
Source1: make-git-snapshot.sh
-Patch0: 0001-nouveau-add-reverse-prime-support.patch
+Patch0: upstream-fixes.patch
+
ExcludeArch: s390 s390x %{?rhel:ppc ppc64}
BuildRequires: libtool automake autoconf
@@ -50,7 +51,7 @@ X.Org X11 nouveau video driver.
%prep
%setup -q -n xf86-video-nouveau-%{dirsuffix}
-%patch0 -p1 -b .rp
+%patch0 -p1 -b .upstream
%build
autoreconf -v --install
@@ -74,6 +75,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man4/nouveau.4*
%changelog
+* Wed Feb 06 2013 Dave Airlie <airlied at redhat.com> 1.0.6-3
+- update to latest upstream - fixes USB offload
+
* Tue Jan 08 2013 Dave Airlie <airlied at redhat.com> 1.0.6-2
- Enable reverse prime support
More information about the scm-commits
mailing list