Module Name: xsrc
Committed By: mrg
Date: Sun Mar 9 22:23:47 UTC 2025
Modified Files:
xsrc/external/mit/xf86-video-nouveau/dist/src: compat-api.h
drmmode_display.c nouveau_xv.c nv_driver.c nv_include.h nv_proto.h
Log Message:
merge xf86-video-nouveau 1.0.18
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-video-nouveau/dist/src/compat-api.h
cvs rdiff -u -r1.12 -r1.13 \
xsrc/external/mit/xf86-video-nouveau/dist/src/drmmode_display.c
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xf86-video-nouveau/dist/src/nouveau_xv.c
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-nouveau/dist/src/nv_driver.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-nouveau/dist/src/nv_include.h
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/xf86-video-nouveau/dist/src/nv_proto.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-nouveau/dist/src/compat-api.h
diff -u xsrc/external/mit/xf86-video-nouveau/dist/src/compat-api.h:1.2 xsrc/external/mit/xf86-video-nouveau/dist/src/compat-api.h:1.3
--- xsrc/external/mit/xf86-video-nouveau/dist/src/compat-api.h:1.2 Fri Jul 15 04:13:16 2022
+++ xsrc/external/mit/xf86-video-nouveau/dist/src/compat-api.h Sun Mar 9 22:23:47 2025
@@ -28,44 +28,6 @@
#ifndef COMPAT_API_H
#define COMPAT_API_H
-#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
-#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
-#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
-#endif
-
-#ifndef XF86_HAS_SCRN_CONV
-#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
-#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
-#endif
-
-#ifndef XF86_SCRN_INTERFACE
-
-#define SCRN_ARG_TYPE int
-#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
-
-#define SCREEN_ARG_TYPE int
-#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
-
-#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
-
-#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
-#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
-
-#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
-#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
-
-#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
-
-#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
-
-#define FREE_SCREEN_ARGS_DECL int arg, int flags
-#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
-
-#define VT_FUNC_ARGS_DECL int arg, int flags
-#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
-
-#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
-#else
#define SCRN_ARG_TYPE ScrnInfoPtr
#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
@@ -102,10 +64,9 @@
#endif
-#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(25, 2)
-#define current_master current_primary
-#define master_pixmap primary_pixmap
-#define slave_dst secondary_dst
-#endif
-
+#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2)
+#define secondary_dst slave_dst
+#define secondary_list slave_list
+#define secondary_head slave_head
+#define is_output_secondary is_output_slave
#endif
Index: xsrc/external/mit/xf86-video-nouveau/dist/src/drmmode_display.c
diff -u xsrc/external/mit/xf86-video-nouveau/dist/src/drmmode_display.c:1.12 xsrc/external/mit/xf86-video-nouveau/dist/src/drmmode_display.c:1.13
--- xsrc/external/mit/xf86-video-nouveau/dist/src/drmmode_display.c:1.12 Tue Apr 27 01:22:55 2021
+++ xsrc/external/mit/xf86-video-nouveau/dist/src/drmmode_display.c Sun Mar 9 22:23:47 2025
@@ -119,7 +119,7 @@ drmmode_crtc(xf86CrtcPtr crtc)
}
Bool
-drmmode_crtc_on(xf86CrtcPtr crtc)
+xf86_crtc_on(xf86CrtcPtr crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -141,14 +141,6 @@ drmmode_swap(ScrnInfoPtr scrn, uint32_t
drmmode->fb_id = next;
}
-#if !HAVE_XORG_LIST
-#define xorg_list list
-#define xorg_list_for_each_entry list_for_each_entry
-#define xorg_list_for_each_entry_safe list_for_each_entry_safe
-#define xorg_list_append list_append
-#define xorg_list_del list_del
-#endif
-
struct drmmode_event {
struct xorg_list head;
drmmode_ptr drmmode;
@@ -347,99 +339,6 @@ drmmode_fbcon_copy(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
-#if XORG_VERSION_CURRENT >= 10999001
- ExaDriverPtr exa = pNv->EXADriverPtr;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- struct nouveau_bo *bo = NULL;
- PixmapPtr pspix, pdpix = NULL;
- drmModeFBPtr fb;
- unsigned w = pScrn->virtualX, h = pScrn->virtualY;
- int i, ret, fbcon_id = 0;
-
- if (pNv->AccelMethod != EXA)
- goto fallback;
-
- pdpix = drmmode_pixmap_wrap(pScreen, pScrn->virtualX,
- pScrn->virtualY, pScrn->depth,
- pScrn->bitsPerPixel, pScrn->displayWidth *
- pScrn->bitsPerPixel / 8, pNv->scanout,
- NULL);
- if (!pdpix) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to init scanout pixmap for fbcon mirror\n");
- goto fallback;
- }
-
- for (i = 0; i < xf86_config->num_crtc; i++) {
- drmmode_crtc_private_ptr drmmode_crtc =
- xf86_config->crtc[i]->driver_private;
-
- if (drmmode_crtc->mode_crtc->buffer_id)
- fbcon_id = drmmode_crtc->mode_crtc->buffer_id;
- }
-
- if (!fbcon_id)
- goto fallback;
-
- fb = drmModeGetFB(pNv->dev->fd, fbcon_id);
- if (!fb) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to retrieve fbcon fb: id %d\n", fbcon_id);
- goto fallback;
- }
-
- if (fb->depth != pScrn->depth || fb->width != w || fb->height != h) {
- drmFree(fb);
- goto fallback;
- }
-
- ret = nouveau_bo_wrap(pNv->dev, fb->handle, &bo);
- if (ret) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to retrieve fbcon buffer: handle=0x%08x\n",
- fb->handle);
- drmFree(fb);
- goto fallback;
- }
-
- pspix = drmmode_pixmap_wrap(pScreen, fb->width, fb->height,
- fb->depth, fb->bpp, fb->pitch, bo, NULL);
- nouveau_bo_ref(NULL, &bo);
- drmFree(fb);
- if (!pspix) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to create pixmap for fbcon contents\n");
- goto fallback;
- }
-
- exa->PrepareCopy(pspix, pdpix, 0, 0, GXcopy, ~0);
- exa->Copy(pdpix, 0, 0, 0, 0, w, h);
- exa->DoneCopy(pdpix);
- PUSH_KICK(pNv->pushbuf);
-
- /* wait for completion before continuing, avoids seeing a momentary
- * flash of "corruption" on occasion
- */
- nouveau_bo_wait(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client);
-
- pScreen->DestroyPixmap(pdpix);
- pScreen->DestroyPixmap(pspix);
- pScreen->canDoBGNoneRoot = TRUE;
- return;
-
-fallback:
- if (pdpix) {
- if (exa->PrepareSolid(pdpix, GXcopy, ~0, 0)) {
- exa->Solid(pdpix, 0, 0, w, h);
- exa->DoneSolid(pdpix);
- PUSH_KICK(pNv->pushbuf);
- nouveau_bo_wait(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client);
- pScreen->DestroyPixmap(pdpix);
- return;
- }
- pScreen->DestroyPixmap(pdpix);
- }
-#endif
if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR, pNv->client))
return;
memset(pNv->scanout->map, 0x00, pNv->scanout->size);
@@ -745,12 +644,6 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr c
if (max_height < iter->mode.VDisplay)
max_height = iter->mode.VDisplay;
}
-#if !defined(HAS_DIRTYTRACKING_ROTATION) && !defined(HAS_DIRTYTRACKING2)
- if (iter != crtc) {
- ErrorF("Cannot do multiple crtcs without X server dirty tracking 2 interface\n");
- return FALSE;
- }
-#endif
}
if (total_width != screenpix->drawable.width ||
@@ -768,12 +661,8 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr c
#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
PixmapStartDirtyTracking(&ppix->drawable, screenpix, 0, 0, this_x, 0, RR_Rotate_0);
-#elif defined(HAS_DIRTYTRACKING_ROTATION)
- PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0);
-#elif defined(HAS_DIRTYTRACKING2)
- PixmapStartDirtyTracking2(ppix, screenpix, 0, 0, this_x, 0);
#else
- PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
+ PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0);
#endif
return TRUE;
}
@@ -810,7 +699,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drm
if (crtc == NULL)
return 0;
- drmmode_crtc = xnfcalloc(sizeof(drmmode_crtc_private_rec), 1);
+ drmmode_crtc = XNFcallocarray(sizeof(drmmode_crtc_private_rec), 1);
drmmode_crtc->mode_crtc = drmModeGetCrtc(drmmode->fd,
mode_res->crtcs[num]);
drmmode_crtc->drmmode = drmmode;
@@ -968,7 +857,7 @@ drmmode_output_get_modes(xf86OutputPtr o
/* modes should already be available */
for (i = 0; i < koutput->count_modes; i++) {
- Mode = xnfalloc(sizeof(DisplayModeRec));
+ Mode = XNFalloc(sizeof(DisplayModeRec));
drmmode_ConvertFromKMode(output->scrn, &koutput->modes[i],
Mode);
@@ -1564,9 +1453,6 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn
screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch,
(pNv->AccelMethod > NONE || pNv->ShadowPtr) ?
pNv->ShadowPtr : pNv->scanout->map);
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 9
- scrn->pixmapPrivate.ptr = ppix->devPrivate.ptr;
-#endif
if (pNv->AccelMethod == EXA) {
pNv->EXADriverPtr->PrepareSolid(ppix, GXcopy, ~0, 0);
@@ -1617,7 +1503,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn,
unsigned int crtcs_needed = 0;
int crtcshift;
- drmmode = xnfcalloc(sizeof(*drmmode), 1);
+ drmmode = XNFcallocarray(sizeof(*drmmode), 1);
drmmode->fd = fd;
drmmode->fb_id = 0;
@@ -1867,11 +1753,7 @@ drmmode_udev_notify(int fd, int notify,
static bool has_randr(void)
{
-#if HAS_DIXREGISTERPRIVATEKEY
return dixPrivateKeyRegistered(rrPrivKey);
-#else
- return *rrPrivKey;
-#endif
}
static void
Index: xsrc/external/mit/xf86-video-nouveau/dist/src/nouveau_xv.c
diff -u xsrc/external/mit/xf86-video-nouveau/dist/src/nouveau_xv.c:1.4 xsrc/external/mit/xf86-video-nouveau/dist/src/nouveau_xv.c:1.5
--- xsrc/external/mit/xf86-video-nouveau/dist/src/nouveau_xv.c:1.4 Sun Mar 3 09:44:37 2019
+++ xsrc/external/mit/xf86-video-nouveau/dist/src/nouveau_xv.c Sun Mar 9 22:23:47 2025
@@ -204,44 +204,164 @@ static XF86ImageRec NVImages[NUM_IMAGES_
};
static void
-nouveau_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
+box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
{
- dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
- dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
- dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
- dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
+ dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
+ dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
+ if (dest->x1 >= dest->x2) {
+ dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
+ return;
+ }
+
+ dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
+ dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
+ if (dest->y1 >= dest->y2)
+ dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
+}
- if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2)
- dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
+static int
+box_area(BoxPtr box)
+{
+ return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
}
static void
-nouveau_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box)
+rr_crtc_box(RRCrtcPtr crtc, BoxPtr crtc_box)
{
- if (crtc->enabled) {
- crtc_box->x1 = crtc->x;
- crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
- crtc_box->y1 = crtc->y;
- crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
- } else
- crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
+ if (crtc->mode) {
+ crtc_box->x1 = crtc->x;
+ crtc_box->y1 = crtc->y;
+ switch (crtc->rotation) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ default:
+ crtc_box->x2 = crtc->x + crtc->mode->mode.width;
+ crtc_box->y2 = crtc->y + crtc->mode->mode.height;
+ break;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ crtc_box->x2 = crtc->x + crtc->mode->mode.height;
+ crtc_box->y2 = crtc->y + crtc->mode->mode.width;
+ break;
+ }
+ } else
+ crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
}
-static int
-nouveau_box_area(BoxPtr box)
+static Bool
+rr_crtc_on(RRCrtcPtr crtc, Bool crtc_is_xf86_hint)
{
- return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
+ if (!crtc) {
+ return FALSE;
+ }
+ if (crtc_is_xf86_hint && crtc->devPrivate) {
+ return xf86_crtc_on(crtc->devPrivate);
+ } else {
+ return !!crtc->mode;
+ }
+}
+
+/*
+ * Return the crtc covering 'box'. If two crtcs cover a portion of
+ * 'box', then prefer the crtc with greater coverage.
+ */
+static RRCrtcPtr
+rr_crtc_covering_box(ScreenPtr pScreen, BoxPtr box, Bool screen_is_xf86_hint)
+{
+ rrScrPrivPtr pScrPriv;
+ RRCrtcPtr crtc, best_crtc, primary_crtc;
+ int coverage, best_coverage;
+ int c;
+ BoxRec crtc_box, cover_box;
+ RROutputPtr primary_output;
+
+ best_crtc = NULL;
+ best_coverage = 0;
+ primary_crtc = NULL;
+ primary_output = NULL;
+
+ if (!dixPrivateKeyRegistered(rrPrivKey))
+ return NULL;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ if (!pScrPriv)
+ return NULL;
+
+ primary_output = RRFirstOutput(pScreen);
+ if (primary_output && primary_output->crtc)
+ primary_crtc = primary_output->crtc->devPrivate;
+
+ for (c = 0; c < pScrPriv->numCrtcs; c++) {
+ crtc = pScrPriv->crtcs[c];
+
+ /* If the CRTC is off, treat it as not covering */
+ if (!rr_crtc_on(crtc, screen_is_xf86_hint))
+ continue;
+
+ rr_crtc_box(crtc, &crtc_box);
+ box_intersect(&cover_box, &crtc_box, box);
+ coverage = box_area(&cover_box);
+ if (coverage > best_coverage ||
+ (crtc == primary_crtc && coverage == best_coverage)) {
+ best_crtc = crtc;
+ best_coverage = coverage;
+ }
+ }
+
+ return best_crtc;
+}
+
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
+static RRCrtcPtr
+rr_crtc_covering_box_on_secondary(ScreenPtr pScreen, BoxPtr box)
+{
+ if (!pScreen->isGPU) {
+ ScreenPtr secondary;
+ RRCrtcPtr crtc = NULL;
+
+ xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
+ if (!secondary->is_output_secondary)
+ continue;
+
+ crtc = rr_crtc_covering_box(secondary, box, FALSE);
+ if (crtc)
+ return crtc;
+ }
+ }
+
+ return NULL;
+}
+#endif
+
+RRCrtcPtr
+randr_crtc_covering_drawable(DrawablePtr pDraw)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ RRCrtcPtr crtc = NULL;
+ BoxRec box;
+
+ box.x1 = pDraw->x;
+ box.y1 = pDraw->y;
+ box.x2 = box.x1 + pDraw->width;
+ box.y2 = box.y1 + pDraw->height;
+
+ crtc = rr_crtc_covering_box(pScreen, &box, TRUE);
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
+ if (!crtc) {
+ crtc = rr_crtc_covering_box_on_secondary(pScreen, &box);
+ }
+#endif
+ return crtc;
}
xf86CrtcPtr
-nouveau_pick_best_crtc(ScrnInfoPtr pScrn, Bool consider_disabled,
+nouveau_pick_best_crtc(ScrnInfoPtr pScrn,
int x, int y, int w, int h)
{
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- int coverage, best_coverage, c;
- BoxRec box, crtc_box, cover_box;
- RROutputPtr primary_output = NULL;
- xf86CrtcPtr best_crtc = NULL, primary_crtc = NULL;
+ ScreenPtr pScreen = pScrn->pScreen;
+ RRCrtcPtr crtc = NULL;
+ BoxRec box;
if (!pScrn->vtSema)
return NULL;
@@ -250,51 +370,12 @@ nouveau_pick_best_crtc(ScrnInfoPtr pScrn
box.x2 = x + w;
box.y1 = y;
box.y2 = y + h;
- best_coverage = 0;
-
- /* Prefer the CRTC of the primary output */
-#ifdef HAS_DIXREGISTERPRIVATEKEY
- if (dixPrivateKeyRegistered(rrPrivKey))
-#endif
- {
- primary_output = RRFirstOutput(pScrn->pScreen);
- }
- if (primary_output && primary_output->crtc)
- primary_crtc = primary_output->crtc->devPrivate;
- /* first consider only enabled CRTCs */
- for (c = 0; c < xf86_config->num_crtc; c++) {
- xf86CrtcPtr crtc = xf86_config->crtc[c];
-
- if (!crtc->enabled)
- continue;
-
- nouveau_crtc_box(crtc, &crtc_box);
- nouveau_box_intersect(&cover_box, &crtc_box, &box);
- coverage = nouveau_box_area(&cover_box);
- if (coverage > best_coverage ||
- (coverage == best_coverage && crtc == primary_crtc)) {
- best_crtc = crtc;
- best_coverage = coverage;
- }
- }
- if (best_crtc || !consider_disabled)
- return best_crtc;
-
- /* if we found nothing, repeat the search including disabled CRTCs */
- for (c = 0; c < xf86_config->num_crtc; c++) {
- xf86CrtcPtr crtc = xf86_config->crtc[c];
-
- nouveau_crtc_box(crtc, &crtc_box);
- nouveau_box_intersect(&cover_box, &crtc_box, &box);
- coverage = nouveau_box_area(&cover_box);
- if (coverage > best_coverage ||
- (coverage == best_coverage && crtc == primary_crtc)) {
- best_crtc = crtc;
- best_coverage = coverage;
- }
+ crtc = rr_crtc_covering_box(pScreen, &box, TRUE);
+ if (crtc) {
+ return crtc->devPrivate;
}
- return best_crtc;
+ return NULL;
}
unsigned int
@@ -307,7 +388,7 @@ nv_window_belongs_to_crtc(ScrnInfoPtr pS
for (i = 0; i < xf86_config->num_crtc; i++) {
xf86CrtcPtr crtc = xf86_config->crtc[i];
- if (!drmmode_crtc_on(crtc))
+ if (!xf86_crtc_on(crtc))
continue;
if ((x < (crtc->x + crtc->mode.HDisplay)) &&
Index: xsrc/external/mit/xf86-video-nouveau/dist/src/nv_driver.c
diff -u xsrc/external/mit/xf86-video-nouveau/dist/src/nv_driver.c:1.5 xsrc/external/mit/xf86-video-nouveau/dist/src/nv_driver.c:1.6
--- xsrc/external/mit/xf86-video-nouveau/dist/src/nv_driver.c:1.5 Mon Aug 1 22:19:41 2022
+++ xsrc/external/mit/xf86-video-nouveau/dist/src/nv_driver.c Sun Mar 9 22:23:47 2025
@@ -37,11 +37,6 @@
#include "nouveau_present.h"
#include "nouveau_sync.h"
-#if !HAVE_XORG_LIST
-#define xorg_list_is_empty list_is_empty
-#define xorg_list_for_each_entry list_for_each_entry
-#endif
-
/*
* Forward definitions for the functions that make up the driver.
*/
@@ -241,10 +236,8 @@ NVDriverFunc(ScrnInfoPtr scrn, xorgDrive
flag = (CARD32 *)data;
(*flag) = 0;
return TRUE;
-#if XORG_VERSION_CURRENT > XORG_VERSION_NUMERIC(1,15,99,0,0)
case SUPPORTS_SERVER_FDS:
return TRUE;
-#endif
default:
return FALSE;
}
@@ -277,7 +270,7 @@ NVInitScrn(ScrnInfoPtr pScrn, struct xf8
pPriv = xf86GetEntityPrivate(entity_num,
NVEntityIndex);
if (!pPriv->ptr) {
- pPriv->ptr = xnfcalloc(sizeof(NVEntRec), 1);
+ pPriv->ptr = XNFcallocarray(sizeof(NVEntRec), 1);
pNVEnt = pPriv->ptr;
pNVEnt->platform_dev = platform_dev;
}
@@ -309,15 +302,9 @@ NVOpenNouveauDevice(struct pci_device *p
else
#endif
{
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0)
XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d",
pci_dev->domain, pci_dev->bus,
pci_dev->dev, pci_dev->func);
-#else
- busid = XNFprintf("pci:%04x:%02x:%02x.%d",
- pci_dev->domain, pci_dev->bus,
- pci_dev->dev, pci_dev->func);
-#endif
}
#if defined(ODEV_ATTRIB_FD)
@@ -559,16 +546,12 @@ redisplay_dirty(ScreenPtr screen, Pixmap
{
RegionRec pixregion;
- PixmapRegionInit(&pixregion, dirty->slave_dst);
+ PixmapRegionInit(&pixregion, dirty->secondary_dst);
- DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
-#ifdef HAS_DIRTYTRACKING_ROTATION
+ DamageRegionAppend(&dirty->secondary_dst->drawable, &pixregion);
PixmapSyncDirtyHelper(dirty);
-#else
- PixmapSyncDirtyHelper(dirty, &pixregion);
-#endif
- DamageRegionProcessPending(&dirty->slave_dst->drawable);
+ DamageRegionProcessPending(&dirty->secondary_dst->drawable);
RegionUninit(&pixregion);
}
@@ -880,7 +863,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
/* Allocate the NVRec driverPrivate */
- if (!(pScrn->driverPrivate = xnfcalloc(1, sizeof(NVRec))))
+ if (!(pScrn->driverPrivate = XNFcallocarray(1, sizeof(NVRec))))
return FALSE;
pNv = NVPTR(pScrn);
Index: xsrc/external/mit/xf86-video-nouveau/dist/src/nv_include.h
diff -u xsrc/external/mit/xf86-video-nouveau/dist/src/nv_include.h:1.3 xsrc/external/mit/xf86-video-nouveau/dist/src/nv_include.h:1.4
--- xsrc/external/mit/xf86-video-nouveau/dist/src/nv_include.h:1.3 Thu Jan 31 19:52:31 2019
+++ xsrc/external/mit/xf86-video-nouveau/dist/src/nv_include.h Sun Mar 9 22:23:47 2025
@@ -72,6 +72,5 @@
#include "nv_type.h"
#include "nv_proto.h"
#include "nv_dma.h"
-#include "sarea.h"
#endif /* __NV_INCLUDE_H__ */
Index: xsrc/external/mit/xf86-video-nouveau/dist/src/nv_proto.h
diff -u xsrc/external/mit/xf86-video-nouveau/dist/src/nv_proto.h:1.7 xsrc/external/mit/xf86-video-nouveau/dist/src/nv_proto.h:1.8
--- xsrc/external/mit/xf86-video-nouveau/dist/src/nv_proto.h:1.7 Sun Mar 3 09:44:37 2019
+++ xsrc/external/mit/xf86-video-nouveau/dist/src/nv_proto.h Sun Mar 9 22:23:47 2025
@@ -13,7 +13,7 @@ void drmmode_screen_init(ScreenPtr pScre
void drmmode_screen_fini(ScreenPtr pScreen);
int drmmode_crtc(xf86CrtcPtr crtc);
-Bool drmmode_crtc_on(xf86CrtcPtr crtc);
+Bool xf86_crtc_on(xf86CrtcPtr crtc);
int drmmode_head(xf86CrtcPtr crtc);
void drmmode_swap(ScrnInfoPtr, uint32_t, uint32_t *);
@@ -45,8 +45,9 @@ void NVTakedownVideo(ScrnInfoPtr);
void NVSetPortDefaults (ScrnInfoPtr pScrn, NVPortPrivPtr pPriv);
void NVXVComputeBicubicFilter(struct nouveau_bo *, unsigned, unsigned);
unsigned int nv_window_belongs_to_crtc(ScrnInfoPtr, int, int, int, int);
-xf86CrtcPtr nouveau_pick_best_crtc(ScrnInfoPtr pScrn, Bool consider_disabled,
+xf86CrtcPtr nouveau_pick_best_crtc(ScrnInfoPtr pScrn,
int x, int y, int w, int h);
+RRCrtcPtr randr_crtc_covering_drawable(DrawablePtr pDraw);
/* in nouveau_exa.c */
Bool nouveau_exa_init(ScreenPtr pScreen);
@@ -229,5 +230,15 @@ extern void exaMoveInPixmap(PixmapPtr pP
extern Bool wfbPictureInit(ScreenPtr, PictFormatPtr, int);
+extern Bool wfbScreenInit(ScreenPtr pScreen,
+ void *pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap);
+
#endif /* __NV_PROTO_H__ */