diff mbox

[v4,08/14] drm: cirrus: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()

Message ID 1473345868-25453-9-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Sept. 8, 2016, 2:44 p.m. UTC
The driver doesn't need the color depth, only the number of bits per
pixel. Use the right API.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +++---
 drivers/gpu/drm/cirrus/cirrus_main.c  | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

Cc: Dave Airlie <airlied@redhat.com>

Comments

Daniel Vetter Sept. 21, 2016, 7:36 a.m. UTC | #1
On Thu, Sep 08, 2016 at 05:44:22PM +0300, Laurent Pinchart wrote:
> The driver doesn't need the color depth, only the number of bits per
> pixel. Use the right API.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/cirrus/cirrus_fbdev.c | 6 +++---
>  drivers/gpu/drm/cirrus/cirrus_main.c  | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> Cc: Dave Airlie <airlied@redhat.com>
> 
> diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
> index daecf1ad76a4..3a6309d7d8e4 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
> @@ -138,12 +138,12 @@ static int cirrusfb_create_object(struct cirrus_fbdev *afbdev,
>  {
>  	struct drm_device *dev = afbdev->helper.dev;
>  	struct cirrus_device *cdev = dev->dev_private;
> -	u32 bpp, depth;
> +	u32 bpp;
>  	u32 size;
>  	struct drm_gem_object *gobj;
> -
>  	int ret = 0;
> -	drm_fb_get_bpp_depth(mode_cmd->pixel_format, &depth, &bpp);
> +
> +	bpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0) * 8;
>  
>  	if (!cirrus_check_framebuffer(cdev, mode_cmd->width, mode_cmd->height,
>  				      bpp, mode_cmd->pitches[0]))
> diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c
> index 76bcb43e7c06..2c3c0d4072ce 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_main.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_main.c
> @@ -52,10 +52,10 @@ cirrus_user_framebuffer_create(struct drm_device *dev,
>  	struct cirrus_device *cdev = dev->dev_private;
>  	struct drm_gem_object *obj;
>  	struct cirrus_framebuffer *cirrus_fb;
> +	u32 bpp;
>  	int ret;
> -	u32 bpp, depth;
>  
> -	drm_fb_get_bpp_depth(mode_cmd->pixel_format, &depth, &bpp);
> +	bpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0) * 8;
>  
>  	if (!cirrus_check_framebuffer(cdev, mode_cmd->width, mode_cmd->height,
>  				      bpp, mode_cmd->pitches[0]))
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index daecf1ad76a4..3a6309d7d8e4 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -138,12 +138,12 @@  static int cirrusfb_create_object(struct cirrus_fbdev *afbdev,
 {
 	struct drm_device *dev = afbdev->helper.dev;
 	struct cirrus_device *cdev = dev->dev_private;
-	u32 bpp, depth;
+	u32 bpp;
 	u32 size;
 	struct drm_gem_object *gobj;
-
 	int ret = 0;
-	drm_fb_get_bpp_depth(mode_cmd->pixel_format, &depth, &bpp);
+
+	bpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0) * 8;
 
 	if (!cirrus_check_framebuffer(cdev, mode_cmd->width, mode_cmd->height,
 				      bpp, mode_cmd->pitches[0]))
diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c
index 76bcb43e7c06..2c3c0d4072ce 100644
--- a/drivers/gpu/drm/cirrus/cirrus_main.c
+++ b/drivers/gpu/drm/cirrus/cirrus_main.c
@@ -52,10 +52,10 @@  cirrus_user_framebuffer_create(struct drm_device *dev,
 	struct cirrus_device *cdev = dev->dev_private;
 	struct drm_gem_object *obj;
 	struct cirrus_framebuffer *cirrus_fb;
+	u32 bpp;
 	int ret;
-	u32 bpp, depth;
 
-	drm_fb_get_bpp_depth(mode_cmd->pixel_format, &depth, &bpp);
+	bpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0) * 8;
 
 	if (!cirrus_check_framebuffer(cdev, mode_cmd->width, mode_cmd->height,
 				      bpp, mode_cmd->pitches[0]))