Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4508073rwd; Tue, 23 May 2023 08:34:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5uMpsABdluen0V/45CJ5WP2PlBQS0QeJ4mmUwB8iNI55PY/M3F90U/eFjnco4n2W5eDhO/ X-Received: by 2002:a17:90b:4f8b:b0:255:c061:9e6b with SMTP id qe11-20020a17090b4f8b00b00255c0619e6bmr1030745pjb.11.1684856091280; Tue, 23 May 2023 08:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684856091; cv=none; d=google.com; s=arc-20160816; b=kEgm5y/TdOaSyrRMQOXvDgg1hEvFepeSx8W5ucREneY+058zhKQj+tm9AREbr3VoRb RkRqCUTx7wHXOe/6pTPGskd4qPNItaj9dBhSkBKNJBly1zvdhBei/gc71YaNMwGd6YUI 3AAvKJRBviDYg9JBUoTPGXmV1r3p8Fz1+Y+kSrC/Fv2xmK1o85si+XIMACxUH5yfbCFG hnIhjwD26LklpRx7mRSyefEh8vjhzglvHD+3y/aQPUxA8zTciGRFhdi81TPz06gHxktX 3pIhdVgOlaB5IyGxIEm0WHECDvuy83MLjjRfWs02NCXmYDCp3xenSuMs09QvgoQJKbHc Heew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2zHZeFbN8WN/FZl1l1J9QQPFcrvcCuNqm14o5uNQdQQ=; b=oTZpBCwu/f3jl/wBtHo1406DIgf0xW4Tki33lPscvFVuu4bRSNQHB9UjK1Fj3vN6PY z+QlKV+bRofKdyMaOrq8AJBmx8qoeYxnk92DuAcvlHMGuWfGITU9p1xH2JzRDarl+QRy gGkemw/KG5zXombFn8gxSxnabui5DI4HlJKDrq/RyuOes1htehKd+kLtbCIx+aWDJ0gX xEhibhe5rts5Z3Zck/3xeWh5EIs2+sHw1zGIFqhEHBGHIhOoldHD9kEcdg5kXu+GWsah chVphP0SbaLhCRbVpDwrC+k0pZMBGQgVqF8Q97lC1e6YQvxXmPhda8hdMDdtTkDs7jFo 8p6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy21-20020a17090b021500b0024770f5087csi8442023pjb.120.2023.05.23.08.34.35; Tue, 23 May 2023 08:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237339AbjEWPbt (ORCPT + 99 others); Tue, 23 May 2023 11:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237530AbjEWPbn (ORCPT ); Tue, 23 May 2023 11:31:43 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58C61132 for ; Tue, 23 May 2023 08:31:42 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:b0ac:7afd:272:4cff]) by albert.telenet-ops.be with bizsmtp id 0FXf2A0050Jkz7G06FXfJX; Tue, 23 May 2023 17:31:40 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1q1Tyu-002t3Z-Ii; Tue, 23 May 2023 17:31:39 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1q1Tz9-00Ckas-0y; Tue, 23 May 2023 17:31:39 +0200 From: Geert Uytterhoeven To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurent Pinchart , Kieran Bingham Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 2/5] drm: shmobile: Add support for DRM_FORMAT_XRGB8888 Date: Tue, 23 May 2023 17:31:34 +0200 Message-Id: <888cde6d1f70f1610931c4a89801060bb6765ff2.1684854992.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DRM_FORMAT_XRGB8888 aka XR24 is the modus francus of DRM, and should be supported by all drivers. The handling for DRM_FORMAT_XRGB8888 is similar to DRM_FORMAT_ARGB8888, just ignore the alpha channel. Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart --- v3: - No changes, v2: - Add Reviewed-by. --- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 1 + drivers/gpu/drm/shmobile/shmob_drm_kms.c | 5 +++++ drivers/gpu/drm/shmobile/shmob_drm_plane.c | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index 713a7612244c647a..08dc1428aa16caf0 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c @@ -232,6 +232,7 @@ static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) value = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS; break; case DRM_FORMAT_ARGB8888: + case DRM_FORMAT_XRGB8888: default: value = LDDDSR_LS; break; diff --git a/drivers/gpu/drm/shmobile/shmob_drm_kms.c b/drivers/gpu/drm/shmobile/shmob_drm_kms.c index 3c5fe3bc183c7c13..99381cc0abf3ae1f 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_kms.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_kms.c @@ -39,6 +39,11 @@ static const struct shmob_drm_format_info shmob_drm_format_infos[] = { .bpp = 32, .yuv = false, .lddfr = LDDFR_PKF_ARGB32, + }, { + .fourcc = DRM_FORMAT_XRGB8888, + .bpp = 32, + .yuv = false, + .lddfr = LDDFR_PKF_ARGB32, }, { .fourcc = DRM_FORMAT_NV12, .bpp = 12, diff --git a/drivers/gpu/drm/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/shmobile/shmob_drm_plane.c index 604ae23825daaafd..850986cee848226a 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_plane.c @@ -80,6 +80,7 @@ static void __shmob_drm_plane_setup(struct shmob_drm_plane *splane, format |= LDBBSIFR_SWPL | LDBBSIFR_SWPW | LDBBSIFR_SWPB; break; case DRM_FORMAT_ARGB8888: + case DRM_FORMAT_XRGB8888: default: format |= LDBBSIFR_SWPL; break; @@ -95,6 +96,9 @@ static void __shmob_drm_plane_setup(struct shmob_drm_plane *splane, case DRM_FORMAT_ARGB8888: format |= LDBBSIFR_AL_PK | LDBBSIFR_RY | LDDFR_PKF_ARGB32; break; + case DRM_FORMAT_XRGB8888: + format |= LDBBSIFR_AL_1 | LDBBSIFR_RY | LDDFR_PKF_ARGB32; + break; case DRM_FORMAT_NV12: case DRM_FORMAT_NV21: format |= LDBBSIFR_AL_1 | LDBBSIFR_CHRR_420; @@ -231,6 +235,7 @@ static const uint32_t formats[] = { DRM_FORMAT_RGB565, DRM_FORMAT_RGB888, DRM_FORMAT_ARGB8888, + DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12, DRM_FORMAT_NV21, DRM_FORMAT_NV16, -- 2.34.1