Always use screen depth/bpp for KMS framebuffers
PATCH 1/1 Always use screen depth/bpp for KMS framebuffers
From: Michel Dänzer <[email protected]>
DRI clients can use depth 32 pixmaps while the screen is depth 24, in which case page flipping would fail.
Reported-by Mario Kleiner <[email protected]>
Signed-off-by Michel Dänzer <[email protected]>
--- src/drmmode_display.c | 5 ++--- src/radeon.h | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-)
src/drmmode_display.c +2 -3
@@ -943,9 +943,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,if (!fb) fb =radeon_pixmap_get_fb (pScreen->GetWindowPixmap (pScreen->root));if (!fb) { - fb =radeon_fb_create (pRADEONEnt->fd, pScrn->virtualX, - pScrn->virtualY, pScrn->depth, - pScrn->bitsPerPixel, + fb =radeon_fb_create (pScrn, pRADEONEnt->fd, + pScrn->virtualX, pScrn->virtualY, pScrn->displayWidth * info->pixel_bytes, info->front_bo->handle);/* Prevent refcnt of ad-hoc FBs from reaching 2 */
src/radeon.h +6 -7
@@ -836,8 +836,8 @@ static inline Bool radeon_get_pixmap_shared(PixmapPtr pPix) }static inline struct drmmode_fb * -radeon_fb_create (int drm_fd,uint32_t width,uint32_t height,uint8_t depth, -uint8_t bpp,uint32_t pitch,uint32_t handle) +radeon_fb_create (ScrnInfoPtr scrn,int drm_fd,uint32_t width,uint32_t height, +uint32_t pitch,uint32_t handle) {struct drmmode_fb *fb =malloc (sizeof (*fb));
@@ -845,8 +845,8 @@ radeon_fb_create(int drm_fd, uint32_t width, uint32_t height, uint8_t depth,return NULL ; fb->refcnt =1 ; -if (drmModeAddFB (drm_fd, width, height, depth, bpp, pitch, handle, - &fb->handle) ==0 ) +if (drmModeAddFB (drm_fd, width, height, scrn->depth, scrn->bitsPerPixel, + pitch, handle, &fb->handle) ==0 )return fb;free (fb);
@@ -898,9 +898,8 @@ radeon_pixmap_get_fb(PixmapPtr pix)ScrnInfoPtr scrn =xf86ScreenToScrn (pix->drawable.pScreen);RADEONEntPtr pRADEONEnt =RADEONEntPriv (scrn); - *fb_ptr =radeon_fb_create (pRADEONEnt->fd, pix->drawable.width, - pix->drawable.height, pix->drawable.depth, - pix->drawable.bitsPerPixel, pix->devKind, + *fb_ptr =radeon_fb_create (scrn, pRADEONEnt->fd, pix->drawable.width, + pix->drawable.height, pix->devKind, handle); } }
Signature · 6 lines
2.15.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx