Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1967307yba; Fri, 10 May 2019 04:15:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjgsDBslnTlU9XQ0H78GULfUFgFVr+8SYCz8O+ZqUbc4tEWD6VMCy4sSn/4M/f6wrxXUUu X-Received: by 2002:aa7:8e14:: with SMTP id c20mr13122883pfr.14.1557486920915; Fri, 10 May 2019 04:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557486920; cv=none; d=google.com; s=arc-20160816; b=T/cBr3PfuTaMOBwrSaH3Lmnn591M29SEPDd84sN+0CQZLRh9pyUg/7BlTuVw+JoO4u VJ/O4nVDQwk38xyXyRbfQQjf79s97HYyPBQ825lgFl/6wRIOoVI/uCeLE+46XNHj7ph0 GXnXXDtNzTnWSk1mavf1qqlmjeH7k+dBkHjGgdX8JeZ74A3kDvAuJRVt5XqDWVGFuGYA dq5BIryfo3tg9rQzUZEVAQw5KqTRUjFk3yFaYpQeUqsZPH925m0GVvy5smvhqOxyBsVH 1sZcY23/5Sm0zJ4AaYh0HO7liblw4SaQuTdEJeo2HlIYSi0/ixpuRH6K/rGqU2by4K+M 6tlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sCchvcO7w4xemy0crAngXcsbnOAl2LbW6X0jzRzk9ew=; b=Q4RVi+2pt5gtW1pZ5NV8Ret1s5TDf4Z/LuQQQ7jxcxB2oeKbLtgWt8vT2c4/eSlDgB divkHgQfGDaTVjsvY3QESx3cCEpWxwar45UKdkrGZVPBxvj6nHBsS52wNPW7gVx3NHSj mG/CgslhXVsFOv8NufNdAuhMaQvUKQ+uLOSGgjyjhuEB7K6TReqrrTsSF4bjci1jalCu +oK/dwpIpauRt985t5cU33MzXO82UenWUSTaUSsvijGe6Ro0yFtN51pCImSdVWwVocdP b6ksFjRx2mE+DexjRoFZtXnfqf6lttGL3cJ+mDrZ6/dLSIVRlpH2RMHWkbxXQV3sN6bn 0K/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si6559006pgh.517.2019.05.10.04.15.04; Fri, 10 May 2019 04:15:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbfEJLJK (ORCPT + 99 others); Fri, 10 May 2019 07:09:10 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:47029 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbfEJLJI (ORCPT ); Fri, 10 May 2019 07:09:08 -0400 X-Originating-IP: 90.89.68.76 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (Authenticated sender: maxime.ripard@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id E48A5FF80F; Fri, 10 May 2019 11:09:05 +0000 (UTC) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Sean Paul , Maxime Ripard Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Emil Velikov , Paul Kocialkowski Subject: [PATCH v2 6/6] drm: Replace instances of drm_format_info by drm_get_format_info Date: Fri, 10 May 2019 13:08:51 +0200 Message-Id: <5859d68664b8f0804a56e7386937f6db986b9e0f.1557486447.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1557486447.git-series.maxime.ripard@bootlin.com> References: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1557486447.git-series.maxime.ripard@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drm_get_format_info directly calls into drm_format_info, but takes directly a struct drm_mode_fb_cmd2 pointer, instead of the fourcc directly. It's shorter to not dereference it, and we can customise the behaviour at the driver level if we want to, so let's switch to it where it makes sense. Reviewed-by: Emil Velikov Reviewed-by: Paul Kocialkowski Signed-off-by: Maxime Ripard --- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++-- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index 06e73a343724..6edae6458be8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c @@ -121,8 +121,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **gobj_p) { - const struct drm_format_info *info = drm_get_format_info(dev, - mode_cmd); + const struct drm_format_info *info; struct amdgpu_device *adev = rfbdev->adev; struct drm_gem_object *gobj = NULL; struct amdgpu_bo *abo = NULL; @@ -133,6 +132,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, int height = mode_cmd->height; u32 cpp; + info = drm_get_format_info(adev->ddev, mode_cmd); cpp = drm_format_info_plane_cpp(info, 0); /* need to align pitch with crtc limits */ diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index a9d3a4a30ab8..1794ab90b2cc 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -232,7 +232,7 @@ static int psb_framebuffer_init(struct drm_device *dev, * Reject unknown formats, YUV formats, and formats with more than * 4 bytes per pixel. */ - info = drm_format_info(mode_cmd->pixel_format); + info = drm_get_format_info(dev, mode_cmd); if (!info || !info->depth || info->cpp[0] > 4) return -EINVAL; diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index cfb641363a32..6557b2d6e16e 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -339,7 +339,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, dev, mode_cmd, mode_cmd->width, mode_cmd->height, (char *)&mode_cmd->pixel_format); - format = drm_format_info(mode_cmd->pixel_format); + format = drm_get_format_info(dev, mode_cmd); for (i = 0; i < ARRAY_SIZE(formats); i++) { if (formats[i] == mode_cmd->pixel_format) -- git-series 0.9.1