Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp350303imm; Wed, 18 Jul 2018 03:18:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdq0wSb4VhjPnNPypMb7nIlp4G8IyQCf+x7N4Qe8rlYYuEnAsc/j5EuFd4SB3/xayZtXEWk X-Received: by 2002:a63:4002:: with SMTP id n2-v6mr5043939pga.285.1531909124711; Wed, 18 Jul 2018 03:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531909124; cv=none; d=google.com; s=arc-20160816; b=vUm1+ioxUTaj55zMdzZykXs2IBZrBEoIysQYqWtxYTmt98oc5fkOmoyS/rxbZ+ofbx 8VRNz2LO10G03UtTUdR1oO1RlxLH8TVB1Tls70hb0xCPhsWaqwEq5cWc3QR6UaGi2qpR w1W/KrL5Jqq58fi4pymWPRq94+VtAJrQ4TB3YKC4eBX2+VAHgl9I3Tg5jUNbA/w5sw5j maERjIETS54JV6WmdKJUUFDA1mVb7CZMHkhkwU27pmOtw/sIflPXHkH2pgJhy1GH8v3L qqpTmOZ2i56bl2FVLO/aR6MlYDfeQtVAVSsYvckhnGBSobFFFEZOOz8kQsXoL6istBpY IaDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=0wUCXgJMf5NkJyZ3SQ4R/2xDhh+AoBmmiuv6g3rhX58=; b=NQaqa7x2kw1jKAQltOyXtG3EfYlxH5W5Fr7U+cf5deNTN11b1lH38ZS+/MVwVU83Xs jlX+QaFfKy2ma2OzMVUH/RkAnGGDXutLyqpvIf0U7WAjDC8i6XAaQmtkkS9cUExTU2e6 Xrff/Dk9cOxmVjrFL5AiKlufI8pKQroS6P288Kb5hQwYmv5NB6L1PC2danfyNzXUgsOQ JAyTqAc5J0WM1kOKgT72JKL9GBGHI5xap/7T3txJR02vMod0caJpP0rBUPXc7X696YdH lxbYhu220g4iVs6flgk841sIyJsGIwHHsmcxaKtLkJN69aEWpfsfjjr6qDHqW2fxgNeZ gsPA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s85-v6si3030710pfe.290.2018.07.18.03.18.29; Wed, 18 Jul 2018 03:18:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbeGRKzB (ORCPT + 99 others); Wed, 18 Jul 2018 06:55:01 -0400 Received: from mga03.intel.com ([134.134.136.65]:25358 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbeGRKzB (ORCPT ); Wed, 18 Jul 2018 06:55:01 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2018 03:17:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,369,1526367600"; d="scan'208";a="57800717" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 18 Jul 2018 03:17:42 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 18 Jul 2018 13:17:41 +0300 Date: Wed, 18 Jul 2018 13:17:41 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Ayan Kumar Halder Cc: liviu.dudau@arm.com, brian.starkey@arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, intel-gfx@lists.freedesktop.org, hjc@rock-chips.com, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com, sre@kernel.org, bparrot@ti.com, peter.ujfalusi@ti.com, afd@ti.com, dri-devel@lists.freedesktop.org, maxime.ripard@bootlin.com, wens@csie.org, malidp@foss.arm.com, nd@arm.com Subject: Re: [Intel-gfx] [PATCH 4/5] drm/omapdrm: Substitute format_is_yuv() with format->is_yuv Message-ID: <20180718101741.GU5565@intel.com> References: <1531847626-22248-1-git-send-email-ayan.halder@arm.com> <1531847626-22248-4-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1531847626-22248-4-git-send-email-ayan.halder@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 17, 2018 at 06:13:45PM +0100, Ayan Kumar Halder wrote: > drm_format_info table has a field 'is_yuv' to denote if the format > is yuv or not. The driver is expected to use this instead of > having a function for the same purpose. > > Signed-off-by: Ayan Kumar halder > --- > drivers/gpu/drm/omapdrm/dss/dispc.c | 26 ++++++++++---------------- > 1 file changed, 10 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c > index 84f274c..8d2d7a4 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dispc.c > +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c > @@ -1140,18 +1140,6 @@ static void dispc_ovl_set_color_mode(struct dispc_device *dispc, > REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES(plane), m, 4, 1); > } > > -static bool format_is_yuv(u32 fourcc) > -{ > - switch (fourcc) { > - case DRM_FORMAT_YUYV: > - case DRM_FORMAT_UYVY: > - case DRM_FORMAT_NV12: > - return true; > - default: > - return false; > - } > -} > - > static void dispc_ovl_configure_burst_type(struct dispc_device *dispc, > enum omap_plane_id plane, > enum omap_dss_rotation_type rotation) > @@ -1910,11 +1898,14 @@ 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; > + > + info = drm_format_info(fourcc); Not sure Tomi wants drm usage (apart from the fourccs) inside the dss code. > > if (!dispc_has_feature(dispc, FEAT_HANDLE_UV_SEPARATE)) > return; > > - if (!format_is_yuv(fourcc)) { > + if (!info->is_yuv) { > /* reset chroma resampling for RGB formats */ > if (plane != OMAP_DSS_WB) > REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), > @@ -2632,6 +2623,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; > + > + info = drm_format_info(fourcc); > > /* when setting up WB, dispc_plane_pclk_rate() returns 0 */ > if (plane == OMAP_DSS_WB) > @@ -2640,7 +2634,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, > if (paddr == 0 && rotation_type != OMAP_DSS_ROT_TILER) > return -EINVAL; > > - if (format_is_yuv(fourcc) && (in_width & 1)) { > + if (info->is_yuv && (in_width & 1)) { > DSSERR("input width %d is not even for YUV format\n", in_width); > return -EINVAL; > } > @@ -2680,7 +2674,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, > DSSDBG("predecimation %d x %x, new input size %d x %d\n", > x_predecim, y_predecim, in_width, in_height); > > - if (format_is_yuv(fourcc) && (in_width & 1)) { > + if (info->is_yuv && (in_width & 1)) { > DSSDBG("predecimated input width is not even for YUV format\n"); > DSSDBG("adjusting input width %d -> %d\n", > in_width, in_width & ~1); > @@ -2688,7 +2682,7 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, > in_width &= ~1; > } > > - if (format_is_yuv(fourcc)) > + if (info->is_yuv) > cconv = 1; > > if (ilace && !fieldmode) { > -- > 2.7.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Ville Syrj?l? Intel