From nobody Mon Nov 25 17:27:06 2024 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2E52224DB0 for ; Fri, 25 Oct 2024 17:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876580; cv=none; b=UKNffLrQY8UR3lGlGeVvw064muG9rMMTzgJWwCoEIpTXaHxv49JM7Ho/kYYGqI4A3fuGCyOMCxTZQ/hdgcS7NbjnzTJeGU5e/sLdAXK8fu8DpXaBM0ePwNpsrOyBwibsIqzdWgMiVWIJSApLFaTyL366Sbq6i0uW64MFo96E5kM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876580; c=relaxed/simple; bh=UWJvMv3Z0a1PpjzyOCbjoPTg3oDPbd1fp/cxOBSwg9c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NNr3L1WPhoPwveebtI1CDa42r1+2lXf1kp4CjJ3/kRuUVN9WxwmNVT+lbswlyDudcKfNwiRRqmWTz/sctK1E9UB7GrEkCqUzXS4CPZKsGQCvSXjypmlEj0c30ArKZ0TFSBTB9x4R772khQTOrvneisEUFkXZkyK0anYbz43ZOiI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=ttlZGNZV; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ttlZGNZV" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43158625112so22707395e9.3 for ; Fri, 25 Oct 2024 10:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1729876576; x=1730481376; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QATmMbNk3c4g4hXx1UR19WiwFTrUbM+WoGxURwc9BNY=; b=ttlZGNZVB0Ams2NBquHqNmmwhH2GPS2xxMSvClEwatkCAy98C8hAa9vgvRVCQof+fW kblThihRuEMi4SiKp6jeboYyp5rAA7TXXBgw4YJp4r0dtq6GJe2uRZvpumiiH+1PoaFX cnMExDFQj7OHPDdhVKPeA/nGKLJXHXtznyhBgMw6eSDsg4LLS3kmhYOoW4SKfU4j1rkV slAZNqP1IgMXmh/NHPa/2ndn6LMRyUbBe6W4LomXg1ErtX2bPvWa1dz2kJ7oWUSlYjOF OlfrqdujKiZ5xbSjAgPRiY0gj72f2eKFqx4LyxQVaxU6pUcltNKM2H5QUAj5/N4kU839 pmeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729876576; x=1730481376; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QATmMbNk3c4g4hXx1UR19WiwFTrUbM+WoGxURwc9BNY=; b=ZjHSec+JbJpJ4I1UZFZC6K4DtR4AokmIR/ry1eduLlPh3CduAObySQN3Pr4kROwLYE Ri9OeILg3j3ExYBQ6PvzPHrF6nsDtdr7GEbAwBen4BUmt8fK92ynIH2L1Pq1s1vlc159 9lV4ZCR1MIDcsacggoNKDCZtYBVwVMqeB5LV+sz3+KKVRTR8Td6Zb/ZO7euT466P49Bc ofsORtMqYi7f+VczVHGVYfYdwgZm02U/cDVoilGGfiEDJm/0yRAUXnW+igQyIFfmGDCq JnudDCYb4i8mljfrdhVzn4HNfXYMDn0FciaTswWGJgO2Ds99czNXEqohyagCTwDxFc0o KhcQ== X-Forwarded-Encrypted: i=1; AJvYcCVp1SPFkyaZMw6WzV940hfboyVvnnCUeKDDTF9E0giC7zRdVQaCpopIbOXuQeyttevnaqjktk4JmC2D5Mc=@vger.kernel.org X-Gm-Message-State: AOJu0YwpXV/QUzOdsj1+9+xlO8b0zLtQ5HVi2pmQ6f84dHoi58IHnpIS MUEFfwncXFfWxKmdEXv4fxPGa/cFUgQ6HS0+Ji0BAYZxcnpjNYBQU3S31KDKTgA= X-Google-Smtp-Source: AGHT+IE/VfikFrZHBGY91VEfdMxjOv4Me9kCVd0mDGc13MQEknYwxLSPdeWAl2uAqA6slK2aB7I+ww== X-Received: by 2002:adf:fa83:0:b0:37c:d299:b5f0 with SMTP id ffacd0b85a97d-3806120c614mr82922f8f.59.1729876575760; Fri, 25 Oct 2024 10:16:15 -0700 (PDT) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-38058b91f50sm2013649f8f.94.2024.10.25.10.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 10:16:15 -0700 (PDT) From: Dave Stevenson Date: Fri, 25 Oct 2024 18:15:46 +0100 Subject: [PATCH v2 15/36] drm/vc4: txp: Add byte enable toggle bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241025-drm-vc4-2712-support-v2-15-35efa83c8fc0@raspberrypi.com> References: <20241025-drm-vc4-2712-support-v2-0-35efa83c8fc0@raspberrypi.com> In-Reply-To: <20241025-drm-vc4-2712-support-v2-0-35efa83c8fc0@raspberrypi.com> To: Maxime Ripard , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Michael Turquette , Stephen Boyd , Javier Martinez Canillas , Catalin Marinas , Will Deacon Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Dave Stevenson X-Mailer: b4 0.14.1 From: Maxime Ripard The MOPLET doesn't have the BYTE_ENABLE field to set, but the TXP and MOP do, so let's add a boolean to control whether or not we need to set it. Signed-off-by: Maxime Ripard Signed-off-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_drv.h | 1 + drivers/gpu/drm/vc4/vc4_txp.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index e08c90245f94..27deb4cde02d 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -538,6 +538,7 @@ struct vc4_crtc_data { =20 struct vc4_txp_data { struct vc4_crtc_data base; + unsigned int has_byte_enable:1; }; =20 extern const struct vc4_txp_data bcm2835_txp_data; diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index 6fe378b454ca..eaf30b2cfb5b 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -287,6 +287,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_= connector *conn, struct drm_connector_state *conn_state =3D drm_atomic_get_new_connector_s= tate(state, conn); struct vc4_txp *txp =3D connector_to_vc4_txp(conn); + const struct vc4_txp_data *txp_data =3D txp->data; struct drm_gem_dma_object *gem; struct drm_display_mode *mode; struct drm_framebuffer *fb; @@ -309,9 +310,11 @@ static void vc4_txp_connector_atomic_commit(struct drm= _connector *conn, return; =20 ctrl =3D TXP_GO | TXP_EI | - VC4_SET_FIELD(0xf, TXP_BYTE_ENABLE) | VC4_SET_FIELD(txp_fmts[i], TXP_FORMAT); =20 + if (txp_data->has_byte_enable) + ctrl |=3D VC4_SET_FIELD(0xf, TXP_BYTE_ENABLE); + if (fb->format->has_alpha) ctrl |=3D TXP_ALPHA_ENABLE; else @@ -492,6 +495,7 @@ const struct vc4_txp_data bcm2835_txp_data =3D { .hvs_available_channels =3D BIT(2), .hvs_output =3D 2, }, + .has_byte_enable =3D true, }; =20 static int vc4_txp_bind(struct device *dev, struct device *master, void *d= ata) --=20 2.34.1