Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp617206img; Wed, 20 Mar 2019 07:29:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvuORIAT34US7NpHo/NcWQkqibbytgPI1+A4vDzD5JFJpW8bartXMPl17f4DsL+5n0NtgN X-Received: by 2002:a17:902:f206:: with SMTP id gn6mr8224885plb.58.1553092155811; Wed, 20 Mar 2019 07:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553092155; cv=none; d=google.com; s=arc-20160816; b=DFHfUCx+UXVRVx6gStVIprrFjKCdHv6VsEdPbT5Tvzg0Kd19lzKgBqnziyYaaJdyTP MLraAscA7MyC0XEOM62tgXoDUU7W7MldQ3LrAK3qWkZm70bUik4X3E0K5yr0HBGYQwKW ptIyy8TT/tx7tcI0z3fxyKcp8372MYvEMP5lBgvGltPKELbVqH+d7L5FQUIhYCn9UIdR CIpFxCBUFw21HAzAi3E0djA41bk9+neBTEkjlDiNFWLjmkjCcs0iVXmS9CAjmJNPKb8u NQUs4DeK/dovlouBbMKSAtju+Tdqnm78DeWS2lEKRyvMk3iiQrd253wmYW6Tqnzwuy4d cvdQ== 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 :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=blKPR189tTkKutp/GDeYM1jSstcf5Y5CvCF5PGshWsQ=; b=SFh1b4LxLvcUWs+T2AfXn4CuunKh5KoWl3V9VwEq1GogL5WlyqfZjqTfHYhMxBWgOx FWlGf3aHqfZfY0gnBEWbehrkyQgjPh+2L2IdGizy5wFpREVKqvllQqFVDdToDapac0Mj KjUfkdXfaTXAOGwPFQGnN+mrsEHZfYeKyCwrJbSICDpFRn83shk0bCjzxT8FZmmFfgVT lc89VavkCwgCHykaVaaRNZoe+suwwiGx13Dk5ePy7Oo04ygsOItzDjfxNfpzQcilrm0k L2rMj9QwhhURWQs1AYENLvhrZeVob4CI4S2epQDmkpPpZQOUivizjqnMpMDn/aSgS4qO DGEg== 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 z67si1833964pfb.278.2019.03.20.07.29.00; Wed, 20 Mar 2019 07:29:15 -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 S1727439AbfCTO1x (ORCPT + 99 others); Wed, 20 Mar 2019 10:27:53 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41139 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbfCTO1w (ORCPT ); Wed, 20 Mar 2019 10:27:52 -0400 X-Originating-IP: 90.88.33.153 Received: from aptenodytes (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 835162000C; Wed, 20 Mar 2019 14:27:49 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH 05/20] drm: Replace instances of drm_format_info by drm_get_format_info From: Paul Kocialkowski To: Maxime Ripard , Daniel Vetter , David Airlie , Maarten Lankhorst , Sean Paul , Mauro Carvalho Chehab Cc: Sakari Ailus , Hans Verkuil , Laurent Pinchart , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Date: Wed, 20 Mar 2019 15:27:49 +0100 In-Reply-To: <2c4461e827cf9a64326962094f7420bfafc5e13b.1553032382.git-series.maxime.ripard@bootlin.com> References: <2c4461e827cf9a64326962094f7420bfafc5e13b.1553032382.git-series.maxime.ripard@bootlin.com> Organization: Bootlin Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.0 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 Hi, Le mardi 19 mars 2019 à 22:57 +0100, Maxime Ripard a écrit : > 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. > > Signed-off-by: Maxime Ripard Makes good sense to me! Reviewed-by: Paul Kocialkowski Cheers, Paul > --- > drivers/gpu/drm/gma500/framebuffer.c | 2 +- > drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c > index c934b3df1f81..46f0078f7a91 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) -- Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com