summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-16 15:45:53 +0100
committerDave Airlie <airlied@redhat.com>2012-05-23 11:06:12 +0100
commit9d2549057ffced996bfaeb8df4901ef57da636c7 (patch)
tree178d55ef27b0d8cd9ea52fef7a1d09570e463c54 /src
parent80a45bfc26e20d1d481f13cb15c0720d165a8306 (diff)
ati: 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>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c4
-rw-r--r--src/evergreen_exa.c32
-rw-r--r--src/legacy_crtc.c4
-rw-r--r--src/r600_exa.c40
-rw-r--r--src/radeon.h1
-rw-r--r--src/radeon_accel.c8
-rw-r--r--src/radeon_accelfuncs.c2
-rw-r--r--src/radeon_crtc.c2
-rw-r--r--src/radeon_cursor.c2
-rw-r--r--src/radeon_dri.c36
-rw-r--r--src/radeon_dri2.c26
-rw-r--r--src/radeon_driver.c10
-rw-r--r--src/radeon_exa.c10
-rw-r--r--src/radeon_exa_funcs.c2
-rw-r--r--src/radeon_exa_render.c4
-rw-r--r--src/radeon_exa_shared.c2
-rw-r--r--src/radeon_kms.c10
-rw-r--r--src/radeon_legacy_memory.c4
-rw-r--r--src/radeon_textured_video.c2
-rw-r--r--src/radeon_video.c6
-rw-r--r--src/radeon_xvmc.c2
21 files changed, 105 insertions, 104 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 38f99409..fb437cdd 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1243,7 +1243,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
RADEONInfoPtr info = RADEONPTR(scrn);
struct radeon_bo *old_front = NULL;
Bool ret;
- ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
+ ScreenPtr screen = xf86ScrnToScreen(scrn);
uint32_t old_fb_id;
int i, pitch, old_width, old_height, old_pitch;
int screen_size;
@@ -1704,7 +1704,7 @@ drmmode_handle_uevents(int fd, void *closure)
if (!dev)
return;
- RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE);
+ RRGetInfo(xf86ScrnToScreen(scrn), TRUE);
udev_device_unref(dev);
}
#endif
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 61b47a4f..1e829bfd 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -58,7 +58,7 @@ extern int cayman_comp_ps(RADEONChipFamily ChipSet, uint32_t* ps);
static Bool
EVERGREENPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
cb_config_t cb_conf;
@@ -214,7 +214,7 @@ EVERGREENPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
static void
EVERGREENDoneSolid(PixmapPtr pPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -230,7 +230,7 @@ EVERGREENDoneSolid(PixmapPtr pPix)
static void
EVERGREENSolid(PixmapPtr pPix, int x1, int y1, int x2, int y2)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
float *vb;
@@ -401,7 +401,7 @@ EVERGREENDoCopy(ScrnInfoPtr pScrn)
static void
EVERGREENDoCopyVline(PixmapPtr pPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -450,7 +450,7 @@ EVERGREENPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
int rop,
Pixel planemask)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
struct r600_accel_object src_obj, dst_obj;
@@ -539,7 +539,7 @@ EVERGREENPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
static void
EVERGREENDoneCopy(PixmapPtr pDst)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -557,7 +557,7 @@ EVERGREENCopy(PixmapPtr pDst,
int dstX, int dstY,
int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -786,7 +786,7 @@ static Bool EVERGREENCheckCompositeTexture(PicturePtr pPict,
static void EVERGREENXFormSetup(PicturePtr pPict, PixmapPtr pPix,
int unit, float *vs_alu_consts)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
int const_offset = unit * 8;
@@ -832,7 +832,7 @@ static void EVERGREENXFormSetup(PicturePtr pPict, PixmapPtr pPix,
static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
int unit)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
unsigned int repeatType;
@@ -1131,7 +1131,7 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
uint32_t dst_format;
@@ -1395,7 +1395,7 @@ static void EVERGREENFinishComposite(ScrnInfoPtr pScrn, PixmapPtr pDst,
static void EVERGREENDoneComposite(PixmapPtr pDst)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -1414,7 +1414,7 @@ static void EVERGREENComposite(PixmapPtr pDst,
int dstX, int dstY,
int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
float *vb;
@@ -1490,7 +1490,7 @@ static Bool
EVERGREENUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
char *src, int src_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
struct radeon_exa_pixmap_priv *driver_priv;
@@ -1609,7 +1609,7 @@ static Bool
EVERGREENDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w,
int h, char *dst, int dst_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
struct radeon_exa_pixmap_priv *driver_priv;
@@ -1746,7 +1746,7 @@ out:
static int
EVERGREENMarkSync(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -1889,7 +1889,7 @@ CAYMANLoadShaders(ScrnInfoPtr pScrn)
Bool
EVERGREENDrawInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->accel_state->exa == NULL) {
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index 0beb54d4..8949c291 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -853,7 +853,7 @@ RADEONInitCrtcBase(xf86CrtcPtr crtc, RADEONSavePtr save,
/*** NOTE: r3/4xx will need sarea and drm pageflip updates to handle the xytile regs for
*** pageflipping!
***/
- pSAREAPriv = DRIGetSAREAPrivate(screenInfo.screens[pScrn->scrnIndex]);
+ pSAREAPriv = DRIGetSAREAPrivate(xf86ScrnToScreen(pScrn));
/* can't get at sarea in a semi-sane way? */
pSAREA = (void *)((char*)pSAREAPriv - sizeof(XF86DRISAREARec));
@@ -1074,7 +1074,7 @@ RADEONInitCrtc2Base(xf86CrtcPtr crtc, RADEONSavePtr save,
/*** NOTE: r3/4xx will need sarea and drm pageflip updates to handle the xytile regs for
*** pageflipping!
***/
- pSAREAPriv = DRIGetSAREAPrivate(screenInfo.screens[pScrn->scrnIndex]);
+ pSAREAPriv = DRIGetSAREAPrivate(xf86ScrnToScreen(pScrn));
/* can't get at sarea in a semi-sane way? */
pSAREA = (void *)((char*)pSAREAPriv - sizeof(XF86DRISAREARec));
diff --git a/src/r600_exa.c b/src/r600_exa.c
index c3ae5536..470de010 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -168,7 +168,7 @@ R600SetAccelState(ScrnInfoPtr pScrn,
static Bool
R600PrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
cb_config_t cb_conf;
@@ -323,7 +323,7 @@ R600PrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
static void
R600DoneSolid(PixmapPtr pPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -339,7 +339,7 @@ R600DoneSolid(PixmapPtr pPix)
static void
R600Solid(PixmapPtr pPix, int x1, int y1, int x2, int y2)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
float *vb;
@@ -517,7 +517,7 @@ R600DoCopy(ScrnInfoPtr pScrn)
static void
R600DoCopyVline(PixmapPtr pPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -566,7 +566,7 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
int rop,
Pixel planemask)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
struct r600_accel_object src_obj, dst_obj;
@@ -681,7 +681,7 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
static void
R600DoneCopy(PixmapPtr pDst)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -702,7 +702,7 @@ R600Copy(PixmapPtr pDst,
int dstX, int dstY,
int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -939,7 +939,7 @@ static Bool R600CheckCompositeTexture(PicturePtr pPict,
static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
int unit)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
unsigned int repeatType;
@@ -1271,7 +1271,7 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
uint32_t dst_format;
@@ -1534,7 +1534,7 @@ static void R600FinishComposite(ScrnInfoPtr pScrn, PixmapPtr pDst,
static void R600DoneComposite(PixmapPtr pDst)
{
ScreenPtr pScreen = pDst->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -1553,7 +1553,7 @@ static void R600Composite(PixmapPtr pDst,
int dstX, int dstY,
int w, int h)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
float *vb;
@@ -1728,7 +1728,7 @@ static Bool
R600UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
char *src, int src_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
uint32_t dst_pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
uint32_t dst_mc_addr = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
@@ -1744,7 +1744,7 @@ static Bool
R600DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
char *dst, int dst_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
uint32_t src_pitch = exaGetPixmapPitch(pSrc) / (pSrc->drawable.bitsPerPixel / 8);
@@ -1844,7 +1844,7 @@ static Bool
R600UploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
char *src, int src_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
struct radeon_exa_pixmap_priv *driver_priv;
@@ -1967,7 +1967,7 @@ static Bool
R600DownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
int h, char *dst, int dst_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
struct radeon_exa_pixmap_priv *driver_priv;
@@ -2105,7 +2105,7 @@ out:
static int
R600MarkSync(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -2116,7 +2116,7 @@ R600MarkSync(ScreenPtr pScreen)
static void
R600Sync(ScreenPtr pScreen, int marker)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
@@ -2236,7 +2236,7 @@ R600LoadShaders(ScrnInfoPtr pScrn)
static Bool
R600PrepareAccess(PixmapPtr pPix, int index)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
@@ -2249,7 +2249,7 @@ R600PrepareAccess(PixmapPtr pPix, int index)
static void
R600FinishAccess(PixmapPtr pPix, int index)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
@@ -2261,7 +2261,7 @@ R600FinishAccess(PixmapPtr pPix, int index)
Bool
R600DrawInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->accel_state->exa == NULL) {
diff --git a/src/radeon.h b/src/radeon.h
index 90bcf8a1..4fdfca6c 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -42,6 +42,7 @@
#include <sys/time.h> /* For gettimeofday() */
#include "config.h"
+
#include "xf86str.h"
#include "compiler.h"
#include "xf86fbman.h"
diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index 44d797c9..89673a77 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -555,7 +555,7 @@ void RADEONEngineInit(ScrnInfoPtr pScrn)
uint32_t radeonGetPixmapOffset(PixmapPtr pPix)
{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPix->drawable.pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
uint32_t offset = 0;
if (info->cs)
@@ -1065,7 +1065,7 @@ RADEONHostDataBlitCopyPass(
Bool RADEONAccelInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
#ifdef USE_EXA
@@ -1152,7 +1152,7 @@ void RADEONInit3DEngine(ScrnInfoPtr pScrn)
Bool
RADEONSetupMemXAA_DRI(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int cpp = info->CurrentLayout.pixel_bytes;
int depthCpp = (info->dri->depthBits - 8) / 4;
@@ -1410,7 +1410,7 @@ RADEONSetupMemXAA_DRI(ScreenPtr pScreen)
Bool
RADEONSetupMemXAA(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
BoxRec MemBox;
int y2;
diff --git a/src/radeon_accelfuncs.c b/src/radeon_accelfuncs.c
index d0bead35..fe892add 100644
--- a/src/radeon_accelfuncs.c
+++ b/src/radeon_accelfuncs.c
@@ -1152,7 +1152,7 @@ FUNC_NAME(RADEONDisableClipping)(ScrnInfoPtr pScrn)
void
FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
a->Flags = (PIXMAP_CACHE
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index d48cbc1e..18b01559 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -1119,7 +1119,7 @@ RADEONSetTiling(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[drm] failed changing tiling status\n");
/* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
- pSAREAPriv = DRIGetSAREAPrivate(screenInfo.screens[pScrn->scrnIndex]);
+ pSAREAPriv = DRIGetSAREAPrivate(xf86ScrnToScreen(pScrn));
info->tilingEnabled = pSAREAPriv->tiling_enabled ? TRUE : FALSE;
}
#endif
diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index 6c2b9e8a..faf71aee 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -407,7 +407,7 @@ radeon_crtc_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image)
/* Initialize hardware cursor support. */
Bool RADEONCursorInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 81dc08b2..035556d6 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -91,7 +91,7 @@ static void RADEONDRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num);
*/
static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int numConfigs = 0;
__GLXvisualConfig *pConfigs = 0;
@@ -317,7 +317,7 @@ static void RADEONDestroyContext(ScreenPtr pScreen, drm_context_t hwContext,
*/
static void RADEONEnterServer(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
drm_radeon_sarea_t *pSAREAPriv;
@@ -359,7 +359,7 @@ static void RADEONEnterServer(ScreenPtr pScreen)
*/
static void RADEONLeaveServer(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RING_LOCALS;
@@ -490,7 +490,7 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
{
#ifdef USE_XAA
ScreenPtr pScreen = pParent->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
BoxPtr pboxTmp, pboxNext, pboxBase;
@@ -900,7 +900,7 @@ static Bool RADEONSetAgpMode(RADEONInfoPtr info, ScreenPtr pScreen)
/* Initialize Radeon's AGP registers */
static void RADEONSetAgpBase(RADEONInfoPtr info, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
unsigned char *RADEONMMIO = info->MMIO;
if (info->ChipFamily >= CHIP_FAMILY_R600)
@@ -1174,7 +1174,7 @@ static Bool RADEONDRIMapInit(RADEONInfoPtr info, ScreenPtr pScreen)
/* Initialize the kernel data structures */
static int RADEONDRIKernelInit(RADEONInfoPtr info, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
int cpp = info->CurrentLayout.pixel_bytes;
drm_radeon_init_t drmInfo;
@@ -1281,7 +1281,7 @@ static Bool RADEONDRIBufInit(RADEONInfoPtr info, ScreenPtr pScreen)
static void RADEONDRIIrqInit(RADEONInfoPtr info, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
if (!info->dri->irq) {
info->dri->irq = drmGetInterruptFromBusID(
@@ -1525,7 +1525,7 @@ Bool RADEONDRISetVBlankInterrupt(ScrnInfoPtr pScrn, Bool on)
*/
Bool RADEONDRIScreenInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
DRIInfoPtr pDRIInfo;
RADEONDRIPtr pRADEONDRI;
@@ -1718,7 +1718,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
static Bool RADEONDRIDoCloseScreen(int scrnIndex, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONDRICloseScreen(pScreen);
@@ -1733,7 +1733,7 @@ static Bool RADEONDRIDoCloseScreen(int scrnIndex, ScreenPtr pScreen)
*/
Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
drm_radeon_sarea_t *pSAREAPriv;
RADEONDRIPtr pRADEONDRI;
@@ -1831,7 +1831,7 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen)
void RADEONDRIResume(ScreenPtr pScreen)
{
int _ret;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->dri->pKernelDRMVersion->version_minor >= 9) {
@@ -1866,7 +1866,7 @@ void RADEONDRIResume(ScreenPtr pScreen)
void RADEONDRIStop(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RING_LOCALS;
@@ -1889,7 +1889,7 @@ void RADEONDRIStop(ScreenPtr pScreen)
*/
void RADEONDRICloseScreen(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
drm_radeon_init_t drmInfo;
@@ -2093,7 +2093,7 @@ out:
static void RADEONEnablePageFlip(ScreenPtr pScreen)
{
#ifdef DAMAGE
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->dri->allowPageFlip) {
@@ -2133,7 +2133,7 @@ static void RADEONDRITransitionMultiToSingle3d(ScreenPtr pScreen)
static void RADEONDRITransitionTo3d(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
#ifdef USE_XAA
FBAreaPtr fbarea;
@@ -2221,7 +2221,7 @@ static void RADEONDRITransitionTo3d(ScreenPtr pScreen)
static void RADEONDRITransitionTo2d(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
drm_radeon_sarea_t *pSAREAPriv = DRIGetSAREAPrivate(pScreen);
@@ -2266,7 +2266,7 @@ static void RADEONDRITransitionTo2d(ScreenPtr pScreen)
static void
RADEONDRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
REGION_UNINIT(pScreen, &info->dri->driRegion);
@@ -2289,7 +2289,7 @@ RADEONDRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num)
void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->cardType != CARD_PCIE ||
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 8bd3f667..7a9b6256 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -81,7 +81,7 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
int count)
{
ScreenPtr pScreen = drawable->pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
BufferPtr buffers;
struct dri2_buffer_priv *privates;
@@ -245,7 +245,7 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
unsigned int format)
{
ScreenPtr pScreen = drawable->pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
BufferPtr buffers;
struct dri2_buffer_priv *privates;
@@ -414,7 +414,7 @@ radeon_dri2_destroy_buffer(DrawablePtr drawable, BufferPtr buffers)
/* Trying to free an already freed buffer is unlikely to end well */
if (private->refcnt == 0) {
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"Attempted to destroy previously destroyed buffer.\
@@ -443,7 +443,7 @@ radeon_dri2_copy_region(DrawablePtr drawable,
struct dri2_buffer_priv *src_private = src_buffer->driverPrivate;
struct dri2_buffer_priv *dst_private = dest_buffer->driverPrivate;
ScreenPtr pScreen = drawable->pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
DrawablePtr src_drawable;
DrawablePtr dst_drawable;
RegionPtr copy_clip;
@@ -620,7 +620,7 @@ radeon_dri2_client_state_changed(CallbackListPtr *ClientStateCallback, pointer d
static int radeon_dri2_drawable_crtc(DrawablePtr pDraw)
{
ScreenPtr pScreen = pDraw->pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
xf86CrtcPtr crtc;
int crtc_id = -1;
@@ -773,7 +773,7 @@ radeon_dri2_exchange_buffers(DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPt
/* Do we need to update the Screen? */
screen = draw->pScreen;
- info = RADEONPTR(xf86Screens[screen->myNum]);
+ info = RADEONPTR(xf86ScreenToScrn(screen));
if (front_radeon->bo == info->front_bo) {
radeon_bo_unref(info->front_bo);
info->front_bo = back_radeon->bo;
@@ -804,7 +804,7 @@ void radeon_dri2_frame_event_handler(unsigned int frame, unsigned int tv_sec,
goto cleanup;
screen = drawable->pScreen;
- scrn = xf86Screens[screen->myNum];
+ scrn = xf86ScreenToScrn(screen);
switch (event->type) {
case DRI2_FLIP:
@@ -885,7 +885,7 @@ static drmVBlankSeqType populate_vbl_request_type(RADEONInfoPtr info, int crtc)
static int radeon_dri2_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
RADEONInfoPtr info = RADEONPTR(scrn);
drmVBlank vbl;
int ret;
@@ -925,7 +925,7 @@ static int radeon_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw,
CARD64 remainder)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
RADEONInfoPtr info = RADEONPTR(scrn);
DRI2FrameEventPtr wait_info = NULL;
drmVBlank vbl;
@@ -1061,7 +1061,7 @@ void radeon_dri2_flip_event_handler(unsigned int frame, unsigned int tv_sec,
}
screen = drawable->pScreen;
- scrn = xf86Screens[screen->myNum];
+ scrn = xf86ScreenToScrn(screen);
pixmap = screen->GetScreenPixmap(screen);
xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
@@ -1123,7 +1123,7 @@ static int radeon_dri2_schedule_swap(ClientPtr client, DrawablePtr draw,
void *data)
{
ScreenPtr screen = draw->pScreen;
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
RADEONInfoPtr info = RADEONPTR(scrn);
drmVBlank vbl;
int ret, crtc= radeon_dri2_drawable_crtc(draw), flip = 0;
@@ -1309,7 +1309,7 @@ blit_fallback:
Bool
radeon_dri2_screen_init(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
DRI2InfoRec dri2_info = { 0 };
#ifdef USE_DRI2_SCHEDULING
@@ -1413,7 +1413,7 @@ radeon_dri2_screen_init(ScreenPtr pScreen)
void radeon_dri2_close_screen(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
#ifdef USE_DRI2_SCHEDULING
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 5681f02d..e79ddba0 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -231,7 +231,7 @@ static void *
radeonShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode,
CARD32 *size, void *closure)
{
- ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(screen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int stride;
@@ -243,7 +243,7 @@ radeonShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode,
static Bool
RADEONCreateScreenResources (ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
PixmapPtr pixmap;
@@ -3451,7 +3451,7 @@ RADEONInitBIOSRegisters(ScrnInfoPtr pScrn)
Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
int argc, char **argv)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int hasDRI = 0;
#ifdef RENDER
@@ -5936,7 +5936,7 @@ static void RADEONRestore(ScrnInfoPtr pScrn)
static Bool RADEONSaveScreen(ScreenPtr pScreen, int mode)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
Bool unblank;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
@@ -6157,7 +6157,7 @@ void RADEONDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, Bool crtc2)
/*** NOTE: r3/4xx will need sarea and drm pageflip updates to handle the xytile regs for
*** pageflipping!
***/
- pSAREAPriv = DRIGetSAREAPrivate(screenInfo.screens[pScrn->scrnIndex]);
+ pSAREAPriv = DRIGetSAREAPrivate(xf86ScrnToScreen(pScrn));
/* can't get at sarea in a semi-sane way? */
pSAREA = (void *)((char*)pSAREAPriv - sizeof(XF86DRISAREARec));
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 270dad44..e6d9eafa 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -48,7 +48,7 @@
/***********************************************************************/
-#define RINFO_FROM_SCREEN(pScr) ScrnInfoPtr pScrn = xf86Screens[pScr->myNum]; \
+#define RINFO_FROM_SCREEN(pScr) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScr); \
RADEONInfoPtr info = RADEONPTR(pScrn)
static struct {
@@ -301,7 +301,7 @@ static void RADEONFinishAccess_BE(PixmapPtr pPix, int index)
Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_exa_pixmap_priv *driver_priv;
uint32_t possible_domains = ~0U;
@@ -384,7 +384,7 @@ void RADEONFinishAccess_CS(PixmapPtr pPix, int index)
void *RADEONEXACreatePixmap(ScreenPtr pScreen, int size, int align)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_exa_pixmap_priv *new_priv;
@@ -450,7 +450,7 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height,
int depth, int usage_hint, int bitsPerPixel,
int *new_pitch)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_exa_pixmap_priv *new_priv;
int pitch, base_align;
@@ -713,7 +713,7 @@ Bool RADEONEXAPixmapIsOffscreen(PixmapPtr pPix)
*/
Bool RADEONSetupMemEXA (ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int cpp = info->CurrentLayout.pixel_bytes;
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index 058a547b..9382e2da 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -71,7 +71,7 @@ FUNC_NAME(RADEONMarkSync)(ScreenPtr pScreen)
static void
FUNC_NAME(RADEONSync)(ScreenPtr pScreen, int marker)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->cs)
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 7f1a3ffa..c42ae287 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -1140,7 +1140,7 @@ static Bool R300CheckCompositeTexture(PicturePtr pPict,
Bool is_r500)
{
ScreenPtr pScreen = pDstPict->pDrawable->pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
int i;
@@ -1407,7 +1407,7 @@ static Bool R300CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
uint32_t tmp1;
ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
PixmapPtr pSrcPixmap, pDstPixmap;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int max_tex_w, max_tex_h, max_dst_w, max_dst_h;
diff --git a/src/radeon_exa_shared.c b/src/radeon_exa_shared.c
index 7af8a52b..b83eb81c 100644
--- a/src/radeon_exa_shared.c
+++ b/src/radeon_exa_shared.c
@@ -128,7 +128,7 @@ Bool RADEONCheckBPP(int bpp)
PixmapPtr RADEONSolidPixmap(ScreenPtr pScreen, uint32_t solid)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
PixmapPtr pPix = pScreen->CreatePixmap(pScreen, 1, 1, 32, 0);
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index ae4953e4..cf446ab9 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -144,7 +144,7 @@ static void *
radeonShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode,
CARD32 *size, void *closure)
{
- ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(screen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int stride;
@@ -156,7 +156,7 @@ radeonShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode,
static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
PixmapPtr pixmap;
struct radeon_surface *surface;
@@ -841,7 +841,7 @@ static Bool RADEONCursorInit_KMS(ScreenPtr pScreen)
static Bool RADEONSaveScreen_KMS(ScreenPtr pScreen, int mode)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
Bool unblank;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
@@ -919,7 +919,7 @@ void RADEONFreeScreen_KMS(int scrnIndex, int flags)
Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
int argc, char **argv)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
int subPixelOrder = SubPixelUnknown;
char* s;
@@ -1220,7 +1220,7 @@ void RADEONAdjustFrame_KMS(int scrnIndex, int x, int y, int flags)
static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int cpp = info->CurrentLayout.pixel_bytes;
diff --git a/src/radeon_legacy_memory.c b/src/radeon_legacy_memory.c
index 5d66c920..b01ba8cc 100644
--- a/src/radeon_legacy_memory.c
+++ b/src/radeon_legacy_memory.c
@@ -18,7 +18,7 @@ radeon_legacy_allocate_memory(ScrnInfoPtr pScrn,
int align,
int domain)
{
- ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+ ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
RADEONInfoPtr info = RADEONPTR(pScrn);
uint32_t offset = 0;
@@ -121,7 +121,7 @@ radeon_legacy_free_memory(ScrnInfoPtr pScrn,
}
#endif
#ifdef USE_EXA
- ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
+ ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
if (info->useEXA) {
ExaOffscreenArea *area = mem_struct;
diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index ff2bb9f9..48564f82 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -811,7 +811,7 @@ static void radeon_unload_bicubic_texture(ScrnInfoPtr pScrn)
XF86VideoAdaptorPtr
RADEONSetupImageTexturedVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONPortPrivPtr pPortPriv;
XF86VideoAdaptorPtr adapt;
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 0e2c1275..4eb01dc1 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -279,7 +279,7 @@ radeon_crtc_clip_video(ScrnInfoPtr pScrn,
void RADEONInitVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
@@ -1616,7 +1616,7 @@ skip_theatre:
static XF86VideoAdaptorPtr
RADEONSetupImageVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONPortPrivPtr pPriv;
XF86VideoAdaptorPtr adapt;
@@ -3391,7 +3391,7 @@ RADEONDisplaySurface(
static void
RADEONInitOffscreenImages(ScreenPtr pScreen)
{
-/* ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+/* ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn); */
XF86OffscreenImagePtr offscreenImages;
/* need to free this someplace */
diff --git a/src/radeon_xvmc.c b/src/radeon_xvmc.c
index 0f543186..994891e9 100644
--- a/src/radeon_xvmc.c
+++ b/src/radeon_xvmc.c
@@ -126,7 +126,7 @@ RADEONCreateAdaptorXvMC(ScreenPtr pScreen, char *xv_adaptor_name)
assert(pScreen);
- pScrn = xf86Screens[pScreen->myNum];
+ pScrn = xf86ScreenToScrn(pScreen);
adaptor = xf86XvMCCreateAdaptorRec();
if (!adaptor)