summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-16 15:26:55 +0100
committerDave Airlie <airlied@redhat.com>2012-05-23 11:02:20 +0100
commit43a34186d13d29c671431832469ca5301751b3cf (patch)
tree8ff14d5420c3ce91bc0322a4c21ab9d03fa95f3c
parent9aabc04d76fa976abb4a74f4e9676c7556e88df3 (diff)
intel: convert to new screen conversion APIs
The compat header takes care of the old server vs new server. this commit was autogenerated from util/modular/x-driver-screen-scrn-conv.sh Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/i830_render.c14
-rw-r--r--src/i915_render.c18
-rw-r--r--src/i965_render.c14
-rw-r--r--src/intel.h4
-rw-r--r--src/intel_batchbuffer.c2
-rw-r--r--src/intel_dri.c30
-rw-r--r--src/intel_driver.c6
-rw-r--r--src/intel_glamor.c16
-rw-r--r--src/intel_hwmc.c2
-rw-r--r--src/intel_uxa.c30
-rw-r--r--src/intel_video.c6
-rw-r--r--src/legacy/i810/i810_accel.c6
-rw-r--r--src/legacy/i810/i810_cursor.c6
-rw-r--r--src/legacy/i810/i810_dga.c2
-rw-r--r--src/legacy/i810/i810_dri.c18
-rw-r--r--src/legacy/i810/i810_driver.c6
-rw-r--r--src/legacy/i810/i810_hwmc.c2
-rw-r--r--src/legacy/i810/i810_video.c6
-rw-r--r--src/sna/sna.h2
-rw-r--r--src/sna/sna_dri.c4
-rw-r--r--src/sna/sna_driver.c4
-rw-r--r--uxa/uxa.c2
22 files changed, 100 insertions, 100 deletions
diff --git a/src/i830_render.c b/src/i830_render.c
index c12e87bf..e169cc11 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -164,7 +164,7 @@ static Bool i830_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
*dst_format = COLR_BUF_ARGB4444;
break;
default:
- scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
intel_debug_fallback(scrn, "Unsupported dest format 0x%x\n",
(int)dest_picture->format);
return FALSE;
@@ -245,7 +245,7 @@ static uint32_t i8xx_get_card_format(intel_screen_private *intel,
static void i830_texture_setup(PicturePtr picture, PixmapPtr pixmap, int unit)
{
- ScrnInfoPtr scrn = xf86Screens[picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(picture->pDrawable->pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
uint32_t format, tiling_bits, pitch, filter;
uint32_t wrap_mode;
@@ -346,7 +346,7 @@ i830_check_composite(int op,
PicturePtr dest_picture,
int width, int height)
{
- ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
uint32_t tmp1;
/* Check for unsupported compositing operations. */
@@ -399,7 +399,7 @@ i830_check_composite_target(PixmapPtr pixmap)
Bool
i830_check_composite_texture(ScreenPtr screen, PicturePtr picture)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (picture->repeatType > RepeatReflect) {
@@ -446,7 +446,7 @@ i830_prepare_composite(int op, PicturePtr source_picture,
PicturePtr mask_picture, PicturePtr dest_picture,
PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
@@ -665,7 +665,7 @@ i830_emit_composite_primitive(PixmapPtr dest,
int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
Bool is_affine_src, is_affine_mask = TRUE;
int per_vertex;
@@ -853,7 +853,7 @@ void
i830_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
intel_batch_start_atomic(scrn, 58 + /* invarient */
diff --git a/src/i915_render.c b/src/i915_render.c
index c6d5ed73..5605edff 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -172,7 +172,7 @@ static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
*dst_format = COLR_BUF_ARGB4444;
break;
default:
- scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
intel_debug_fallback(scrn,
"Unsupported dest format 0x%x\n",
(int)dest_picture->format);
@@ -189,7 +189,7 @@ i915_check_composite(int op,
PicturePtr dest_picture,
int width, int height)
{
- ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
uint32_t tmp1;
/* Check for unsupported compositing operations. */
@@ -243,7 +243,7 @@ Bool
i915_check_composite_texture(ScreenPtr screen, PicturePtr picture)
{
if (picture->repeatType > RepeatReflect) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn, "Unsupported picture repeat %d\n",
picture->repeatType);
return FALSE;
@@ -251,7 +251,7 @@ i915_check_composite_texture(ScreenPtr screen, PicturePtr picture)
if (picture->filter != PictFilterNearest &&
picture->filter != PictFilterBilinear) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
picture->filter);
return FALSE;
@@ -266,7 +266,7 @@ i915_check_composite_texture(ScreenPtr screen, PicturePtr picture)
w = picture->pDrawable->width;
h = picture->pDrawable->height;
if ((w > 2048) || (h > 2048)) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn,
"Picture w/h too large (%dx%d)\n",
w, h);
@@ -281,7 +281,7 @@ i915_check_composite_texture(ScreenPtr screen, PicturePtr picture)
}
if (i == sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]))
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn, "Unsupported picture format "
"0x%x\n",
(int)picture->format);
@@ -296,7 +296,7 @@ i915_check_composite_texture(ScreenPtr screen, PicturePtr picture)
static Bool i915_texture_setup(PicturePtr picture, PixmapPtr pixmap, int unit)
{
- ScrnInfoPtr scrn = xf86Screens[picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(picture->pDrawable->pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
uint32_t format, pitch, filter;
uint32_t wrap_mode, tiling_bits;
@@ -660,7 +660,7 @@ i915_prepare_composite(int op, PicturePtr source_picture,
PicturePtr mask_picture, PicturePtr dest_picture,
PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
@@ -951,7 +951,7 @@ void
i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
/* 28 + 16 + 10 + 20 + 32 + 16 */
diff --git a/src/i965_render.c b/src/i965_render.c
index b981eccb..98231b8b 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -181,7 +181,7 @@ i965_check_composite(int op,
PicturePtr dest_picture,
int width, int height)
{
- ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
/* Check for unsupported compositing operations. */
if (op >= sizeof(i965_blend_op) / sizeof(i965_blend_op[0])) {
@@ -219,7 +219,7 @@ Bool
i965_check_composite_texture(ScreenPtr screen, PicturePtr picture)
{
if (picture->repeatType > RepeatReflect) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn,
"extended repeat (%d) not supported\n",
picture->repeatType);
@@ -228,7 +228,7 @@ i965_check_composite_texture(ScreenPtr screen, PicturePtr picture)
if (picture->filter != PictFilterNearest &&
picture->filter != PictFilterBilinear) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
picture->filter);
return FALSE;
@@ -240,7 +240,7 @@ i965_check_composite_texture(ScreenPtr screen, PicturePtr picture)
w = picture->pDrawable->width;
h = picture->pDrawable->height;
if ((w > 8192) || (h > 8192)) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn,
"Picture w/h too large (%dx%d)\n",
w, h);
@@ -255,7 +255,7 @@ i965_check_composite_texture(ScreenPtr screen, PicturePtr picture)
}
if (i == sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]))
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_debug_fallback(scrn,
"Unsupported picture format "
"0x%x\n",
@@ -1978,7 +1978,7 @@ i965_prepare_composite(int op, PicturePtr source_picture,
PicturePtr mask_picture, PicturePtr dest_picture,
PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest_picture->pDrawable->pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
struct gen4_render_state *render_state = intel->gen4_render_state;
gen4_composite_op *composite_op = &render_state->composite_op;
@@ -2202,7 +2202,7 @@ void
i965_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
intel_batch_start_atomic(scrn, 200);
diff --git a/src/intel.h b/src/intel.h
index e274db10..253a6bf9 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -560,7 +560,7 @@ intel_check_pitch_2d(PixmapPtr pixmap)
{
uint32_t pitch = intel_pixmap_pitch(pixmap);
if (pitch > KB(32)) {
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_debug_fallback(scrn, "pitch exceeds 2d limit 32K\n");
return FALSE;
}
@@ -573,7 +573,7 @@ intel_check_pitch_3d(PixmapPtr pixmap)
{
uint32_t pitch = intel_pixmap_pitch(pixmap);
if (pitch > KB(8)) {
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_debug_fallback(scrn, "pitch exceeds 3d limit 8K\n");
return FALSE;
}
diff --git a/src/intel_batchbuffer.c b/src/intel_batchbuffer.c
index 2719c383..46f22bc3 100644
--- a/src/intel_batchbuffer.c
+++ b/src/intel_batchbuffer.c
@@ -246,7 +246,7 @@ void intel_batch_submit(ScrnInfoPtr scrn)
if (!once) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Detected a hung GPU, disabling acceleration.\n");
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "When reporting this, please include i915_error_state from debugfs and the full dmesg.\n");
- uxa_set_force_fallback(screenInfo.screens[scrn->scrnIndex], TRUE);
+ uxa_set_force_fallback(xf86ScrnToScreen(scrn), TRUE);
intel->force_fallback = TRUE;
once = 1;
}
diff --git a/src/intel_dri.c b/src/intel_dri.c
index a5ed5453..36e96ff5 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -97,7 +97,7 @@ static uint32_t pixmap_flink(PixmapPtr pixmap)
static PixmapPtr get_front_buffer(DrawablePtr drawable)
{
ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
PixmapPtr pixmap;
@@ -130,7 +130,7 @@ static PixmapPtr get_front_buffer(DrawablePtr drawable)
static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
{
ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
PixmapPtr old = get_drawable_pixmap(drawable);
struct intel_pixmap *priv = intel_get_pixmap_private(pixmap);
GCPtr gc;
@@ -182,7 +182,7 @@ static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
priv->stride,
NULL);
- intel_get_screen_private(xf86Screens[screen->myNum])->needs_flush = TRUE;
+ intel_get_screen_private(xf86ScreenToScrn(screen))->needs_flush = TRUE;
return old;
}
@@ -248,7 +248,7 @@ static PixmapPtr fixup_shadow(DrawablePtr drawable, PixmapPtr pixmap)
intel_set_pixmap_private(old, priv);
old->refcnt++;
- intel_get_screen_private(xf86Screens[screen->myNum])->needs_flush = TRUE;
+ intel_get_screen_private(xf86ScreenToScrn(screen))->needs_flush = TRUE;
return old;
}
@@ -258,7 +258,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
int count)
{
ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
DRI2BufferPtr buffers;
I830DRI2BufferPrivatePtr privates;
@@ -385,7 +385,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
unsigned int format)
{
ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
DRI2Buffer2Ptr buffer;
I830DRI2BufferPrivatePtr privates;
@@ -534,7 +534,7 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
I830DRI2BufferPrivatePtr srcPrivate = sourceBuffer->driverPrivate;
I830DRI2BufferPrivatePtr dstPrivate = destBuffer->driverPrivate;
ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
DrawablePtr src = (sourceBuffer->attachment == DRI2BufferFrontLeft)
? drawable : &srcPrivate->pixmap->drawable;
@@ -687,7 +687,7 @@ static int
I830DRI2DrawablePipe(DrawablePtr pDraw)
{
ScreenPtr pScreen = pDraw->pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
BoxRec box, crtcbox;
xf86CrtcPtr crtc;
int pipe = -1;
@@ -910,7 +910,7 @@ intel_glamor_create_back_pixmap(ScreenPtr screen,
0);
intel_set_pixmap_bo(back_pixmap, back_bo);
if (!intel_glamor_create_textured_pixmap(back_pixmap)) {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"Failed to create textured back pixmap.\n");
screen->DestroyPixmap(back_pixmap);
@@ -1026,7 +1026,7 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
static Bool
can_exchange(DrawablePtr drawable, DRI2BufferPtr front, DRI2BufferPtr back)
{
- struct intel_screen_private *intel = intel_get_screen_private(xf86Screens[drawable->pScreen->myNum]);
+ struct intel_screen_private *intel = intel_get_screen_private(xf86ScreenToScrn(drawable->pScreen));
I830DRI2BufferPrivatePtr front_priv = front->driverPrivate;
I830DRI2BufferPrivatePtr back_priv = back->driverPrivate;
PixmapPtr front_pixmap = front_priv->pixmap;
@@ -1244,7 +1244,7 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
CARD64 remainder, DRI2SwapEventPtr func, void *data)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
drmVBlank vbl;
int ret, pipe = I830DRI2DrawablePipe(draw), flip = 0;
@@ -1431,7 +1431,7 @@ static int
I830DRI2GetMSC(DrawablePtr draw, CARD64 *ust, CARD64 *msc)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
drmVBlank vbl;
int ret, pipe = I830DRI2DrawablePipe(draw);
@@ -1478,7 +1478,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
CARD64 divisor, CARD64 remainder)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
DRI2FrameEventPtr wait_info;
drmVBlank vbl;
@@ -1616,7 +1616,7 @@ static int dri2_server_generation;
Bool I830DRI2ScreenInit(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
DRI2InfoRec info;
int dri2_major = 1;
@@ -1701,7 +1701,7 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
void I830DRI2CloseScreen(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
DRI2CloseScreen(screen);
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 4265de82..d67d8c8e 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -217,7 +217,7 @@ I830LoadPalette(ScrnInfoPtr scrn, int numColors, int *indices,
*/
static Bool i830CreateScreenResources(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
screen->CreateScreenResources = intel->CreateScreenResources;
@@ -840,7 +840,7 @@ I830HandleUEvents(int fd, void *closure)
if (memcmp(&s.st_rdev, &udev_devnum, sizeof (dev_t)) == 0 &&
hotplug && atoi(hotplug) == 1)
- RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE);
+ RRGetInfo(xf86ScrnToScreen(scrn), TRUE);
udev_device_unref(dev);
}
@@ -919,7 +919,7 @@ I830UeventFini(ScrnInfoPtr scrn)
static Bool
I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
VisualPtr visual;
#ifdef INTEL_XVMC
diff --git a/src/intel_glamor.c b/src/intel_glamor.c
index a8681575..4741d58f 100644
--- a/src/intel_glamor.c
+++ b/src/intel_glamor.c
@@ -53,7 +53,7 @@ intel_glamor_exchange_buffers(struct intel_screen_private *intel,
Bool
intel_glamor_create_screen_resources(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (!(intel->uxa_flags & UXA_USE_GLAMOR))
@@ -104,7 +104,7 @@ PixmapPtr
intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
int depth, unsigned int usage)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (intel->uxa_flags & UXA_USE_GLAMOR)
@@ -116,7 +116,7 @@ intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
Bool
intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
struct intel_pixmap *priv;
@@ -136,7 +136,7 @@ intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
void
intel_glamor_destroy_pixmap(PixmapPtr pixmap)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private * intel;
intel = intel_get_screen_private(scrn);
@@ -147,7 +147,7 @@ intel_glamor_destroy_pixmap(PixmapPtr pixmap)
static void
intel_glamor_need_flush(DrawablePtr pDrawable)
{
- ScrnInfoPtr scrn = xf86Screens[pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pDrawable->pScreen);
intel_screen_private * intel;
intel = intel_get_screen_private(scrn);
@@ -175,7 +175,7 @@ intel_glamor_finish_access(PixmapPtr pixmap, uxa_access_t access)
Bool
intel_glamor_init(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0)
@@ -213,7 +213,7 @@ intel_glamor_flush(intel_screen_private * intel)
{
ScreenPtr screen;
- screen = screenInfo.screens[intel->scrn->scrnIndex];
+ screen = xf86ScrnToScreen(intel->scrn);
if (intel->uxa_flags & UXA_USE_GLAMOR)
glamor_block_handler(screen);
}
@@ -221,7 +221,7 @@ intel_glamor_flush(intel_screen_private * intel)
Bool
intel_glamor_close_screen(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (intel->uxa_flags & UXA_USE_GLAMOR)
diff --git a/src/intel_hwmc.c b/src/intel_hwmc.c
index d6267256..af8bd813 100644
--- a/src/intel_hwmc.c
+++ b/src/intel_hwmc.c
@@ -189,7 +189,7 @@ static XF86MCSurfaceInfoPtr surface_info_vld[] = {
/* check chip type and load xvmc driver */
Bool intel_xvmc_adaptor_init(ScreenPtr pScreen)
{
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
static XF86MCAdaptorRec *pAdapt;
char *name;
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 0b1a3696..383efc56 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -160,7 +160,7 @@ intel_uxa_pixmap_compute_size(PixmapPtr pixmap,
int *stride,
unsigned usage)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
int pitch, size;
@@ -241,7 +241,7 @@ intel_uxa_pixmap_compute_size(PixmapPtr pixmap,
static Bool
intel_uxa_check_solid(DrawablePtr drawable, int alu, Pixel planemask)
{
- ScrnInfoPtr scrn = xf86Screens[drawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(drawable->pScreen);
if (!UXA_PM_IS_SOLID(drawable, planemask)) {
intel_debug_fallback(scrn, "planemask is not solid\n");
@@ -266,7 +266,7 @@ intel_uxa_check_solid(DrawablePtr drawable, int alu, Pixel planemask)
static Bool
intel_uxa_prepare_solid(PixmapPtr pixmap, int alu, Pixel planemask, Pixel fg)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
@@ -299,7 +299,7 @@ intel_uxa_prepare_solid(PixmapPtr pixmap, int alu, Pixel planemask, Pixel fg)
static void intel_uxa_solid(PixmapPtr pixmap, int x1, int y1, int x2, int y2)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
unsigned long pitch;
uint32_t cmd;
@@ -353,7 +353,7 @@ static Bool
intel_uxa_check_copy(PixmapPtr source, PixmapPtr dest,
int alu, Pixel planemask)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
if (!UXA_PM_IS_SOLID(&source->drawable, planemask)) {
intel_debug_fallback(scrn, "planemask is not solid");
@@ -385,7 +385,7 @@ static Bool
intel_uxa_prepare_copy(PixmapPtr source, PixmapPtr dest, int xdir,
int ydir, int alu, Pixel planemask)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
@@ -417,7 +417,7 @@ static void
intel_uxa_copy(PixmapPtr dest, int src_x1, int src_y1, int dst_x1,
int dst_y1, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
uint32_t cmd;
int dst_x2, dst_y2, src_x2, src_y2;
@@ -501,7 +501,7 @@ intel_uxa_copy(PixmapPtr dest, int src_x1, int src_y1, int dst_x1,
static void intel_uxa_done(PixmapPtr pixmap)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (IS_GEN6(intel) || IS_GEN7(intel)) {
@@ -523,7 +523,7 @@ static void intel_uxa_done(PixmapPtr pixmap)
*/
static void i830_done_composite(PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(dest->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (intel->vertex_flush)
@@ -682,7 +682,7 @@ static Bool intel_uxa_pixmap_is_offscreen(PixmapPtr pixmap)
static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
{
- ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
intel_screen_private *intel = intel_get_screen_private(scrn);
struct intel_pixmap *priv = intel_get_pixmap_private(pixmap);
dri_bo *bo = priv->bo;
@@ -787,7 +787,7 @@ static Bool intel_uxa_put_image(PixmapPtr pixmap,
w == pixmap->drawable.width &&
h == pixmap->drawable.height)
{
- intel_screen_private *intel = intel_get_screen_private(xf86Screens[screen->myNum]);
+ intel_screen_private *intel = intel_get_screen_private(xf86ScreenToScrn(screen));
uint32_t tiling = priv->tiling;
int size, stride;
dri_bo *bo;
@@ -932,7 +932,7 @@ static Bool intel_uxa_get_image(PixmapPtr pixmap,
FreeScratchGC(gc);
- intel_batch_submit(xf86Screens[screen->myNum]);
+ intel_batch_submit(xf86ScreenToScrn(screen));
x = y = 0;
pixmap = scratch;
@@ -1008,7 +1008,7 @@ static PixmapPtr
intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
unsigned usage)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
struct intel_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
@@ -1146,7 +1146,7 @@ static Bool intel_uxa_destroy_pixmap(PixmapPtr pixmap)
Bool intel_uxa_create_screen_resources(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
dri_bo *bo = intel->front_buffer;
@@ -1230,7 +1230,7 @@ intel_limits_init(intel_screen_private *intel)
Bool intel_uxa_init(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
#if HAS_DIXREGISTERPRIVATEKEY
diff --git a/src/intel_video.c b/src/intel_video.c
index 0834bb23..83d1eabd 100644
--- a/src/intel_video.c
+++ b/src/intel_video.c
@@ -327,7 +327,7 @@ intel_overlay_put_image(intel_screen_private *intel,
void I830InitVideo(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL;
@@ -407,7 +407,7 @@ void I830InitVideo(ScreenPtr screen)
static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
XF86VideoAdaptorPtr adapt;
intel_adaptor_private *adaptor_priv;
@@ -516,7 +516,7 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
XF86VideoAdaptorPtr adapt;
intel_adaptor_private *adaptor_privs;
diff --git a/src/legacy/i810/i810_accel.c b/src/legacy/i810/i810_accel.c
index 6b57dbb1..7120b4ba 100644
--- a/src/legacy/i810/i810_accel.c
+++ b/src/legacy/i810/i810_accel.c
@@ -69,7 +69,7 @@ Bool
I810AccelInit(ScreenPtr pScreen)
{
XAAInfoRecPtr infoPtr;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
@@ -215,8 +215,8 @@ I810WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
ErrorF("space: %d wanted %d\n", ring->space, n);
#ifdef HAVE_DRI1
if (pI810->directRenderingEnabled) {
- DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
- DRICloseScreen(screenInfo.screens[pScrn->scrnIndex]);
+ DRIUnlock(xf86ScrnToScreen(pScrn));
+ DRICloseScreen(xf86ScrnToScreen(pScrn));
}
#endif
pI810->AccelInfoRec = NULL; /* Stops recursive behavior */
diff --git a/src/legacy/i810/i810_cursor.c b/src/legacy/i810/i810_cursor.c
index 88829cbd..580fe4b0 100644
--- a/src/legacy/i810/i810_cursor.c
+++ b/src/legacy/i810/i810_cursor.c
@@ -63,7 +63,7 @@ I810CursorInit(ScreenPtr pScreen)
I810Ptr pI810;
xf86CursorInfoPtr infoPtr;
- pScrn = xf86Screens[pScreen->myNum];
+ pScrn = xf86ScreenToScrn(pScreen);
pI810 = I810PTR(pScrn);
pI810->CursorInfoRec = infoPtr = xf86CreateCursorInfoRec();
if (!infoPtr)
@@ -101,7 +101,7 @@ I810CursorInit(ScreenPtr pScreen)
static Bool I810UseHWCursorARGB (ScreenPtr pScreen, CursorPtr pCurs)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
if (!pI810->CursorARGBPhysical)
@@ -144,7 +144,7 @@ static void I810LoadCursorARGB (ScrnInfoPtr pScrn, CursorPtr pCurs)
static Bool
I810UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
if (!pI810->CursorPhysical)
diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c
index 44181c65..baf0011d 100644
--- a/src/legacy/i810/i810_dga.c
+++ b/src/legacy/i810/i810_dga.c
@@ -70,7 +70,7 @@ DGAFunctionRec I810DGAFuncs = {
Bool
I810DGAInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
DGAModePtr modes = NULL, newmodes = NULL, currentMode;
DisplayModePtr pMode, firstMode;
diff --git a/src/legacy/i810/i810_dri.c b/src/legacy/i810/i810_dri.c
index 91290693..2f02dd92 100644
--- a/src/legacy/i810/i810_dri.c
+++ b/src/legacy/i810/i810_dri.c
@@ -155,7 +155,7 @@ mylog2(unsigned int n)
Bool
I810DRIScreenInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
DRIInfoPtr pDRIInfo;
I810DRIPtr pI810DRI;
@@ -891,7 +891,7 @@ I810DRIScreenInit(ScreenPtr pScreen)
void
I810DRICloseScreen(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
I810DRIPtr pI810DRI = (I810DRIPtr) pI810->pDRIInfo->devPrivate;
@@ -956,7 +956,7 @@ Bool
I810DRIFinishScreenInit(ScreenPtr pScreen)
{
I810SAREARec *sPriv = (I810SAREARec *) DRIGetSAREAPrivate(pScreen);
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr info = I810PTR(pScrn);
memset(sPriv, 0, sizeof(sPriv));
@@ -976,7 +976,7 @@ I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
DRIContextType oldContextType, void *oldContext,
DRIContextType newContextType, void *newContext)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
if (syncType == DRI_3D_SYNC &&
@@ -1002,7 +1002,7 @@ static void
I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
BoxPtr pbox = REGION_RECTS(prgn);
int nbox = REGION_NUM_RECTS(prgn);
@@ -1047,7 +1047,7 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
{
ScreenPtr pScreen = pParent->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
BoxPtr pboxTmp, pboxNext, pboxBase;
DDXPointPtr pptTmp, pptNew2 = NULL;
@@ -1249,7 +1249,7 @@ static void I810DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
static void I810EnablePageFlip(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
I810SAREAPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
int cpp=2;
@@ -1298,7 +1298,7 @@ static void I810DRITransitionMultiToSingle3d(ScreenPtr pScreen)
static void I810DRITransitionTo3d(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
I810EnablePageFlip(pScreen);
@@ -1307,7 +1307,7 @@ static void I810DRITransitionTo3d(ScreenPtr pScreen)
static void I810DRITransitionTo2d(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
I810SAREAPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 60053d8f..09d52c5a 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -1353,7 +1353,7 @@ I810ModeInit(ScrnInfoPtr scrn, DisplayModePtr mode)
#ifdef HAVE_DRI1
if (pI810->directRenderingEnabled) {
- DRILock(screenInfo.screens[scrn->scrnIndex], 0);
+ DRILock(xf86ScrnToScreen(scrn), 0);
pI810->LockHeld = 1;
}
#endif
@@ -1362,7 +1362,7 @@ I810ModeInit(ScrnInfoPtr scrn, DisplayModePtr mode)
#ifdef HAVE_DRI1
if (pI810->directRenderingEnabled) {
- DRIUnlock(screenInfo.screens[scrn->scrnIndex]);
+ DRIUnlock(xf86ScrnToScreen(scrn));
pI810->LockHeld = 0;
}
#endif
@@ -1577,7 +1577,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
I810Ptr pI810;
VisualPtr visual;
- scrn = xf86Screens[screen->myNum];
+ scrn = xf86ScreenToScrn(screen);
pI810 = I810PTR(scrn);
hwp = VGAHWPTR(scrn);
diff --git a/src/legacy/i810/i810_hwmc.c b/src/legacy/i810/i810_hwmc.c
index ba50e1ef..c7100e09 100644
--- a/src/legacy/i810/i810_hwmc.c
+++ b/src/legacy/i810/i810_hwmc.c
@@ -197,7 +197,7 @@ static XF86MCAdaptorPtr ppAdapt[1] =
**************************************************************************/
void I810InitMC(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
I810Ptr pI810 = I810PTR(pScrn);
int i;
diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index 5a568a67..2999ee0b 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -154,7 +154,7 @@ static Atom xvBrightness, xvContrast, xvColorKey;
void I810InitVideo(ScreenPtr screen)
{
- ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(screen);
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr newAdaptor = NULL;
int num_adaptors;
@@ -377,7 +377,7 @@ static void I810ResetVideo(ScrnInfoPtr pScrn)
static XF86VideoAdaptorPtr
I810SetupImageVideo(ScreenPtr screen)
{
- ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(screen);
I810Ptr pI810 = I810PTR(pScrn);
XF86VideoAdaptorPtr adapt;
I810PortPrivPtr pPriv;
@@ -941,7 +941,7 @@ I810AllocateMemory(
xf86FreeOffscreenLinear(linear);
}
- screen = screenInfo.screens[pScrn->scrnIndex];
+ screen = xf86ScrnToScreen(pScrn);
new_linear = xf86AllocateOffscreenLinear(screen, size, 4,
NULL, NULL, NULL);
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 6c6650b1..7a01ee76 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -332,7 +332,7 @@ to_sna(ScrnInfoPtr scrn)
constant static inline struct sna *
to_sna_from_screen(ScreenPtr screen)
{
- return to_sna(xf86Screens[screen->myNum]);
+ return to_sna(xf86ScreenToScrn(screen));
}
constant static inline struct sna *
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 517eaad6..4fa43209 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -686,7 +686,7 @@ sna_dri_copy_region(DrawablePtr draw,
static int
sna_dri_get_pipe(DrawablePtr pDraw)
{
- ScrnInfoPtr pScrn = xf86Screens[pDraw->pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDraw->pScreen);
BoxRec box, crtcbox;
xf86CrtcPtr crtc;
int pipe;
@@ -1496,7 +1496,7 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
CARD64 remainder, DRI2SwapEventPtr func, void *data)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct sna *sna = to_sna(scrn);
drmVBlank vbl;
int pipe;
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 9ec3ecfc..2e816402 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -641,7 +641,7 @@ sna_handle_uevents(int fd, void *closure)
if (memcmp(&s.st_rdev, &udev_devnum, sizeof (dev_t)) == 0 &&
hotplug && atoi(hotplug) == 1)
- RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE);
+ RRGetInfo(xf86ScrnToScreen(scrn), TRUE);
udev_device_unref(dev);
}
@@ -826,7 +826,7 @@ agp_aperture_size(struct pci_device *dev, int gen)
static Bool
sna_screen_init(int scrnIndex, ScreenPtr screen, int argc, char **argv)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct sna *sna = to_sna(scrn);
VisualPtr visual;
diff --git a/uxa/uxa.c b/uxa/uxa.c
index b4a1da61..0ba68691 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -366,7 +366,7 @@ void uxa_set_force_fallback(ScreenPtr screen, Bool value)
static Bool uxa_close_screen(int i, ScreenPtr pScreen)
{
uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif