From e53e0dd0c535646534f0e7ef72fd9ef17fa798c9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:44:09 +0000 Subject: import xorg-x11-drv-nouveau-1.0.11-4.el7 --- diff --git a/SOURCES/nouveau-1.0.11-cleanup-reverse-prime-fb.patch b/SOURCES/nouveau-1.0.11-cleanup-reverse-prime-fb.patch new file mode 100644 index 0000000..e7d05ed --- /dev/null +++ b/SOURCES/nouveau-1.0.11-cleanup-reverse-prime-fb.patch @@ -0,0 +1,48 @@ +From d2e62df6e5d4f95d613c6862eb22d6e016fb9bed Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 3 Jun 2016 14:38:50 +0200 +Subject: [PATCH xf86-video-nouveau] Properly cleanup fb for + reverse-prime-offload + +drmmode_set_scanout_pixmap(pix) adds drmmod->fb_id through a call +to drmmode_xf86crtc_resize(), but on a subsequent +drmmode_set_scanout_pixmap(NULL) it would not remove the fb. + +This keeps the crtc marked as busy, which causes the dgpu to not +being able to runtime suspend, after an output attached to the dgpu +has been used once. Which causes burning through an additional 10W +of power and the laptop to run quite hot. + +This commit adds the missing remove fb call, allowing the dgpu to runtime +suspend after an external monitor has been plugged into the laptop. + +Signed-off-by: Hans de Goede +--- + src/drmmode_display.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/drmmode_display.c b/src/drmmode_display.c +index b950f42..f326e46 100644 +--- a/src/drmmode_display.c ++++ b/src/drmmode_display.c +@@ -680,10 +680,16 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) + PixmapPtr screenpix = screen->GetScreenPixmap(screen); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; ++ drmmode_ptr drmmode = drmmode_crtc->drmmode; + int c, total_width = 0, max_height = 0, this_x = 0; + if (!ppix) { +- if (crtc->randr_crtc->scanout_pixmap) ++ if (crtc->randr_crtc->scanout_pixmap) { + PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix); ++ if (drmmode && drmmode->fb_id) { ++ drmModeRmFB(drmmode->fd, drmmode->fb_id); ++ drmmode->fb_id = 0; ++ } ++ } + drmmode_crtc->scanout_pixmap_x = 0; + return TRUE; + } +-- +2.7.4 + diff --git a/SOURCES/nouveau-1.0.11-coverity.patch b/SOURCES/nouveau-1.0.11-coverity.patch new file mode 100644 index 0000000..adffde0 --- /dev/null +++ b/SOURCES/nouveau-1.0.11-coverity.patch @@ -0,0 +1,80 @@ +From bb57f9af9d179af0962456dca369953521ea8c2c Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Thu, 2 Jun 2016 10:17:58 +1000 +Subject: [PATCH] fix use of out-of-scope data + +Reported by Coverity. + +Signed-off-by: Ben Skeggs +--- + src/nouveau_copy.c | 38 +++++++++++++++++++++----------------- + 1 file changed, 21 insertions(+), 17 deletions(-) + +diff --git a/src/nouveau_copy.c b/src/nouveau_copy.c +index d0b868d..e152a53 100644 +--- a/src/nouveau_copy.c ++++ b/src/nouveau_copy.c +@@ -50,8 +50,7 @@ nouveau_copy_init(ScreenPtr pScreen) + }, *method = methods; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + NVPtr pNv = NVPTR(pScrn); +- void *data; +- int ret, size; ++ int ret; + + if (pNv->AccelMethod == NONE) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, +@@ -65,30 +64,35 @@ nouveau_copy_init(ScreenPtr pScreen) + pNv->dev->chipset == 0xaa || + pNv->dev->chipset == 0xac) + return FALSE; +- data = &(struct nv04_fifo) { +- .vram = NvDmaFB, +- .gart = NvDmaTT, +- }; +- size = sizeof(struct nv04_fifo); ++ ++ ret = nouveau_object_new(&pNv->dev->object, 0, ++ NOUVEAU_FIFO_CHANNEL_CLASS, ++ &(struct nv04_fifo) { ++ .vram = NvDmaFB, ++ .gart = NvDmaTT, ++ }, sizeof(struct nv04_fifo), ++ &pNv->ce_channel); + break; + case NV_FERMI: +- data = &(struct nvc0_fifo) {}; +- size = sizeof(struct nvc0_fifo); ++ ret = nouveau_object_new(&pNv->dev->object, 0, ++ NOUVEAU_FIFO_CHANNEL_CLASS, ++ &(struct nvc0_fifo) { ++ }, sizeof(struct nvc0_fifo), ++ &pNv->ce_channel); + break; + case NV_KEPLER: +- data = &(struct nve0_fifo) { +- .engine = NVE0_FIFO_ENGINE_CE0 | +- NVE0_FIFO_ENGINE_CE1, +- }; +- size = sizeof(struct nvc0_fifo); ++ ret = nouveau_object_new(&pNv->dev->object, 0, ++ NOUVEAU_FIFO_CHANNEL_CLASS, ++ &(struct nve0_fifo) { ++ .engine = NVE0_FIFO_ENGINE_CE0 | ++ NVE0_FIFO_ENGINE_CE1, ++ }, sizeof(struct nve0_fifo), ++ &pNv->ce_channel); + break; + default: + return FALSE; + } + +- ret = nouveau_object_new(&pNv->dev->object, 0, +- NOUVEAU_FIFO_CHANNEL_CLASS, data, size, +- &pNv->ce_channel); + if (ret) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[COPY] error allocating channel: %d\n", ret); +-- +2.8.4 + diff --git a/SPECS/xorg-x11-drv-nouveau.spec b/SPECS/xorg-x11-drv-nouveau.spec index 000acf5..95f519c 100644 --- a/SPECS/xorg-x11-drv-nouveau.spec +++ b/SPECS/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.11 -Release: 2%{?dist} +Release: 4%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X Hardware Support @@ -22,6 +22,8 @@ Source0: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-nouvea Source1: make-git-snapshot.sh Patch0: nouveau-1.0.11-no-glamor.patch +Patch1: nouveau-1.0.11-coverity.patch +Patch2: nouveau-1.0.11-cleanup-reverse-prime-fb.patch ExcludeArch: s390 s390x @@ -30,7 +32,7 @@ Obsoletes: xorg-x11-drv-nv < 2.1.20-3 %endif BuildRequires: libtool automake autoconf -BuildRequires: xorg-x11-server-devel >= xorg-x11-server-1.14.2-8 +BuildRequires: xorg-x11-server-devel >= 1.14.2-8 BuildRequires: libdrm-devel >= 2.4.24-0.1.20110106 BuildRequires: mesa-libGL-devel %if 0%{?fedora} > 17 || 0%{?rhel} > 6 @@ -56,6 +58,8 @@ X.Org X11 nouveau video driver. %prep %setup -q -n xf86-video-nouveau-%{dirsuffix} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build autoreconf -v --install @@ -79,6 +83,14 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man4/nouveau.4* %changelog +* Thu Aug 4 2016 Hans de Goede - 1.0.11-4 +- nouveau-1.0.11-cleanup-reverse-prime-fb: fix gpu not suspending after + using an external output in a switchable graphics setup +- Resolves: rhbz#1349821 + +* Thu Jun 9 2016 Ben Skeggs 1.0.11-3 +- nouveau-1.0.11-coverity.patch: fix use of out-of-scope data + * Thu Oct 1 2015 Ben Skeggs 1.0.11-2 - nouveau-1.0.11-no-glamor.patch: use modesetting driver instead