From patchwork Tue Mar 19 21:57:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10860477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F4B06C2 for ; Tue, 19 Mar 2019 21:58:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 061BE29918 for ; Tue, 19 Mar 2019 21:58:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE1102991C; Tue, 19 Mar 2019 21:58:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8CA1A2965F for ; Tue, 19 Mar 2019 21:58:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CDF4289C51; Tue, 19 Mar 2019 21:58:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4853289C3F for ; Tue, 19 Mar 2019 21:58:27 +0000 (UTC) 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 relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 30364240003; Tue, 19 Mar 2019 21:58:24 +0000 (UTC) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Sean Paul , Maxime Ripard , Mauro Carvalho Chehab Subject: [RFC PATCH 14/20] drm/omap: Convert to generic image format library Date: Tue, 19 Mar 2019 22:57:19 +0100 Message-Id: <49fd5e9fe1712ca4c6aee2e376ffda2cec11bc13.1553032382.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sakari Ailus , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Kocialkowski , Hans Verkuil , Laurent Pinchart , Thomas Petazzoni , linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now that we have a generic image format libary, let's convert drivers to use it so that we can deprecate the old DRM one. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/omapdrm/dss/dispc.c | 9 +++++---- drivers/gpu/drm/omapdrm/omap_fb.c | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index ba82d916719c..bf60d49ad6ca 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1898,9 +1899,9 @@ static void dispc_ovl_set_scaling_uv(struct dispc_device *dispc, int scale_x = out_width != orig_width; int scale_y = out_height != orig_height; bool chroma_upscale = plane != OMAP_DSS_WB; - const struct drm_format_info *info; + const struct image_format_info *info; - info = drm_format_info(fourcc); + info = image_format_drm_lookup(fourcc); if (!dispc_has_feature(dispc, FEAT_HANDLE_UV_SEPARATE)) return; @@ -2623,9 +2624,9 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, bool ilace = !!(vm->flags & DISPLAY_FLAGS_INTERLACED); unsigned long pclk = dispc_plane_pclk_rate(dispc, plane); unsigned long lclk = dispc_plane_lclk_rate(dispc, plane); - const struct drm_format_info *info; + const struct image_format_info *info; - info = drm_format_info(fourcc); + info = image_format_drm_lookup(fourcc); /* when setting up WB, dispc_plane_pclk_rate() returns 0 */ if (plane == OMAP_DSS_WB) diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 1d4143adf829..8caecfc8d1db 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -15,6 +15,7 @@ * this program. If not, see . */ +#include #include #include @@ -60,7 +61,7 @@ struct plane { struct omap_framebuffer { struct drm_framebuffer base; int pin_count; - const struct drm_format_info *format; + const struct image_format_info *format; struct plane planes[2]; /* lock for pinning (pin_count and planes.dma_addr) */ struct mutex lock; @@ -72,7 +73,7 @@ static const struct drm_framebuffer_funcs omap_framebuffer_funcs = { }; static u32 get_linear_addr(struct drm_framebuffer *fb, - const struct drm_format_info *format, int n, int x, int y) + const struct image_format_info *format, int n, int x, int y) { struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); struct plane *plane = &omap_fb->planes[n]; @@ -126,7 +127,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, struct drm_plane_state *state, struct omap_overlay_info *info) { struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); - const struct drm_format_info *format = omap_fb->format; + const struct image_format_info *format = omap_fb->format; struct plane *plane = &omap_fb->planes[0]; u32 x, y, orient = 0;