summaryrefslogtreecommitdiff
path: root/src/amdgpu_pixmap.h
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-02-13 18:26:06 +0100
committerMichel Dänzer <michel@daenzer.net>2018-02-14 17:06:27 +0100
commitb3095710b7c240ddefce794033a77033806f639d (patch)
treef13a9ef966a4fc537ff39b884a0cb1c4b445a191 /src/amdgpu_pixmap.h
parent6aee5770fb913713bb1b9a1af8f0d0892a66f21a (diff)
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> (Ported from radeon commit 733f606dd6ca8350e6e7f0858bfff5454ddc98ed) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_pixmap.h')
-rw-r--r--src/amdgpu_pixmap.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h
index eded170..d744ca5 100644
--- a/src/amdgpu_pixmap.h
+++ b/src/amdgpu_pixmap.h
@@ -104,8 +104,8 @@ static inline struct amdgpu_buffer *amdgpu_get_pixmap_bo(PixmapPtr pPix)
}
static inline struct drmmode_fb*
-amdgpu_fb_create(int drm_fd, uint32_t width, uint32_t height, uint8_t depth,
- uint8_t bpp, uint32_t pitch, uint32_t handle)
+amdgpu_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));
@@ -113,8 +113,8 @@ amdgpu_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);
@@ -154,9 +154,8 @@ amdgpu_pixmap_get_fb(PixmapPtr pix)
ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
- *fb_ptr = amdgpu_fb_create(pAMDGPUEnt->fd, pix->drawable.width,
- pix->drawable.height, pix->drawable.depth,
- pix->drawable.bitsPerPixel, pix->devKind,
+ *fb_ptr = amdgpu_fb_create(scrn, pAMDGPUEnt->fd, pix->drawable.width,
+ pix->drawable.height, pix->devKind,
handle);
}
}