Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3215442imu; Sat, 24 Nov 2018 00:17:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/UCv3MMf+FTbH08yg2XD9MB3pHrT7BDh9B1YUiCTWczr2uaLGtXqClC0aOWQWEe5YJramF6 X-Received: by 2002:a17:902:780a:: with SMTP id p10mr19616689pll.54.1543047468617; Sat, 24 Nov 2018 00:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047468; cv=none; d=google.com; s=arc-20160816; b=ITYJVJzeKOshUEAlXhswWtfZtwvZCpZtjHHhmx0row7OOVppn/fFp/K/KlNYqzRrGm y4o8Mcl984HIWrnFprlr7qI4vVbV6s67UZJT54XzBeEKPc6g9bZmTP9TlFKh1asXqkAl t/OlSCdb/puv0/p9yLA/DZe/Cowh9HaJ4ZI2PKOLDIz/p2hoR4FOhNjedbHamIGZFH4x FtqUHMggnRZfDwnPZg965P8bDmZFlSEwU1b6XrJMVeykLm2+ccwiNwTTnEuW6Hn7ICiH 5T3WKLh2krnPwTTFoY6cZsPFYK5/WFAses7DkvBZl9Gjkul8mS+V4nTkhNBFxMsV4Kix EQiA== 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=GHeBYTyk1AG90zE/NAavHGyOoeckwqj/YAJ8vduL1sE=; b=CJllUSAsfCjrZVZowq0WTGTdmqA2j9q+0jpU00cRLVG3zlERyzPBPUCP9JHim/Z62o SJAAKlrGABgP7S9ym86QD+kgY/PwESsj7QfRgzzOGHmU+Fp1M74p/FjxazkooVnD9RoV NxbqpWCFAPzUcuVtDSDhOVPgMzEC7TKDrsryr1G74uYOGPbXduSYTyw/b+YEgypfWo0S XCPOTDdoDuZCm5zrZLqDdVut98vboo5cDQxls/xEC42rWn4/vv7RfW8B7rUp0ZhGCYoj FQleTm4ukPA4os6ms2kB68Z0vB4HjNvGAll8pjMOAsD4PEd2gJvFM2X2A40xYo0xXC8j /gUQ== 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 j14si42464729pfd.113.2018.11.24.00.17.34; Sat, 24 Nov 2018 00:17:48 -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 S2408964AbeKWUKa (ORCPT + 99 others); Fri, 23 Nov 2018 15:10:30 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49408 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502714AbeKWUK0 (ORCPT ); Fri, 23 Nov 2018 15:10:26 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 30BD620DE4; Fri, 23 Nov 2018 10:26:58 +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 EA25420DF0; Fri, 23 Nov 2018 10:26:32 +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 21/43] drm/sun4i: frontend: Add support for the BGRX8888 input format Date: Fri, 23 Nov 2018 10:24:53 +0100 Message-Id: <20181123092515.2511-22-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 This introduces support for the BGRX8888 input format for the frontend, with its associated pixel sequence value definition. Other fields are already configured correctly as they no longer depend on the format's fourcc directly. Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/sun4i/sun4i_frontend.c | 5 +++++ drivers/gpu/drm/sun4i/sun4i_frontend.h | 1 + drivers/gpu/drm/sun4i/sun4i_layer.c | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index 7a8efbd516ac..e579fcf63ab4 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -127,6 +127,10 @@ static int sun4i_frontend_drm_format_to_input_mode(uint32_t fmt, u32 *val) static int sun4i_frontend_drm_format_to_input_sequence(uint32_t fmt, u32 *val) { switch (fmt) { + case DRM_FORMAT_BGRX8888: + *val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX; + return 0; + case DRM_FORMAT_XRGB8888: *val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB; return 0; @@ -149,6 +153,7 @@ static int sun4i_frontend_drm_format_to_output_fmt(uint32_t fmt, u32 *val) } static const uint32_t sun4i_frontend_formats[] = { + DRM_FORMAT_BGRX8888, DRM_FORMAT_XRGB8888, }; diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.h b/drivers/gpu/drm/sun4i/sun4i_frontend.h index 56bd5a3f9723..2ee1bccf378a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.h +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.h @@ -28,6 +28,7 @@ #define SUN4I_FRONTEND_INPUT_FMT_REG 0x04c #define SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED (1 << 8) #define SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB (5 << 4) +#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX 0 #define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB 1 #define SUN4I_FRONTEND_OUTPUT_FMT_REG 0x05c diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index c3368b17e5f1..6155eca6b1bd 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -131,6 +131,7 @@ static const uint32_t sun4i_layer_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_ARGB4444, DRM_FORMAT_ARGB1555, + DRM_FORMAT_BGRX8888, DRM_FORMAT_RGBA5551, DRM_FORMAT_RGBA4444, DRM_FORMAT_RGB888, -- 2.19.1