summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-02 14:04:59 +0100
committerDave Airlie <airlied@redhat.com>2012-05-02 14:04:59 +0100
commitf83f5a5129f4a5822bb7bb862b43d62792d22290 (patch)
treedf42e67407b5086e071948fbe7a9d82f5dad20a4
parent174f17072005971fee6e4eb76a273c3cc1aa10d3 (diff)
nouveau: part 1 of port to new ABI
-rw-r--r--src/drmmode_display.c12
-rw-r--r--src/nouveau_dri2.c20
-rw-r--r--src/nouveau_exa.c14
-rw-r--r--src/nouveau_xv.c16
-rw-r--r--src/nv04_exa.c14
-rw-r--r--src/nv10_exa.c8
-rw-r--r--src/nv30_exa.c6
-rw-r--r--src/nv40_exa.c6
-rw-r--r--src/nv50_accel.c2
-rw-r--r--src/nv50_exa.c2
-rw-r--r--src/nv_accel_common.c2
-rw-r--r--src/nv_driver.c4
-rw-r--r--src/nvc0_exa.c2
-rw-r--r--src/vl_hwmc.c4
14 files changed, 56 insertions, 56 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 23e8232..73f1e25 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -117,7 +117,7 @@ static PixmapPtr
drmmode_pixmap_wrap(ScreenPtr pScreen, int width, int height, int depth,
int bpp, int pitch, struct nouveau_bo *bo, void *data)
{
- NVPtr pNv = NVPTR(xf86Screens[pScreen->myNum]);
+ NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
PixmapPtr ppix;
if (!pNv->NoAccel)
@@ -201,7 +201,7 @@ drmmode_crtc_dpms(xf86CrtcPtr drmmode_crtc, int mode)
void
drmmode_fbcon_copy(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
#if XORG_VERSION_CURRENT >= 10999001
ExaDriverPtr exa = pNv->EXADriverPtr;
@@ -1241,7 +1241,7 @@ drmmode_remove_fb(ScrnInfoPtr pScrn)
int
drmmode_cursor_init(ScreenPtr pScreen)
{
- NVPtr pNv = NVPTR(xf86Screens[pScreen->myNum]);
+ NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
int size = nv_cursor_width(pNv);
int flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 |
@@ -1255,7 +1255,7 @@ Bool
drmmode_page_flip(DrawablePtr draw, PixmapPtr back, void *priv,
unsigned int ref_crtc_hw_id)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
drmmode_crtc_private_ptr crtc = config->crtc[0]->driver_private;
drmmode_ptr mode = crtc->drmmode;
@@ -1455,7 +1455,7 @@ drmmode_wakeup_handler(pointer data, int err, pointer p)
void
drmmode_screen_init(ScreenPtr pScreen)
{
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
drmmode_ptr drmmode = drmmode_from_scrn(scrn);
drmmode_uevent_init(scrn);
@@ -1477,7 +1477,7 @@ drmmode_screen_init(ScreenPtr pScreen)
void
drmmode_screen_fini(ScreenPtr pScreen)
{
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
drmmode_uevent_fini(scrn);
}
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 73f2fc1..f17e788 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -26,7 +26,7 @@ nouveau_dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment,
unsigned int format)
{
ScreenPtr pScreen = pDraw->pScreen;
- NVPtr pNv = NVPTR(xf86Screens[pScreen->myNum]);
+ NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
struct nouveau_dri2_buffer *nvbuf;
struct nouveau_pixmap *nvpix;
PixmapPtr ppix;
@@ -180,7 +180,7 @@ update_front(DrawablePtr draw, DRI2BufferPtr front)
static Bool
can_exchange(DrawablePtr draw, PixmapPtr dst_pix, PixmapPtr src_pix)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
NVPtr pNv = NVPTR(scrn);
int i;
@@ -202,7 +202,7 @@ can_exchange(DrawablePtr draw, PixmapPtr dst_pix, PixmapPtr src_pix)
static Bool
can_sync_to_vblank(DrawablePtr draw)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
NVPtr pNv = NVPTR(scrn);
return pNv->glx_vblank &&
@@ -214,7 +214,7 @@ static int
nouveau_wait_vblank(DrawablePtr draw, int type, CARD64 msc,
CARD64 *pmsc, CARD64 *pust, void *data)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
NVPtr pNv = NVPTR(scrn);
int crtcs = nv_window_belongs_to_crtc(scrn, draw->x, draw->y,
draw->width, draw->height);
@@ -244,7 +244,7 @@ nouveau_wait_vblank(DrawablePtr draw, int type, CARD64 msc,
static Bool
nouveau_dri2_swap_limit_validate(DrawablePtr draw, int swap_limit)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
NVPtr pNv = NVPTR(scrn);
if ((swap_limit < 1 ) || (swap_limit > pNv->max_swap_limit))
@@ -260,7 +260,7 @@ nouveau_dri2_swap_limit_validate(DrawablePtr draw, int swap_limit)
*/
static Bool violate_oml(DrawablePtr draw)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
NVPtr pNv = NVPTR(scrn);
return (DRI2INFOREC_VERSION < 6) && (pNv->swap_limit > 1);
@@ -271,7 +271,7 @@ nouveau_dri2_finish_swap(DrawablePtr draw, unsigned int frame,
unsigned int tv_sec, unsigned int tv_usec,
struct nouveau_dri2_vblank_state *s)
{
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
NVPtr pNv = NVPTR(scrn);
PixmapPtr dst_pix;
PixmapPtr src_pix = nouveau_dri2_buffer(s->src)->ppix;
@@ -579,7 +579,7 @@ nouveau_dri2_vblank_handler(int fd, unsigned int frame,
nouveau_dri2_finish_swap(draw, frame, tv_sec, tv_usec, s);
#if DRI2INFOREC_VERSION >= 6
/* Restore real swap limit on drawable, now that it is safe. */
- ScrnInfoPtr scrn = xf86Screens[draw->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(draw->pScreen);
DRI2SwapLimit(draw, NVPTR(scrn)->swap_limit);
#endif
@@ -617,7 +617,7 @@ nouveau_dri2_flip_event_handler(unsigned int frame, unsigned int tv_sec,
}
screen = draw->pScreen;
- scrn = xf86Screens[screen->myNum];
+ scrn = xf86ScreenToScrn(screen);
pixmap = screen->GetScreenPixmap(screen);
xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, 4,
@@ -663,7 +663,7 @@ nouveau_dri2_flip_event_handler(unsigned int frame, unsigned int tv_sec,
Bool
nouveau_dri2_init(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
DRI2InfoRec dri2 = { 0 };
const char *drivernames[2][2] = {
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index 9aaa3f2..7b3b086 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -83,7 +83,7 @@ static Bool
nouveau_exa_prepare_access(PixmapPtr ppix, int index)
{
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
- NVPtr pNv = NVPTR(xf86Screens[ppix->drawable.pScreen->myNum]);
+ NVPtr pNv = NVPTR(xf86ScreenToScrn(ppix->drawable.pScreen));
if (nv50_style_tiled_pixmap(ppix) && !pNv->wfb_enabled)
return FALSE;
@@ -108,7 +108,7 @@ static void *
nouveau_exa_create_pixmap(ScreenPtr pScreen, int width, int height, int depth,
int usage_hint, int bitsPerPixel, int *new_pitch)
{
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(scrn);
struct nouveau_pixmap *nvpix;
int ret;
@@ -148,7 +148,7 @@ nouveau_exa_destroy_pixmap(ScreenPtr pScreen, void *priv)
bool
nv50_style_tiled_pixmap(PixmapPtr ppix)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
return pNv->Architecture >= NV_ARCH_50 &&
@@ -159,7 +159,7 @@ static Bool
nouveau_exa_download_from_screen(PixmapPtr pspix, int x, int y, int w, int h,
char *dst, int dst_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pspix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pspix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_bo *bo;
int src_pitch, tmp_pitch, cpp, offset;
@@ -219,7 +219,7 @@ static Bool
nouveau_exa_upload_to_screen(PixmapPtr pdpix, int x, int y, int w, int h,
char *src, int src_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pdpix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdpix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
int dst_pitch, tmp_pitch, cpp;
int max_lines, lines, i;
@@ -306,7 +306,7 @@ memcpy:
Bool
nouveau_exa_pixmap_is_onscreen(PixmapPtr ppix)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
if (pScrn->pScreen->GetScreenPixmap(pScrn->pScreen) == ppix)
return TRUE;
@@ -317,7 +317,7 @@ nouveau_exa_pixmap_is_onscreen(PixmapPtr ppix)
Bool
nouveau_exa_init(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
ExaDriverPtr exa;
diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
index aea6c39..11248e6 100644
--- a/src/nouveau_xv.c
+++ b/src/nouveau_xv.c
@@ -1540,7 +1540,7 @@ NVDisplaySurface(XF86SurfacePtr surface,
static XF86VideoAdaptorPtr
NVSetupBlitVideo (ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
XF86VideoAdaptorPtr adapt;
NVPortPrivPtr pPriv;
@@ -1609,7 +1609,7 @@ NVSetupBlitVideo (ScreenPtr pScreen)
static XF86VideoAdaptorPtr
NVSetupOverlayVideoAdapter(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
XF86VideoAdaptorPtr adapt;
NVPortPrivPtr pPriv;
@@ -1759,7 +1759,7 @@ NVChipsetHasOverlay(NVPtr pNv)
static XF86VideoAdaptorPtr
NVSetupOverlayVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
XF86VideoAdaptorPtr overlayAdaptor = NULL;
NVPtr pNv = NVPTR(pScrn);
@@ -1804,7 +1804,7 @@ static XF86ImageRec NV30TexturedImages[NUM_FORMAT_TEXTURED] =
static XF86VideoAdaptorPtr
NV30SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
XF86VideoAdaptorPtr adapt;
NVPortPrivPtr pPriv;
@@ -1885,7 +1885,7 @@ static XF86ImageRec NV40TexturedImages[NUM_FORMAT_TEXTURED] =
static XF86VideoAdaptorPtr
NV40SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
XF86VideoAdaptorPtr adapt;
NVPortPrivPtr pPriv;
@@ -1957,7 +1957,7 @@ NV50TexturedImages[] =
static XF86VideoAdaptorPtr
NV50SetupTexturedVideo (ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
XF86VideoAdaptorPtr adapt;
NVPortPrivPtr pPriv;
@@ -2015,7 +2015,7 @@ NV50SetupTexturedVideo (ScreenPtr pScreen)
void
NVSetupTexturedVideo (ScreenPtr pScreen, XF86VideoAdaptorPtr *textureAdaptor)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
if (!pNv->Nv3D)
@@ -2046,7 +2046,7 @@ NVSetupTexturedVideo (ScreenPtr pScreen, XF86VideoAdaptorPtr *textureAdaptor)
void
NVInitVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr overlayAdaptor = NULL;
diff --git a/src/nv04_exa.c b/src/nv04_exa.c
index 77bb3b7..7ede9d9 100644
--- a/src/nv04_exa.c
+++ b/src/nv04_exa.c
@@ -45,7 +45,7 @@ NV04EXASetPattern(NVPtr pNv, CARD32 clr0, CARD32 clr1, CARD32 pat0, CARD32 pat1)
static Bool
NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
@@ -86,7 +86,7 @@ NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask)
Bool
NV04EXAPrepareSolid(PixmapPtr ppix, int alu, Pixel planemask, Pixel fg)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
@@ -140,7 +140,7 @@ NV04EXAPrepareSolid(PixmapPtr ppix, int alu, Pixel planemask, Pixel fg)
void
NV04EXASolid (PixmapPtr pPixmap, int x, int y, int x2, int y2)
{
- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int w = x2 - x;
@@ -161,7 +161,7 @@ NV04EXASolid (PixmapPtr pPixmap, int x, int y, int x2, int y2)
void
NV04EXADoneSolid (PixmapPtr pPixmap)
{
- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
@@ -169,7 +169,7 @@ Bool
NV04EXAPrepareCopy(PixmapPtr pspix, PixmapPtr pdpix, int dx, int dy,
int alu, Pixel planemask)
{
- ScrnInfoPtr pScrn = xf86Screens[pspix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pspix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
struct nouveau_bo *src_bo = nouveau_pixmap_bo(pspix);
@@ -214,7 +214,7 @@ void
NV04EXACopy(PixmapPtr pdpix, int srcX, int srcY, int dstX, int dstY,
int width, int height)
{
- ScrnInfoPtr pScrn = xf86Screens[pdpix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdpix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int split_dstY = NOUVEAU_ALIGN(dstY + 1, 64);
@@ -270,7 +270,7 @@ NV04EXACopy(PixmapPtr pdpix, int srcX, int srcY, int dstX, int dstY,
void
NV04EXADoneCopy(PixmapPtr pdpix)
{
- ScrnInfoPtr pScrn = xf86Screens[pdpix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdpix->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
diff --git a/src/nv10_exa.c b/src/nv10_exa.c
index 2da8cf6..a3f7df3 100644
--- a/src/nv10_exa.c
+++ b/src/nv10_exa.c
@@ -337,7 +337,7 @@ print_fallback_info(char *reason, int op, PicturePtr src, PicturePtr mask,
Bool
NV10EXACheckComposite(int op, PicturePtr src, PicturePtr mask, PicturePtr dst)
{
- ScrnInfoPtr pScrn = xf86Screens[dst->pDrawable->pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(dst->pDrawable->pScreen);
NVPtr pNv = NVPTR(pScrn);
if (!check_pict_op(op)) {
@@ -545,7 +545,7 @@ NV10EXAPrepareComposite(int op,
PixmapPtr mask,
PixmapPtr dst)
{
- ScrnInfoPtr pScrn = xf86Screens[dst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(dst->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
uint32_t sc, sa, mc, ma;
@@ -607,7 +607,7 @@ void
NV10EXAComposite(PixmapPtr pix_dst,
int sx, int sy, int mx, int my, int dx, int dy, int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pix_dst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pix_dst->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
@@ -627,7 +627,7 @@ NV10EXAComposite(PixmapPtr pix_dst,
void
NV10EXADoneComposite(PixmapPtr dst)
{
- ScrnInfoPtr pScrn = xf86Screens[dst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(dst->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
diff --git a/src/nv30_exa.c b/src/nv30_exa.c
index 57979c2..9be52e5 100644
--- a/src/nv30_exa.c
+++ b/src/nv30_exa.c
@@ -470,7 +470,7 @@ NV30EXAPrepareComposite(int op, PicturePtr psPict,
PixmapPtr pmPix,
PixmapPtr pdPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pdPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
nv_pict_op_t *blend = NV30_GetPictOpRec(op);
struct nouveau_pushbuf *push = pNv->pushbuf;
@@ -555,7 +555,7 @@ void
NV30EXAComposite(PixmapPtr pdPix,
int sx, int sy, int mx, int my, int dx, int dy, int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pdPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
@@ -582,7 +582,7 @@ NV30EXAComposite(PixmapPtr pdPix,
void
NV30EXADoneComposite(PixmapPtr pdPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pdPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
diff --git a/src/nv40_exa.c b/src/nv40_exa.c
index 2361552..ce0d78a 100644
--- a/src/nv40_exa.c
+++ b/src/nv40_exa.c
@@ -456,7 +456,7 @@ NV40EXAPrepareComposite(int op, PicturePtr psPict,
PixmapPtr pmPix,
PixmapPtr pdPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pdPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
nv_pict_op_t *blend = NV40_GetPictOpRec(op);
struct nouveau_pushbuf *push = pNv->pushbuf;
@@ -537,7 +537,7 @@ void
NV40EXAComposite(PixmapPtr pdPix,
int sx, int sy, int mx, int my, int dx, int dy, int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pdPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
@@ -564,7 +564,7 @@ NV40EXAComposite(PixmapPtr pdPix,
void
NV40EXADoneComposite(PixmapPtr pdPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pdPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pdPix->drawable.pScreen);
nouveau_pushbuf_bufctx(NVPTR(pScrn)->pushbuf, NULL);
}
diff --git a/src/nv50_accel.c b/src/nv50_accel.c
index e140db9..db7ad35 100644
--- a/src/nv50_accel.c
+++ b/src/nv50_accel.c
@@ -30,7 +30,7 @@
void
NV50SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int crtcs;
diff --git a/src/nv50_exa.c b/src/nv50_exa.c
index cd99e10..81244d3 100644
--- a/src/nv50_exa.c
+++ b/src/nv50_exa.c
@@ -27,7 +27,7 @@
#include "nv50_accel.h"
#define NV50EXA_LOCALS(p) \
- ScrnInfoPtr pScrn = xf86Screens[(p)->drawable.pScreen->myNum]; \
+ ScrnInfoPtr pScrn = xf86ScreenToScrn((p)->drawable.pScreen); \
NVPtr pNv = NVPTR(pScrn); \
struct nouveau_pushbuf *push = pNv->pushbuf; (void)push;
diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c
index 4516e97..7d56093 100644
--- a/src/nv_accel_common.c
+++ b/src/nv_accel_common.c
@@ -123,7 +123,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
void
NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen);
NVPtr pNv = NVPTR(pScrn);
struct nouveau_pushbuf *push = pNv->pushbuf;
int crtcs;
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 9f6d75f..98486f8 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -404,7 +404,7 @@ NVBlockHandler (
static Bool
NVCreateScreenResources(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
PixmapPtr ppix;
@@ -1061,7 +1061,7 @@ NVLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
static Bool
NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
NVPtr pNv = NVPTR(pScrn);
int ret;
VisualPtr visual;
diff --git a/src/nvc0_exa.c b/src/nvc0_exa.c
index c68b3fb..be367bc 100644
--- a/src/nvc0_exa.c
+++ b/src/nvc0_exa.c
@@ -28,7 +28,7 @@
#define NOUVEAU_BO(a, b, c) (NOUVEAU_BO_##a | NOUVEAU_BO_##b | NOUVEAU_BO_##c)
#define NVC0EXA_LOCALS(p) \
- ScrnInfoPtr pScrn = xf86Screens[(p)->drawable.pScreen->myNum]; \
+ ScrnInfoPtr pScrn = xf86ScreenToScrn((p)->drawable.pScreen); \
NVPtr pNv = NVPTR(pScrn); \
struct nouveau_pushbuf *push = pNv->pushbuf; (void)push;
diff --git a/src/vl_hwmc.c b/src/vl_hwmc.c
index 6e9e0c7..32eb258 100644
--- a/src/vl_hwmc.c
+++ b/src/vl_hwmc.c
@@ -114,7 +114,7 @@ XF86MCAdaptorPtr vlCreateAdaptorXvMC(ScreenPtr pScreen, char *xv_adaptor_name)
assert(pScreen);
assert(xv_adaptor_name);
- pScrn = xf86Screens[pScreen->myNum];
+ pScrn = xf86ScreenToScrn(pScreen);
adaptor = xf86XvMCCreateAdaptorRec();
if (!adaptor)
@@ -150,7 +150,7 @@ void vlInitXvMC(ScreenPtr pScreen, unsigned int num_adaptors, XF86MCAdaptorPtr *
for (i = 0; i < num_adaptors; ++i)
assert(adaptors[i]);
- pScrn = xf86Screens[pScreen->myNum];
+ pScrn = xf86ScreenToScrn(pScreen);
if (!xf86XvMCScreenInit(pScreen, num_adaptors, adaptors))
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] Failed to initialize extension.\n");