Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3214887imu; Sat, 24 Nov 2018 00:17:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/XQ1m9X2IeER7YWX6oNKj+jsQ5aWeCsfoRadq8venc/VAH+qnsZRidTI67S6CShwTZnXtk7 X-Received: by 2002:a63:134f:: with SMTP id 15mr17018874pgt.19.1543047421948; Sat, 24 Nov 2018 00:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047421; cv=none; d=google.com; s=arc-20160816; b=mxqkwLo6kVWmLTbRkcMWCzb+5ljFgkvZo6/3nObwoCNg4O8t2AX0IjTmLmSLQ9m2m4 N+5ktuzLrTCWGhF75aFL3l5G4XgFT9tptBN8YOOPyei7XkQaeSIVcrQfbjIhMHCRkT/x CR1Sua/8EVZK1cNJTRIngDOr2ntZVhlSfOa3RZa26u++T5SqQnBleG0iW+Ya3HZu/H4g 3xpxWuBXqcIBHbkfq53wKvimzwHkv/zJKGgoO2KpVGtIJwwAm7KWlLDY8VN4OaEwse7N oBEsF7rdjlQbyIZ9EtqZhQG1Ivuemf1evWEZLCbK6xzvauXYc2jicVdCwnnZSYEVOTUM G3AQ== 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=KyduWRHeqcF9lNUaOcTwiBlqgAgjh68Ovhb3qXcmk/Y=; b=RN2U2RWv3YflWDxbUMcmloIvtQHRdmQ0lwiamyvo5E1slvYqeSJ7qxq/RotF+cTydO bK/a86O7/zSmky0GJE1JceEMb20lCyvjm9jGuouHqnbGgfKprDpAx48WNO8jHRFZFB4f x3Eltl1UrIqkuTCERhR2LK3uMXUDztfSdKJURsRPKpKIO2OfmwVmrPvez5nDUNQckOrf dxgCkdFTIAjf6nPGrg6xy6eVzEt5UsZaPc/se5W2FXsPAXYvFavL/835TdZit3+YGh68 5UR4s3GiKud10kIHk7Y0X7yjveTZscsUOD9pPnveuem74xpiXPlrB3yaRZOKREsaIzOH H+EA== 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 27si55204161pgp.135.2018.11.24.00.16.47; Sat, 24 Nov 2018 00:17:01 -0800 (PST) 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 S2502691AbeKWUKR (ORCPT + 99 others); Fri, 23 Nov 2018 15:10:17 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49274 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390496AbeKWUKQ (ORCPT ); Fri, 23 Nov 2018 15:10:16 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id CF99E20DD7; Fri, 23 Nov 2018 10:26:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id CCC9420DD8; Fri, 23 Nov 2018 10:26:30 +0100 (CET) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Chen-Yu Tsai , Thomas Petazzoni , linux-sunxi@googlegroups.com, Daniel Vetter , Paul Kocialkowski Subject: [PATCH v2 13/43] drm/sun4i: backend: Use explicit fourcc helpers for packed YUV422 check Date: Fri, 23 Nov 2018 10:24:45 +0100 Message-Id: <20181123092515.2511-14-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> References: <20181123092515.2511-1-paul.kocialkowski@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 Checking for the number of planes is not sufficient to en ensure that the format is a packed YUV422. Use explicit fourcc helpers for the check instead. Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/sun4i/sun4i_backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 52caf561da0e..30d7bc76c0af 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -238,7 +238,8 @@ static int sun4i_backend_update_yuv_format(struct sun4i_backend *backend, SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN); /* TODO: Add support for the multi-planar YUV formats */ - if (format->num_planes == 1) + if (drm_format_info_is_yuv_packed(format) && + drm_format_info_is_yuv_sampling_422(format)) val |= SUN4I_BACKEND_IYUVCTL_FBFMT_PACKED_YUV422; else DRM_DEBUG_DRIVER("Unsupported YUV format (0x%x)\n", fmt); -- 2.19.1