From 93c76a3d437ff71fabe1d190a9f00e92cec7a621 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 4 Dec 2015 23:45:44 -0500 Subject: file_inode(f)->i_mapping is f->f_mapping Signed-off-by: Al Viro --- drivers/gpu/drm/omapdrm/omap_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c') diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index b97afc281778..dfb36f3c9c35 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -1406,7 +1406,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, if (ret) goto err_free; - mapping = file_inode(obj->filp)->i_mapping; + mapping = obj->filp->f_mapping; mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32); } -- cgit v1.2.3 From 6a5228fdf0a4636fdf5ce616c35264e0c0b26c7c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 18 Apr 2016 18:18:37 +0300 Subject: drm/omap: remove align_pitch() The previous commit removed aligning the pitch to SGX's pitch requirement from align_pitch(). What's left is effectively a function that returns width * bytespp. To clean up the driver, we can remove the function and have the calculation inline in the two places which call align_pitch(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c') diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 03698b6c806c..ea94aadb279d 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -661,7 +661,8 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev, { union omap_gem_size gsize; - args->pitch = align_pitch(0, args->width, args->bpp); + args->pitch = args->width * DIV_ROUND_UP(args->bpp, 8); + args->size = PAGE_ALIGN(args->pitch * args->height); gsize = (union omap_gem_size){ -- cgit v1.2.3 From ce481edad41098b535c15661e2e47a0934a24a7a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 19 Apr 2016 09:06:32 +0300 Subject: drm/omap: fix pitch round-up At the moment we calculate the buffer's pitch with: pitch = width * DIV_ROUND_UP(bpp, 8) For CLUT modes with bpp of 1/2/4/8 this gives wrong result, and the correct pitch is: pitch = DIV_ROUND_UP(width * bpp, 8) In practice this doesn't change anything, as we don't support CLUT modes, but it's better to have the pitch calculation correct. Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c') diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index ea94aadb279d..ec996c752160 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -661,7 +661,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev, { union omap_gem_size gsize; - args->pitch = args->width * DIV_ROUND_UP(args->bpp, 8); + args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8); args->size = PAGE_ALIGN(args->pitch * args->height); -- cgit v1.2.3 From 0f9abbd0288c9916e7b1dd9613e52b525473f30b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 26 Apr 2016 23:35:44 +0300 Subject: drm: omapdrm: Remove unused omap_gem_tiled_size function The function is never used, remove it. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_gem.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c') diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index ec996c752160..9b3f565fd8d7 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -383,18 +383,6 @@ size_t omap_gem_mmap_size(struct drm_gem_object *obj) return size; } -/* get tiled size, returns -EINVAL if not tiled buffer */ -int omap_gem_tiled_size(struct drm_gem_object *obj, uint16_t *w, uint16_t *h) -{ - struct omap_gem_object *omap_obj = to_omap_bo(obj); - if (omap_obj->flags & OMAP_BO_TILED) { - *w = omap_obj->width; - *h = omap_obj->height; - return 0; - } - return -EINVAL; -} - /* ----------------------------------------------------------------------------- * Fault Handling */ -- cgit v1.2.3