Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1791088rdd; Thu, 11 Jan 2024 09:18:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZNRALBf79/HyPwBZeZGaf/mpp3SH5/Q1BN5Z2Pt7e6e+89hUsk+aGJopy0s+SOEfF1YTt X-Received: by 2002:a17:907:1b02:b0:a28:ac22:7575 with SMTP id mp2-20020a1709071b0200b00a28ac227575mr1738358ejc.4.1704993514680; Thu, 11 Jan 2024 09:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704993514; cv=none; d=google.com; s=arc-20160816; b=ZqtYkl2fMavpsDNX3eurhsHZOn08Zl1Lm9EXE+105roT8zmT5GT97mbcAEkG+9iLuk VBVXsxJ8YfVHdOHv3X8QEHl/j7FE7t8mwduFDi7w13TAC4338vKT9vRFNdishj/310Cb TlFALPPSPWJDGiFatsC0zhHXPIysvboIHlRF2DuBTkRqxhaOuKqqQFHS1v+IQ7tIlakD F0JxEuG9E9rQ+TAVknIU9+tY2HZg3pMryNR6RwTfFAm+vJwlc2ybvNRoCbuPJ0hNAGO9 Nmf1PuC842ZN3gZpC4+QDm1ajEcP3HhyEuF3q7vk5+i89IwdvZQWgadJPVS/7MFcU5CL jQ1A== 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=reRg+juZFTzYLAuymnc77j283thAAyu9GtKD+8yi8oo=; fh=CsSC7fbSPuH4Gc7WAJL92XWlHMVMpptzwrwx6KhX4CI=; b=A8QiKRlofKCaJuBbTz0BBZwpekjoN+nQdHUWZzsEhUCsbeBBM+bCmNLCwFkauY0bNg N+Mgk/FEHzZgeOIGBncPeiedruElWa4kGFO6dRRTPloPZuyOJCTeOgWus6H/0fJ7QRYo 48Wl/ffv9Wiyy/94z73D9AG/9Ofon2FkAwbIXxoAdNAuSCbwZ1gOnfzr/Ev+9G3vU24E arPobiwV4vbtVPyjuDOaVqf5ALhs8cC2jDqPSnIVbWAFVv7+vc3lQocJDN7alu1W2Nhz LgJy/LfHrKm3coxv/KCJhYtbjZf8W7sOYh6aNgJKR28KUQfCVpg92bakN1+2742z/i/C EoKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yngvason.is header.s=google header.b=fHWJ2f4M; spf=pass (google.com: domain of linux-kernel+bounces-23920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23920-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 jp8-20020a170906f74800b00a2c29ce2716si675126ejb.315.2024.01.11.09.18.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 09:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23920-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=fHWJ2f4M; spf=pass (google.com: domain of linux-kernel+bounces-23920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23920-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 3DBA91F2162B for ; Thu, 11 Jan 2024 17:18:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C669751C48; Thu, 11 Jan 2024 17:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yngvason.is header.i=@yngvason.is header.b="fHWJ2f4M" Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (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 8324750264 for ; Thu, 11 Jan 2024 17:18:23 +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-yw1-f178.google.com with SMTP id 00721157ae682-5f68af028afso49058277b3.2 for ; Thu, 11 Jan 2024 09:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yngvason.is; s=google; t=1704993502; x=1705598302; 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=reRg+juZFTzYLAuymnc77j283thAAyu9GtKD+8yi8oo=; b=fHWJ2f4MgIwGKzOsXgfG9dMQlXYuSoFtDj/Lxofu4OwUO0D0f6SdstOcnFFY4p7gdE NEOn+nZiaBzgAcisvRJpnN21dRkSAeBRESFp4I7hHLe1mO0n2b57Je32yhVjIfAOYra3 SOr2EUgW5u6LTnwqltXclstzK7kJKOvPDfJZM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704993502; x=1705598302; 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=reRg+juZFTzYLAuymnc77j283thAAyu9GtKD+8yi8oo=; b=kWeUTmilsYFg5SkMCj59nUkgKohuhayrxHqM69RE4ToHMjqnzdzEaNnUw8T8M3lCJb YQWgLgAaGoaKqqOxdq+3RAjRuLfTH3mkuIyaT1dOCKcM1CmnoeuvKeNXEbwFg3y/FWo5 anPi/eyxpSJbJu6J0Q48WJNHub4SRVz6VMU3Kte5+2f2CJQJJYJDC2mh3V8xQJ7FH6b4 iu8YVzojRysAxDcLfyDvP6ZSKOl8AcbX5V+zJO5P07lHDFPNWy+JZzcMT72nzrA6DF/0 wpMBz6H1U7wZJuUj0QnVPo05nx3SZKvVczKbgEiMKGU5X7NCGJS2jL3XM1XLquE98KNv 8xfw== X-Gm-Message-State: AOJu0YyJuQaYx5Pexwo1KrEOhO12dvERgtLkoEwOvrMcHnSK0UE1HPDj hF9MZY29ki0nTX6jM45fh1UUXtMg1a/lMxSRK48mlcbzann2Kw== X-Received: by 2002:a81:84d1:0:b0:5e9:94dc:b77f with SMTP id u200-20020a8184d1000000b005e994dcb77fmr123269ywf.9.1704993502233; Thu, 11 Jan 2024 09:18:22 -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-3-andri@yngvason.is> In-Reply-To: From: Andri Yngvason Date: Thu, 11 Jan 2024 17:17:46 +0000 Message-ID: Subject: Re: [PATCH 2/7] drm/uAPI: Add "active color format" drm property as feedback for userspace To: Daniel Stone Cc: 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 , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable mi=C3=B0., 10. jan. 2024 kl. 13:26 skrifa=C3=B0i Daniel Stone : > > > > This thing here works entirely differently, and I think we need somewha= t > > new semantics for this: > > > > - I agree it should be read-only for userspace, so immutable sounds rig= ht. > > > > - But I also agree with Daniel Stone that this should be tied more > > directly to the modeset state. > > > > So I think the better approach would be to put the output type into > > drm_connector_state, require that drivers compute it in their > > ->atomic_check code (which in the future would allow us to report it ou= t > > for TEST_ONLY commits too), and so guarantee that the value is updated > > right after the kms ioctl returns (and not somewhen later for non-block= ing > > commits). > > That's exactly the point. Whether userspace gets an explicit > notification or it has to 'know' when to read isn't much of an issue - > just as long as it's well defined. I think the suggestion of 'do it in > atomic_check and then it's guaranteed to be readable when the commit > completes' is a good one. > > I do still have some reservations - for instance, why do we have the > fallback to auto when userspace has explicitly requested a certain > type? - but they may have been covered previously. > We discussed this further on IRC and this is summary of that discussion: Sima proposed a new type of property that can be used to git feedback to userspace after atomic ioctl. The user supplies a list of output properties that they want to query and the kernel fills it in before returning from th= e ioctl. This would help to get some information about why things failed during TEST_ONLY. Emersion raised the point that you might not know how much memory is needed beforehand for the returned properties, to which sima replied: blob property. There was some discussion about how that makes it possible to lea= k kernel memory, especially if userspace does not know about a new property blob. Emersion pointed out that userspace should only request properties that it understands and pq agreed. Emersion asked how the user should inform the kernel that it's done with th= e blob, to which sima replied: DRM_IOCTL_MODE_DESTROYPROPBLOB. Sima also mentioned using some sort of weak reference garbage collection scheme for properties and there was some further discussion, but I'm not sure there wa= s any conclusion. I asked if it made sense to add color format capabilities to the mode info struct, but the conclusion was that it wouldn't really be useful because we need TEST_ONLY anyway to see if the color format setting is compatible with other settings. I asked again if we should drop the "active color format" property as it seems to be more trouble than it's worth for now. pq mentioned that there are 2 separate use cases (in his words): - People playing with setting UI would like to know what "auto" would resul= t in, but that's just nice to have - The other use case is the flicker-free boot into known configuration He went on to point out that the main problem with "auto" is that any modese= t could make the driver decide differently. This means that we cannot fully rely on the previously set property. However, leaving out "active color property" did not put us in a worse situation than before, so the conclusion was that we should leave it out fo= r now. For GUI selectors, the current TEST_ONLY should be good enough, and al= l the fancy stuff discussed previously isn't needed for now. To summarise the summary: this means that we will drop the "active color format" property and rename the "preferred color format" property to "force color format" or just "color format" and failing to satisfy that constraint will fail the modeset rather than falling back to the "auto" behaviour. Cheers, Andri