aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_fb.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-07-10 01:59:35 -0400
committerDave Airlie <airlied@redhat.com>2015-07-10 01:59:35 -0400
commit2d28b633c3fa8f53b919a5de86eb1c8e78dde818 (patch)
tree791cc8b3a7c6ba0a55c2c2f2caf61e563ef7b5d8 /drivers/gpu/drm/omapdrm/omap_fb.c
parent59e7a16d60ffead64d1407bf8915b8b2078ba870 (diff)
parent743c16719f671c206923d23dae4ac57edfd9483c (diff)
Merge tag 'omapdrm-4.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-fixes
omapdrm fixes for 4.2 Small fixes for omapdrm, including: * Fix packed 24 bit color formats * Ensure the planes are inside the crtc * Handle out-of-dma-memory error * tag 'omapdrm-4.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: drm/omap: replace ALIGN(PAGE_SIZE) by PAGE_ALIGN drm/omap: fix align_pitch() for 24 bits per pixel drm/omap: fix omap_gem_put_paddr() error handling drm/omap: fix omap_framebuffer_unpin() error handling drm/omap: increase DMM transaction timeout drm/omap: check that plane is inside crtc drm/omap: return error if dma_alloc_writecombine fails
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fb.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 0b967e76df1a..51b1219af87f 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -287,10 +287,10 @@ fail:
287} 287}
288 288
289/* unpin, no longer being scanned out: */ 289/* unpin, no longer being scanned out: */
290int omap_framebuffer_unpin(struct drm_framebuffer *fb) 290void omap_framebuffer_unpin(struct drm_framebuffer *fb)
291{ 291{
292 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); 292 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
293 int ret, i, n = drm_format_num_planes(fb->pixel_format); 293 int i, n = drm_format_num_planes(fb->pixel_format);
294 294
295 mutex_lock(&omap_fb->lock); 295 mutex_lock(&omap_fb->lock);
296 296
@@ -298,24 +298,16 @@ int omap_framebuffer_unpin(struct drm_framebuffer *fb)
298 298
299 if (omap_fb->pin_count > 0) { 299 if (omap_fb->pin_count > 0) {
300 mutex_unlock(&omap_fb->lock); 300 mutex_unlock(&omap_fb->lock);
301 return 0; 301 return;
302 } 302 }
303 303
304 for (i = 0; i < n; i++) { 304 for (i = 0; i < n; i++) {
305 struct plane *plane = &omap_fb->planes[i]; 305 struct plane *plane = &omap_fb->planes[i];
306 ret = omap_gem_put_paddr(plane->bo); 306 omap_gem_put_paddr(plane->bo);
307 if (ret)
308 goto fail;
309 plane->paddr = 0; 307 plane->paddr = 0;
310 } 308 }
311 309
312 mutex_unlock(&omap_fb->lock); 310 mutex_unlock(&omap_fb->lock);
313
314 return 0;
315
316fail:
317 mutex_unlock(&omap_fb->lock);
318 return ret;
319} 311}
320 312
321struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p) 313struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p)