From: Inki Dae Subject: [PATCH 2/5] drm/exynos: Use struct drm_mode_fb_cmd2 Date: Fri, 09 Dec 2011 19:59:36 +0900 Message-ID: <1323428379-12024-3-git-send-email-inki.dae@samsung.com> References: <1323418995-6492-1-git-send-email-inki.dae@samsung.com> <1323428379-12024-1-git-send-email-inki.dae@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DE869E75D for ; Fri, 9 Dec 2011 02:59:42 -0800 (PST) Received: from epcpsbgm1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LVX00K5HNVGUP60@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 Dec 2011 19:59:41 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([165.213.219.103]) by mmp1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LVX00I1TNVGJT40@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 09 Dec 2011 19:59:41 +0900 (KST) In-reply-to: <1323428379-12024-1-git-send-email-inki.dae@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: airlied@linux.ie, dri-devel@lists.freedesktop.org Cc: Inki Dae , kyungmin.park@samsung.com, sw0312.kim@samsung.com List-Id: dri-devel@lists.freedesktop.org From: Joonyoung Shim The exynos drm also should use struct drm_mode_fb_cmd2 by changes of 308e5bcbdb10452e8aba31aa21432fb67ee46d72 commit(drm: add an fb creation ioctl that takes a pixel format v5). Signed-off-by: Joonyoung Shim Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fb.c | 20 +++++++++----------- drivers/gpu/drm/exynos/exynos_drm_fb.h | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 14 ++++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 5bf4a1a..df5eec6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -104,7 +104,7 @@ static struct drm_framebuffer_funcs exynos_drm_fb_funcs = { static struct drm_framebuffer * exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, - struct drm_mode_fb_cmd *mode_cmd) + struct drm_mode_fb_cmd2 *mode_cmd) { struct exynos_drm_fb *exynos_fb; struct drm_framebuffer *fb; @@ -115,9 +115,6 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, DRM_DEBUG_KMS("%s\n", __FILE__); - mode_cmd->pitch = max(mode_cmd->pitch, - mode_cmd->width * (mode_cmd->bpp >> 3)); - DRM_LOG_KMS("drm fb create(%dx%d)\n", mode_cmd->width, mode_cmd->height); @@ -136,14 +133,14 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, DRM_LOG_KMS("create: fb id: %d\n", fb->base.id); - size = mode_cmd->pitch * mode_cmd->height; + size = mode_cmd->pitches[0] * mode_cmd->height; /* - * mode_cmd->handle could be NULL at booting time or + * mode_cmd->handles[0] could be NULL at booting time or * with user request. if NULL, a new buffer or a gem object * would be allocated. */ - if (!mode_cmd->handle) { + if (!mode_cmd->handles[0]) { if (!file_priv) { struct exynos_drm_gem_buf *buffer; @@ -166,7 +163,7 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, goto out; } else { exynos_gem_obj = exynos_drm_gem_create(dev, file_priv, - &mode_cmd->handle, + &mode_cmd->handles[0], size); if (IS_ERR(exynos_gem_obj)) { ret = PTR_ERR(exynos_gem_obj); @@ -174,7 +171,8 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, } } } else { - obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle); + obj = drm_gem_object_lookup(dev, file_priv, + mode_cmd->handles[0]); if (!obj) { DRM_ERROR("failed to lookup gem object.\n"); goto err_buffer; @@ -214,8 +212,8 @@ err_init: } struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev, - struct drm_file *file_priv, - struct drm_mode_fb_cmd *mode_cmd) + struct drm_file *file_priv, + struct drm_mode_fb_cmd2 *mode_cmd) { DRM_DEBUG_KMS("%s\n", __FILE__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h b/drivers/gpu/drm/exynos/exynos_drm_fb.h index eb35931..52c5982 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.h +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.h @@ -29,8 +29,8 @@ #define _EXYNOS_DRM_FB_H struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev, - struct drm_file *filp, - struct drm_mode_fb_cmd *mode_cmd); + struct drm_file *filp, + struct drm_mode_fb_cmd2 *mode_cmd); void exynos_drm_mode_config_init(struct drm_device *dev); diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 836f410..effdc3f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -126,7 +126,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); struct drm_device *dev = helper->dev; struct fb_info *fbi; - struct drm_mode_fb_cmd mode_cmd = { 0 }; + struct drm_mode_fb_cmd2 mode_cmd = { 0 }; struct platform_device *pdev = dev->platformdev; int ret; @@ -138,8 +138,9 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; - mode_cmd.bpp = sizes->surface_bpp; - mode_cmd.depth = sizes->surface_depth; + mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3); + mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, + sizes->surface_depth); mutex_lock(&dev->struct_mutex); @@ -206,7 +207,7 @@ static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper, struct drm_device *dev = helper->dev; struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); struct drm_framebuffer *fb = exynos_fbdev->fb; - struct drm_mode_fb_cmd mode_cmd = { 0 }; + struct drm_mode_fb_cmd2 mode_cmd = { 0 }; DRM_DEBUG_KMS("%s\n", __FILE__); @@ -220,8 +221,9 @@ static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper, mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; - mode_cmd.bpp = sizes->surface_bpp; - mode_cmd.depth = sizes->surface_depth; + mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3); + mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, + sizes->surface_depth); if (fb->funcs->destroy) fb->funcs->destroy(fb); -- 1.7.4.1