Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp959394rdd; Wed, 10 Jan 2024 04:53:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFshU5eVnpOiwTE+cJb/jZjal2+GxCN6G9PsRrz6a7xBTAHIj0/VGKUHEGjo5vSbgguULMV X-Received: by 2002:a17:906:80e:b0:a23:339f:3313 with SMTP id e14-20020a170906080e00b00a23339f3313mr650706ejd.55.1704891213311; Wed, 10 Jan 2024 04:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704891213; cv=none; d=google.com; s=arc-20160816; b=WDABYUqlDdNArDygz/R9bKE3CXo7l+wTOWELGoJHLY5SJpBBCRHVQbiAwQTYukfeYm e9ZErfnt8fVHvdjr2fqqQti3FR9a7KmpWrEkKRFIWvnRoegfjU784YF0kjmb5PBnfq/Z 8Gq6uclDX0aVeYIx5LazTXfS0Vpy6SWge3YLHthfvXbJtE4nL8GgFa6rlHPcBV5EZRFy gE4AD0kXn6egys6Hb3SKJ18UTovNYukrbQj+TAPiV8h9btzM1jMIa8JRtXF7qKGj0AzZ Ukc+6kKb/D2COAgO5IyTDGeffDQL2YOVHSPzZOTijdOCaHbyZrGIWY1/0hm3pIAbChap gHJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=tumM7ZgHm0hfd7iZgxyi6dhv3yMhPnlkKGS30wXR09c=; fh=t6WzeHHR2Dub/m5naS+onTQtma9AzPQEJbMDlprBrw0=; b=Qvo2U43O4CLAB1auGLnms1kO8zkCiPv+74kF6tzi2HWKDsYN3xeDaag5+tMYspNHuL 5Ej0jdZAhF/NyUZADWvsycX5IFe/h44K5pTPUyJXOvSi3E8emgKVtYOUYsZOVk8e/9dB aWLk4Cbf+36YW18YNq8In/3nU22yTwX2Hnt6jmhcE3KSQMw+F404CoSzCc1qo83JF3Nw K0aa/6Z6rTI3rqu75jgMnJfAck2Y30Ug5WtQB8gGkCnQJ1fpQRAMecQOzK4tTUK6Ynne la/Dtd+Ihjrx4zRpr2aIjLpl1Pr7mzT+K7snX0gPCZ3eizwN/nDKShLxsH5wMSVh3P/Y WDRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yngvason.is header.s=google header.b=IqRXXl4p; spf=pass (google.com: domain of linux-kernel+bounces-22192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=yngvason.is Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gs24-20020a170906f19800b00a236c4a0a9esi1754994ejb.785.2024.01.10.04.53.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 04:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@yngvason.is header.s=google header.b=IqRXXl4p; spf=pass (google.com: domain of linux-kernel+bounces-22192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=yngvason.is Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 13E7B1F25EC5 for ; Wed, 10 Jan 2024 12:53:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3617648788; Wed, 10 Jan 2024 12:53:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yngvason.is header.i=@yngvason.is header.b="IqRXXl4p" Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.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 1802048780 for ; Wed, 10 Jan 2024 12:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=yngvason.is Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yngvason.is Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dbe39a45e8eso2940409276.1 for ; Wed, 10 Jan 2024 04:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yngvason.is; s=google; t=1704891202; x=1705496002; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tumM7ZgHm0hfd7iZgxyi6dhv3yMhPnlkKGS30wXR09c=; b=IqRXXl4pv94gOS74wEI3cDtxP/gAa4J0U542ZQJOWIpJr34b6w7r/EZrhgJB252a+d GNw9F7iMji8KXGJXBKBnRGkN07eXjF5SXtwTFtsJlFejJ9DYTB++aWd//RcFhmky7veN 8DLAO2x/1RpBx5kTcSTS34BMcvc3xnXLNlmzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704891202; x=1705496002; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tumM7ZgHm0hfd7iZgxyi6dhv3yMhPnlkKGS30wXR09c=; b=lO6cF6A2mQhVYlRHVB/Ql3CxoX2LcJZ6apaRbkktopYXP/nOqrJzm0YeYfBj6ch8Oz Nj0ucwD5FJiqgq3KjZzImfA8hLgf7OO+RYc5tc9kLGCfRG5RJJXBtO+aoG/mPNzBeC99 2kdChNk+7W1/49Ocvq3KdlhdBLEbLdwSUKgOdp0fKQeKFcQOiTCW5aa+Jx5ncsh29ASW QsLX+YbubfMQi9wXLgQV6Oew5EQJU7UnYggZQvCPXCUpKqEsYe9qP0JQJBVSa6iSVKMZ qACir5B5Z7LHVlRZEoJRvsdIbpcVWkyBkDtzbURuvQppGUDAclKx48CLVho839c9hnD2 F0CQ== X-Gm-Message-State: AOJu0YxOkhHbuo94ocXnpapJStnQX5zQ0lvxDkSZqjO1UsgDRDWxlxCv OqADZLbgz3ot9mnXc4xjtOlybaZV5PKCl4uFJlJVFMLOb5KY7Q== X-Received: by 2002:a5b:d51:0:b0:dbd:ab70:4e8f with SMTP id f17-20020a5b0d51000000b00dbdab704e8fmr625799ybr.4.1704891201874; Wed, 10 Jan 2024 04:53:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240109181104.1670304-1-andri@yngvason.is> <20240109181104.1670304-4-andri@yngvason.is> In-Reply-To: From: Andri Yngvason Date: Wed, 10 Jan 2024 12:52:46 +0000 Message-ID: Subject: Re: [PATCH 3/7] drm/amd/display: Add handling for new "active color format" property To: Andri Yngvason , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, Simon Ser , Werner Sembach Cc: Daniel Vetter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable mi=C3=B0., 10. jan. 2024 kl. 11:10 skrifa=C3=B0i Daniel Vetter : > > On Tue, Jan 09, 2024 at 06:11:00PM +0000, Andri Yngvason wrote: > > + /* Extract information from crtc to communicate it to userspace a= s connector properties */ > > + for_each_new_connector_in_state(state, connector, new_con_state, = i) { > > + struct drm_crtc *crtc =3D new_con_state->crtc; > > + struct dc_stream_state *stream; > > + > > + if (crtc) { > > + new_crtc_state =3D drm_atomic_get_new_crtc_state(= state, crtc); > > + dm_new_crtc_state =3D to_dm_crtc_state(new_crtc_s= tate); > > + stream =3D dm_new_crtc_state->stream; > > + > > + if (stream) { > > + drm_connector_set_active_color_format_pro= perty(connector, > > + convert_dc_pixel_encoding_into_dr= m_color_format( > > + dm_new_crtc_state->stream= ->timing.pixel_encoding)); > > + } > > + } else { > > + drm_connector_set_active_color_format_property(co= nnector, 0); > > Just realized an even bigger reason why your current design doesn't work: > You don't have locking here. > > And you cannot grab the required lock, which is > drm_dev->mode_config.mutex, because that would result in deadlocks. So > this really needs to use the atomic state based design I've described. > Maybe we should just drop "actual color format" and instead fail the modeset if the "preferred color format" property cannot be satisfied? It seems like the simplest thing to do here, though it is perhaps less convenient for userspace. In that case, the "preferred color format" property should just be called "color format". Thanks, Andri