From patchwork Fri Oct 18 21:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 836736 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 6651318D65C for ; Fri, 18 Oct 2024 21:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288165; cv=none; b=ci/ewQi0mgXBvung7A7o/hHXLbL2R3qDrKStw+MIKafRsswT9rFz1yIiTJpPY2tZg4EP3vaT2e+O9HX2PNkDiaEXefpKhApr5f+lbFJI3N1Vi8LMSScexvDYkhiJR/6OiHiQFNZbLMFrDy4Djia6nZJvjM2N4sjvn38TebCGlis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288165; c=relaxed/simple; bh=XEeB8zSmc5l7zbT8EsjhmWQeibYM5q3N2PhNmNxtKME=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QpqWtGWx8MJrWfjUkOt9GT62EsfCsbjhzWPo7Tn4UborVFpQI+lJlmP3mF1yT9x3UizKUIVx3a3MBZe4Hr0lw9RoSntLC5EwU3Yuk/aKbRUkCVzxH9HGEaLnB3P1pGzWhPR0s8zNGhvssLtAUlD+cH24q52TtBk6c5CW8I4cEuU= 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=DeUtON0E; arc=none smtp.client-ip=209.85.167.54 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="DeUtON0E" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-539f72c8fc1so3065997e87.1 for ; Fri, 18 Oct 2024 14:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288161; x=1729892961; 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=9z8gZhR6xKvHdHJfRz4craU+dxQh5f6YMki2hXyc4YM=; b=DeUtON0EgdAFECGxvmiXBwaURSfnd4pqCy52M9CUwZbK7UKlC5G8XQwtWJYhqh28J1 N8v600XIjW2ELh2Kd7zfGxGikvPpwLyg9v5efDc/JG8KNFSVR/FEuXB11Ny30VuejE5g 4KcJy00afbJvJjaVSaQOFuztydWJ29o76V3giH/EZMmd/0oUcelWw9OWvMS6VMho7eWS 9+UliBzy12sckF+AHyYTXVy4xxraSgzeJqlIkqAdAcw0ThUiWuZ8bM1vqlLYzWTJeqJ7 HAU+CRRgJLUHxBp3TfjG+7y6UF5X4VOYh69A0vYvifx6R312zP/0Nn6y/mqs6zFpBCdN zEJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288161; x=1729892961; 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=9z8gZhR6xKvHdHJfRz4craU+dxQh5f6YMki2hXyc4YM=; b=ek55BkXIzRZlc4NZot1a8kfsVsZMzyx+8ngdtqNGsgI74x03kTfmoksRodXKqYlhnv wPNW8tTFI+CUj014JNrfLTt3bIKwAS7mSXRVSR4f15Iy6tMWtxwYT41Ct//F+dZktI9N abgEqLNVo0BHfb3f0RKodWrs+K5U26N9G0C8YmagKBxVu2ogJ7pL8V6m8acMCZ/+uaw8 deyFL0UDHdjw1/CvVsqRSl5oRXQiZrQicjGrhAW2lR8dUjBlZ+X24otwpMjFLsGx6ONZ D4jKEOeHG3ITOIOj/77q7zPnSRAeX5Z1zFK4RG899v4mFUbM59rYUE7NmwR2f04l/hxO /t9g== X-Forwarded-Encrypted: i=1; AJvYcCUtWHYMWMtt0C51WNRFEg37NFw0tBG+SL+zY215UJMbngIs+1egMY86EW4SrQofqVnGHKkYqFt8+nekne2C@vger.kernel.org X-Gm-Message-State: AOJu0YzBQZBA8uMotIDk5VbENwuMkYxB5s2I1ADmyt1hTxGuiSWvzGOR DhBI73IcWcouCDFb7TlxhlAvwZnOIYNVPf5NWC1+x9MEgtGGoJG66zBsZa1RPRg= X-Google-Smtp-Source: AGHT+IEvBA85x80m9/B/gJoVTav3nM1QjDIWITUKAkImXSQZnUaTDoetNxkyXbVIvGvOnxTTs+hpZQ== X-Received: by 2002:a05:6512:3a8d:b0:536:7362:5923 with SMTP id 2adb3069b0e04-53a1520b285mr2619592e87.1.1729288161371; Fri, 18 Oct 2024 14:49:21 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:21 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:12 +0300 Subject: [PATCH 1/6] drm/display: bridge_connector: handle ycbcr_420_allowed Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-1-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=2190; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=XEeB8zSmc5l7zbT8EsjhmWQeibYM5q3N2PhNmNxtKME=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnEtfdkI2xvvDyeAfQVDQUi0tdefgLR6vV7buRI tI484ScB1+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZxLX3QAKCRCLPIo+Aiko 1WeWCAClFBFBl2ZmrqDc2fZN2aSCu3RdrzJkvaupwJdyhURATXsaWpT9bGsmOd2MjKTxT0Loq9p C8WpoBOLd6UjVr13L7T8l6Sq3H77uEMREgloAxbbLVaW05xKTeFdS/KSTJr5oABdtTDqZzsxg0a slmypGrkSSKs3m2pJ/DXM/2yZYvIrGD8OmlpV1P5VSrCKXjNvMsek2LHuHrBDKxtfqjjTxMjDIl /ZBvupf/oBQ5XheDg1XSudap4ydX+m2c6+pZUkxgA/53WVDoyKOv5rDrinCM9gnbKDAFnC8Cm6z PiycyIZiFvnah4d49hQ0ije+kgj0w9K8xM9FIx6zlu5k5KN6 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Follow the interlace_allowed example and calculate drm_connector's ycbcr_420_allowed flag as AND of all drm_bridge's ycbcr_420_allowed flags in a chain. This is one of the gaps between several bridge-specific connector implementations and drm_bridge_connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/display/drm_bridge_connector.c | 6 ++++-- include/drm/drm_bridge.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 3da5b8bf8259..320c297008aa 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -397,11 +397,11 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, bridge_connector->encoder = encoder; /* - * TODO: Handle doublescan_allowed, stereo_allowed and - * ycbcr_420_allowed. + * TODO: Handle doublescan_allowed and stereo_allowed. */ connector = &bridge_connector->base; connector->interlace_allowed = true; + connector->ycbcr_420_allowed = true; /* * Initialise connector status handling. First locate the furthest @@ -414,6 +414,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, drm_for_each_bridge_in_chain(encoder, bridge) { if (!bridge->interlace_allowed) connector->interlace_allowed = false; + if (!bridge->ycbcr_420_allowed) + connector->ycbcr_420_allowed = false; if (bridge->ops & DRM_BRIDGE_OP_EDID) bridge_connector->bridge_edid = bridge; diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 75019d16be64..e8d735b7f6a4 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -802,6 +802,11 @@ struct drm_bridge { * modes. */ bool interlace_allowed; + /** + * @ycbcr_420_allowed: Indicate that the bridge can handle YCbCr 420 + * output. + */ + bool ycbcr_420_allowed; /** * @pre_enable_prev_first: The bridge requires that the prev * bridge @pre_enable function is called before its @pre_enable, From patchwork Fri Oct 18 21:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 836735 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 83D51190685 for ; Fri, 18 Oct 2024 21:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288170; cv=none; b=bjK8Ymd2Vj1MZ3jxCBLZMxjrXagJJGRanRnp5+g/G9xogN4dNkJ/puY2s1d9h8KCAfYcZfbJZw3ZYQntgCydoL+YYVI/PfWBL4CptQ4iqSlqoj1kSaHM7mHkyex+Xgj2T93MviDk50BTnlrY012t+Fh9g76WqkeB2QiwuLGfDMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288170; c=relaxed/simple; bh=pZFlU5ikCJDIckLBlIAUq/awzCCp0+P63uSXEOzs+Ls=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EAUUb+OJDZY9baRpyBfJ7YfQfFORbheQDApfAH1sFg8FjZhKcrkTKwiANpL6myTjarKkmpbSvlggOkAVHeb0YzvrPyubJwZJqwTNyyqmjUccOc5cV0KV9liceTzHk1a88T4nRchX5JzBhfo+G3hv99DCVj3nGk1CSaM0o6gMr7M= 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=RnSVngvx; arc=none smtp.client-ip=209.85.208.177 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="RnSVngvx" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2fb50e84ec7so22638791fa.1 for ; Fri, 18 Oct 2024 14:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729288165; x=1729892965; 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=gaBPMg1AmxsxPM/D5Hee5JcN9a25p5bXN91ymYiIy5c=; b=RnSVngvxN4JjuEjR4yf2LQw34TsyqkI0bb1WsAncHKYRk4l7w+KWJ+wSJyJFPR6cQN kRGgWxKxjAeBxmX9Sec8yIegirMdFfFJiNV5XrPjcSadtMn2jXQV6WqU5xRQjSQaBina j39cxjpxrDTLyR1UxEp8O0efEldpLfsPdqFj2By6ruH6LzWVHadF1uDST3zNsjGbGSQc kNfWPawAX8i30H6tqP0oJJvu+7rX/aHq44TF79M8eHFmd/vTe6iQrxpHHAMadlxXQ3CR JFosKo9E677SlKYvurYcp2lZ3Wq00Bb+QKd5TCYF4NtX2Cu0pGK1hYvtslVR8yk0BuVx FeaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729288165; x=1729892965; 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=gaBPMg1AmxsxPM/D5Hee5JcN9a25p5bXN91ymYiIy5c=; b=NEShzPJlUUdl0YWdLaT1jCp/LYWkit56ZJCTxMzj9maGvKrAxYbDeSGfY0XcPzy70r ZNpE2kxv+xn2mE/MCoF0+GUKMEAdjHT3sewVjGbAg9wzPmIyccSm8y0gQQuTL550Ky88 11/RfPTJJ5NhdNb2pQvZYOCppl19GUq+C/ZfXnNmmBxQ2yww5S+nXRkcpV98E3RzFnzl 6zrfCxlOWhv5ABW4RzHO+JDmkCcS49nwZTVM0Yat9yV5E0Rq2oKdTQZ5u9q2sQCZgQ7Q A7m+BP0fOGk5Uyjj2f7zaprSPX+xPbsN1DL0D2ditp2WEI+s659hi9xAG1p3XqJp7BJg U8sA== X-Forwarded-Encrypted: i=1; AJvYcCU28MNCgHcr57OwpsJZdY7AU99v+bhSdpQSj9c9sOGG6nCbDOAmb+6ObUgxnzxqcdXv6+3GQOvOG6C2snbu@vger.kernel.org X-Gm-Message-State: AOJu0YxHWQLk0xZSIrJhN3m/fQwzadQHZNCtGYVJVAuDCWxJZacKCVwj qd9sTSeIDXZJmw3ksiJiucY/w4ojMQiU3foNOAqSo6AvnwuAn2mhgCSQ3UY8dkA= X-Google-Smtp-Source: AGHT+IEwsp3DJLispc5Uu+bsLkWA9jEEfNgUg2fe0AkZdKhNFZlyKLrQPTa06UtCmputrUq6ijp2uw== X-Received: by 2002:a05:6512:1598:b0:539:f886:31d6 with SMTP id 2adb3069b0e04-53a1520bd09mr2482354e87.2.1729288165534; Fri, 18 Oct 2024 14:49:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 14:49:24 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 19 Oct 2024 00:49:14 +0300 Subject: [PATCH 3/6] drm/bridge: display-connector: allow YCbCr 420 for HDMI and DP Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241019-bridge-yuv420-v1-3-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=1023; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=pZFlU5ikCJDIckLBlIAUq/awzCCp0+P63uSXEOzs+Ls=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ7rQ9bvcVYyXhH4v2nbOrW+V56fz/nM6Ra8qGUUzfkmXz NR4wOHRyWjMwsDIxSArpsjiU9AyNWZTctiHHVPrYQaxMoFMYeDiFICJ+Gaz/2LKWimrkK2V+Hly 9qLrbbUCO2cI9V7mf7l3qX6f6v9FgsWWBgt90p1C/+yM65wm/SHu3mEdAWNz/tpN4YYiFU5P1vc 0LNFboKga0HF5U5fM7Oq8he8cZR9Fnt0edGyC6mfnsgcMTi6zmD7rOf7ilxVcwJA4Y4vzC0HHLd MPXdjRzXE74Nnk09ndskoTuzzXxz9uDuWW/r9NneNNSYEmx8q/Byp6Pau1Zh6cd+3RXtHmmmmbc rM3H4qPaGu5djjsyMtNhm3VfVzLRRbaaseJJq1Zx7iN3yRoqYnCtKbvZ4+qvz/wIeGu38/XHoam 8w82aNZNXnNxQqlatk+4mN4BlsZ0H2OThUov9TNsDCoCAQ== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Allow YCbCr 420 output for HDMI and DisplayPort connectors. Other bridges in the chain still might limit YCbCr 420 support on the corresponding connector. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/display-connector.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c index ab8e00baf3f1..aab9ce7be94c 100644 --- a/drivers/gpu/drm/bridge/display-connector.c +++ b/drivers/gpu/drm/bridge/display-connector.c @@ -270,6 +270,10 @@ static int display_connector_probe(struct platform_device *pdev) /* All the supported connector types support interlaced modes. */ conn->bridge.interlace_allowed = true; + if (type == DRM_MODE_CONNECTOR_HDMIA || + type == DRM_MODE_CONNECTOR_DisplayPort) + conn->bridge.ycbcr_420_allowed = true; + /* Get the optional connector label. */ of_property_read_string(pdev->dev.of_node, "label", &label); From patchwork Fri Oct 18 21:49:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 836734 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 ADCD0191F86 for ; Fri, 18 Oct 2024 21:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288173; cv=none; b=Sukav7554Q9ZAivxH5yDOV8QBLvMwspHgotmQvM0p0C42ON7NAB9qJQkVuakymr7JSRP3XaiZh6vpNmsdUZUCxz8OtohBG0MxqtmyzAMUrCRPUGP/zS1CboMQYz8eSie+4phFoP1JToBFpeBG5f1isF/HoIIZT2Bz/bZZT2MnEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729288173; c=relaxed/simple; bh=ugTosUslB7wYiUqpHQuS1lhI0s68LhvrkUMBV1pOZG0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qFTSW1B96jB9d8VeY4gGnt3acM0DpAZ0CCQZg+IkNgLCIKeMKOvKJkNPlvYelfAyk6WEkL8n0UZaMsLpKfaQgLk4vOTYupWIdcH82PH+g4nJ0mOcRjHmM/loRwF8wHVkAeityJpg71V8nypVJs2TXTMy8ncIqNpMJCqcWE5+fns= 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.208.175 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-lj1-f175.google.com with SMTP id 38308e7fff4ca-2fb5638dd57so29824901fa.0 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=CKEMeAr0ZMK9uNpFpZ5g3LnWDiHAXUpCkoMDGez8idUj6Sd4JsfTG3C/ZBWQrw8WfW jNvNQZbiatDGGXcYz3sowLjLajjW1Atn6cSQzZvApZ/2RdNZovJcLn0jqf6qDDr4r6xP klVUyZ/0Jaqj3wO1Ds+pjdOU12rnr5/H9bofW8XX40xP0tcuJDqvVi92BmhAksK2gdJn VrJw/atiIpkD1h9AvNS3Ilt101QGI8IgwtTPdzNaDVwJzuxLz3yMgu/dtCwZCb3KOICU yagj4Lmj06KQ4nOV5Y+YNKCFbfJab8QWHeYeRfiDVMfBfxGQ5ues5wm8rU1t0KNnG9Ap mWfg== X-Forwarded-Encrypted: i=1; AJvYcCWh5nOSp6tVUQmXfrN9AfEBLfK2t0bN9cV0UZSbB/MeCwgY2FPQ5lRMOSJMpje6gsimbqDD9y9dc9Ogo2aa@vger.kernel.org X-Gm-Message-State: AOJu0YyABdiOd8kUloBRUfpO7FQahiuAp00022znvrlLgj16O4C+fmrd RFJqX7/LfM8fXU8LHV8XvWEk145hy0rEK1FOETNF7BxVe3AFy0B1Mt3iPjIhOKc= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Neil Armstrong Acked-by: Abhinav Kumar --- 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/dp_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, dp_priv = container_of(dp_display, struct dp_display_private, dp_display); - ret = dp_bridge_init(dp_display, dev, encoder); + ret = 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; } - dp_display->connector = dp_drm_connector_init(dp_display, encoder, yuv_supported); + dp_display->connector = dp_drm_connector_init(dp_display, encoder); if (IS_ERR(dp_display->connector)) { ret = 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_drm.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 = { }; 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 drm_device *dev, bridge = &dp_bridge->bridge; bridge->funcs = dp_display->is_edp ? &edp_bridge_ops : &dp_bridge_ops; bridge->type = dp_display->connector_type; + bridge->ycbcr_420_allowed = yuv_supported; /* * Many ops only make sense for DP. Why? @@ -351,8 +352,8 @@ int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, } /* connector initialization */ -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct 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 = NULL; @@ -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); - if (yuv_supported) - connector->ycbcr_420_allowed = true; - drm_connector_attach_encoder(connector, encoder); return connector; diff --git a/drivers/gpu/drm/msm/dp/dp_drm.h b/drivers/gpu/drm/msm/dp/dp_drm.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 { #define to_dp_bridge(x) container_of((x), struct msm_dp_bridge, bridge) -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct 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); void dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, struct drm_bridge_state *old_bridge_state);