From patchwork Thu Oct 22 10:34:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 11850803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC218C4363A for ; Thu, 22 Oct 2020 10:34:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FDA822267 for ; Thu, 22 Oct 2020 10:34:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FDA822267 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=emersion.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 723ED6F5C9; Thu, 22 Oct 2020 10:34:54 +0000 (UTC) Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF6116F5C9 for ; Thu, 22 Oct 2020 10:34:52 +0000 (UTC) Date: Thu, 22 Oct 2020 10:34:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail2; t=1603362890; bh=lbyJ7jg1JK+DITUUKTq4KsQfoukWUJ3ahftLFI7WZzI=; h=Date:To:From:Cc:Reply-To:Subject:From; b=M6VU3pXFVzJLCxBM7QNjJar9PIa+mWQpv1Is2Q0OGZH97i1h4z9usxdEoWLNMEsnv kX2YYG5MDC5z0u99R7gdwb2NpIhXLhOGEA2O9CKt5EF4nUb4/oIpxnWRTKEfPes00y tlhANvBSt/Ed0qfdjOvXN3kG5JQrxg4Iz4s97cqdLhzj56S7o2XrKtLiU7satAgFMh s5nqAszX0UJVb7FisMTUmKa3kKJovE6aNoIP1E1TZom6mJjv/nwpEf+1ztWYv9iAI5 33pFh5lQ0o968aYmtW+D+TttjE0nXvIlcAsnwte7mc1Bpc3pcBlAYPkp2WNKOQ10N8 B4SBL+UdGMDsg== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH v2] drm: document that user-space should avoid parsing EDIDs Message-ID: MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Simon Ser Cc: Daniel Vetter , Thomas Zimmermann , Pekka Paalanen , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" User-space should avoid parsing EDIDs for metadata already exposed via other KMS interfaces and properties. For instance, user-space should not try to extract a list of modes from the EDID: the kernel might mutate the mode list (because of link capabilities or quirks for instance). Other metadata not exposed by KMS can be parsed by user-space. This includes for instance monitor identification (make/model/serial) and supported color-spaces. v2: add short explanation why user-space shouldn't do this (Brian) Signed-off-by: Simon Ser Suggested-by: Daniel Vetter Reviewed-by: Daniel Vetter Acked-by: Thomas Zimmermann Cc: Pekka Paalanen Cc: Ville Syrjälä Cc: Brian Starkey Reviewed-by: Pekka Paalanen --- drivers/gpu/drm/drm_connector.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 717c4e7271b0..1913d8b4e16a 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -960,6 +960,11 @@ static const struct drm_prop_enum_list dp_colorspaces[] = { * drm_connector_update_edid_property(), usually after having parsed * the EDID using drm_add_edid_modes(). Userspace cannot change this * property. + * + * User-space should not parse the EDID to obtain information exposed via + * other KMS properties (because the kernel might apply limits, quirks or + * fixups to the EDID). For instance, user-space should not try to parse + * mode lists from the EDID. * DPMS: * Legacy property for setting the power state of the connector. For atomic * drivers this is only provided for backwards compatibility with existing