diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2017-06-27 19:15:18 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2017-06-30 17:40:12 +0900 |
commit | df88d51c5005476e6fbfca3f31b54be079ec5aaa (patch) | |
tree | 20380d231166e1ef17c8c86ed4570099aaf74813 /src/radeon.h | |
parent | 19626bce4e5e31c863eedb503ea3884ac3f60bea (diff) |
Use pRADEONEnt->fd exclusively for the DRM file descriptor
This brings us closer to amdgpu.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon.h')
-rw-r--r-- | src/radeon.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/radeon.h b/src/radeon.h index febe580b..ca509561 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -694,7 +694,9 @@ uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix); static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo) { #ifdef USE_GLAMOR - RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen)); + ScrnInfoPtr scrn = xf86ScreenToScrn(pPix->drawable.pScreen); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn); + RADEONInfoPtr info = RADEONPTR(scrn); if (info->use_glamor) { struct radeon_pixmap *priv; @@ -711,7 +713,7 @@ static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo) radeon_bo_unref(priv->bo); } - drmmode_fb_reference(info->drmmode.fd, &priv->fb, NULL); + drmmode_fb_reference(pRADEONEnt->fd, &priv->fb, NULL); if (!bo) { free(priv); @@ -831,7 +833,9 @@ radeon_pixmap_create_fb(int drm_fd, PixmapPtr pix) static inline struct drmmode_fb* radeon_pixmap_get_fb(PixmapPtr pix) { - RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pix->drawable.pScreen)); + ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn); + RADEONInfoPtr info = RADEONPTR(scrn); #ifdef USE_GLAMOR if (info->use_glamor) { @@ -841,7 +845,7 @@ radeon_pixmap_get_fb(PixmapPtr pix) return NULL; if (!priv->fb) - priv->fb = radeon_pixmap_create_fb(info->drmmode.fd, pix); + priv->fb = radeon_pixmap_create_fb(pRADEONEnt->fd, pix); return priv->fb; } else @@ -855,7 +859,7 @@ radeon_pixmap_get_fb(PixmapPtr pix) return NULL; if (!driver_priv->fb) - driver_priv->fb = radeon_pixmap_create_fb(info->drmmode.fd, pix); + driver_priv->fb = radeon_pixmap_create_fb(pRADEONEnt->fd, pix); return driver_priv->fb; } |