mirror of
https://github.com/X11Libre/xf86-video-ati.git
synced 2026-03-24 01:24:43 +00:00
Always use screen depth/bpp for KMS framebuffers
DRI clients can use depth 32 pixmaps while the screen is depth 24, in which case page flipping would fail. Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
This commit is contained in:
committed by
Michel Dänzer
parent
8312442604
commit
733f606dd6
@@ -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 */
|
||||
|
||||
13
src/radeon.h
13
src/radeon.h
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user