drm: cirrus: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 17 Oct 2016 22:41:15 +0000 (01:41 +0300)
committerArchit Taneja <architt@codeaurora.org>
Tue, 18 Oct 2016 09:52:06 +0000 (15:22 +0530)
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>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1476744081-24485-8-git-send-email-laurent.pinchart@ideasonboard.com
drivers/gpu/drm/cirrus/cirrus_fbdev.c
drivers/gpu/drm/cirrus/cirrus_main.c

index daecf1ad76a454845775a802c914384d53fa4c9e..3a6309d7d8e42b7963a35fb3b9ed755ecc323116 100644 (file)
@@ -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]))
index 76bcb43e7c06ac2dcf56a4d183e61c869a3544c5..2c3c0d4072ced3957ec4d142cbdc24b6fd3835d0 100644 (file)
@@ -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]))