From nobody Tue Nov 26 10:39:25 2024 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 9A7C2191F7A for ; Fri, 18 Oct 2024 21:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288172; cv=none; b=WwyyP3cVy36YWxOQ8ma1HGfwm7I8ONuyTF8xRF3MJEHtC9PkOyVBtjTZHBHKe2fGxn2j+c7E5040QqZC3582KNQS1oOsYPmc0qw+dW4llhltt+DcI/5TUaRihfxJ9FTsqdhQGuirrRHJ4aGyZKKHlYsnDZrJhtKkeMRhqP5qvgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288172; c=relaxed/simple; bh=ugTosUslB7wYiUqpHQuS1lhI0s68LhvrkUMBV1pOZG0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p+J5KcXCCgzBYAnkXmG3tWHz7GVwNeFfkK6BIjtnxAbZ2ozYEsnF4FwkqcDOQY+P8epJ5iYhq0hBZA6LZMeqnqgYjYtwMP+Z/dCmv/m14rGr1VaAKWVXjeU9/jRwx/D74h9VexXnanW3hcA01M8gNy+zf3aKgr9Rw+wNL1I6sYk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=kemSWovo; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kemSWovo" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-539f4d8ef66so3691298e87.1 for ; Fri, 18 Oct 2024 14:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288169; x=1729892969; 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=7DkvTcvtzrj+vI5w26rcakY7Zkomm18gg55vGgQd3cg=; b=kemSWovoxGx6UMT3WhsSxWD5YdpmmmfDATNJwMyjWkIvCg5M4vaLZRVuBRKn3xXt2/ kYhGx/GIxU21lX4LI7pbsIkndBI9THzI04L6ELOSm/nwmp9ciXDypP6H7bNMTLG0tzk5 maalTOXLjSZqSQcDLUXOU0jSpSxB9EvgpAjYnGLNrHBsj9eKGkdVOaOqAvG7OyXQCybS s9sbBQNzkbRi1LnYCjfHoNaXnY6hNNRpuPJEXejYPI7HHMwhpSdQmpc1TCNa+SjkF03N gqOKRNUcVCCRGnbHrhW+EAZ7jv3m15jh1SQAXKg51q5JrcgBfI3UuDv5thDvm/Goe6Y4 YRlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288169; x=1729892969; 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=7DkvTcvtzrj+vI5w26rcakY7Zkomm18gg55vGgQd3cg=; b=cK+9iJ1v2MMsMohzEjK7KQs9VRWl0M8Z0k1dP7fPIaC46HVkwSIYV4RoaIm9j6W3Es hepyFqzO5YWTYiKb5kPEXsz36kM9nhKUmY6AHAhYhmmr3KmoYsLEBO1CHvLJAxM4OOxk n6WYgrDnyGfGOeIENTtDkt2WNe5uCYa/fQLFZJGNfdPUphlIteh/+vanJfcxyIbOKswt ZKfTjH0/RL68h8rOANJDa+7eCSVEJGteKhy+iYpPLWo7BvVzN6DlkStZzgksXSLRKq/0 GggpTURNSNOBoqgyTa57qSmBzRkLJrquh6L32ZBaaMBYEtQ3HmiCJUPtTuXnKQDAnLQz wHYQ== X-Forwarded-Encrypted: i=1; AJvYcCU9XPXaXizjnavHkB4C66flsmAV0tRS7Vqp61Ax9uaeOJSjwdAYqEBmcshQGFUIWpyBJqwce2pFzh1quHk=@vger.kernel.org X-Gm-Message-State: AOJu0YxLbFh/r+G2d5nXyu2tgw/QZ8UZYE5x9VQOluS17RCZt1TPdJK5 RNzz19J+ln7hnEcs99hObw9VNRat1fIL4+V/bNKGXaBJY0h0NonYVDI9YSPthz0= X-Google-Smtp-Source: AGHT+IEdC8loWBskIO3ec47CgiS3ugrBsDjwPbv5xYeMyu2Akw/gZ0odKdi14u5bdzJYJeWuO3Cw1Q== X-Received: by 2002:a05:6512:2396:b0:536:54df:bffa with SMTP id 2adb3069b0e04-53a1544c1e8mr2768234e87.45.1729288168661; Fri, 18 Oct 2024 14:49:28 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a151f0ce5sm332088e87.181.2024.10.18.14.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:27 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:16 +0300 Subject: [PATCH 5/6] drm/msm/dp: migrate the ycbcr_420_allowed to drm_bridge 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: <20241019-bridge-yuv420-v1-5-d74efac9e4e6@linaro.org> References: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> In-Reply-To: <20241019-bridge-yuv420-v1-0-d74efac9e4e6@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3851; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=ugTosUslB7wYiUqpHQuS1lhI0s68LhvrkUMBV1pOZG0=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEtfdCMWS3IEeYl04oBE5MQmiiYn7fcPZlBXfM P3seFVF/PuJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLX3QAKCRCLPIo+Aiko 1YMjB/wMXVy2Q15F0LL8KfsS+vI2vd9tB7X/2igt44qCY9V/YD7aYTGLdxLWdbcDrxQN5u9Mcwh zw1Jv6DFYlV1pFvCsNZUscq3eBivP0SSQWq5ASyu5y3KpXIEb4LIrWQdCuo34zNSNp1O2VqZUXc aYJwBkRlnW3GxmOtYp9V2o4IjKVWglBgHxctzLV0EQQshkTvWjUwSb2YjpNllMgZrQy2BU3cARG 2dxcJfnRCBNhorNeFbjps9ZBZo8NZXiehcXpL/MdalVwzWtwjA9OJjrheMeOKcDpuhRwk2hc/fC YODvL7pzINueMvI4JEybtw/B2labB9J/5nnSUiYnYiJ89NYl X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Instead of forcing the ycbcr_420_allowed flag to be set on the created drm_connector, set it on the drm_bridge instance and allow drm_bridge_connecgtor to propagate it to the drm_connector. Signed-off-by: Dmitry Baryshkov Acked-by: Abhinav Kumar Reviewed-by: Neil Armstrong --- drivers/gpu/drm/msm/dp/dp_display.c | 4 ++-- drivers/gpu/drm/msm/dp/dp_drm.c | 10 ++++------ drivers/gpu/drm/msm/dp/dp_drm.h | 7 ++++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/d= p_display.c index e1228fb093ee..0ddd8abca499 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1467,14 +1467,14 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, = struct drm_device *dev, =20 dp_priv =3D container_of(dp_display, struct dp_display_private, dp_displa= y); =20 - ret =3D dp_bridge_init(dp_display, dev, encoder); + ret =3D dp_bridge_init(dp_display, dev, encoder, yuv_supported); if (ret) { DRM_DEV_ERROR(dev->dev, "failed to create dp bridge: %d\n", ret); return ret; } =20 - dp_display->connector =3D dp_drm_connector_init(dp_display, encoder, yuv_= supported); + dp_display->connector =3D dp_drm_connector_init(dp_display, encoder); if (IS_ERR(dp_display->connector)) { ret =3D PTR_ERR(dp_display->connector); DRM_DEV_ERROR(dev->dev, diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_dr= m.c index 1b9be5bd97f1..7eb1621f9e7f 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -289,7 +289,7 @@ static const struct drm_bridge_funcs edp_bridge_ops =3D= { }; =20 int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, - struct drm_encoder *encoder) + struct drm_encoder *encoder, bool yuv_supported) { int rc; struct msm_dp_bridge *dp_bridge; @@ -304,6 +304,7 @@ int dp_bridge_init(struct msm_dp *dp_display, struct dr= m_device *dev, bridge =3D &dp_bridge->bridge; bridge->funcs =3D dp_display->is_edp ? &edp_bridge_ops : &dp_bridge_ops; bridge->type =3D dp_display->connector_type; + bridge->ycbcr_420_allowed =3D yuv_supported; =20 /* * Many ops only make sense for DP. Why? @@ -351,8 +352,8 @@ int dp_bridge_init(struct msm_dp *dp_display, struct dr= m_device *dev, } =20 /* connector initialization */ -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, str= uct drm_encoder *encoder, - bool yuv_supported) +struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, + struct drm_encoder *encoder) { struct drm_connector *connector =3D NULL; =20 @@ -363,9 +364,6 @@ struct drm_connector *dp_drm_connector_init(struct msm_= dp *dp_display, struct dr if (!dp_display->is_edp) drm_connector_attach_dp_subconnector_property(connector); =20 - if (yuv_supported) - connector->ycbcr_420_allowed =3D true; - drm_connector_attach_encoder(connector, encoder); =20 return connector; diff --git a/drivers/gpu/drm/msm/dp/dp_drm.h b/drivers/gpu/drm/msm/dp/dp_dr= m.h index 45e57ac25a4d..ae632fcc407c 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.h +++ b/drivers/gpu/drm/msm/dp/dp_drm.h @@ -19,10 +19,11 @@ struct msm_dp_bridge { =20 #define to_dp_bridge(x) container_of((x), struct msm_dp_bridge, bridge) =20 -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, str= uct drm_encoder *encoder, - bool yuv_supported); +struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, + struct drm_encoder *encoder); int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, - struct drm_encoder *encoder); + struct drm_encoder *encoder, + bool yuv_supported); =20 void dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, struct drm_bridge_state *old_bridge_state); --=20 2.39.5