From patchwork Tue Aug 15 14:55:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9902007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ECC3360230 for ; Tue, 15 Aug 2017 14:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF97B283DA for ; Tue, 15 Aug 2017 14:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D43DE28553; Tue, 15 Aug 2017 14:55:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6BD72283DA for ; Tue, 15 Aug 2017 14:55:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E7F689F6E; Tue, 15 Aug 2017 14:55:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7B5D889F6E for ; Tue, 15 Aug 2017 14:55:27 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id d40so1725156wma.3 for ; Tue, 15 Aug 2017 07:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=ZQPvNhEGENTGMheqCakknEsW/yOo6I4Y3MntIzi6ebk=; b=MM51+kx7PIRMMlPOLe8tMxBz+TyBJ3y4T3iCaqET1UNRKgldZQsd2uU9TlK7tPZxxZ LTkA1Ma7l3puYZmst6+gUDjvbj+EmZWZwVK4SF1SP64mqP08zUgcGh9wVWUQWL3T0TSc 6bCv/gKSdvRdtVDb+aYkxM6CYCNmH2NIb4Pxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZQPvNhEGENTGMheqCakknEsW/yOo6I4Y3MntIzi6ebk=; b=JAzXjGj8U610R554p0PHQfXjo5xCvQSyUL+4X6i6U/J+ui8ypVVawtkvpBuv2Y5kGu zvJiF+t3WZj5Cn5FS6bpQBZbZHNcoUSArfyZleXSTfTm+B4o9FHAiXPtQINIiaz3hxpZ iryEJicmXxI28F5Solympt7+BfRWanzyLqIGSqXYTAmZQ7EFeRpBkjGFm+5aHQMC3bKg vMAZFWRRquhsB0TyRmJIhhwhqUgAg30Wm3QCbP+RUmETaSvU6qDUfcHXqrkm2QLA2kwj iTMajWfAibm0w6VCynvEfPU23VoIYDBjpZvud14zR/8Jfh1PJh1aAoSSE+mLgtGrruD2 G10A== X-Gm-Message-State: AHYfb5il4lHxy9mvKYT+ehd8cLJrDu2AJJ7fPn2MpMO9oIfGbcTXG/7w 7w84D/Tt6cCu1pipg+k= X-Received: by 10.80.167.5 with SMTP id h5mr27186347edc.220.1502808925725; Tue, 15 Aug 2017 07:55:25 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56e6:0:e4bc:76a0:8042:669e]) by smtp.gmail.com with ESMTPSA id l3sm6974079edc.32.2017.08.15.07.55.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Aug 2017 07:55:24 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm: Try to document legacy DPMS uapi a bit better Date: Tue, 15 Aug 2017 16:55:19 +0200 Message-Id: <20170815145519.1162-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.13.3 Cc: Daniel Vetter , Laurent Pinchart , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Laurent asked for this. Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Reviewed-by: Eric Anholt --- drivers/gpu/drm/drm_connector.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index ba9f36cef68c..b458eb488128 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -720,6 +720,25 @@ DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name, * callback. For atomic drivers the remapping to the "ACTIVE" property is * implemented in the DRM core. This is the only standard connector * property that userspace can change. + * + * WARNING: + * + * For userspace also running on legacy drivers the "DPMS" semantics are a + * lot more complicated. First, userspace cannot rely on the "DPMS" value + * returned by the GETCONNECTOR actually reflecting reality, because many + * drivers fail to update it. For atomic drivers this is taken care of in + * drm_atomic_helper_update_legacy_modeset_state(). + * + * The second issue is that the DPMS state is only relevant when the + * connector is connected to a CRTC. In atomic the DRM core enforces that + * "ACTIVE" is off in such a case, no such checks exists for "DPMS". + * Finally, when enabling an output using the legacy SETCONFIG ioctl then + * "DPMS" is forced to ON. But see above, that might not be reflected in + * the software value. + * + * Summarizing: Only set "DPMS" when the connector is known to be enabled, + * assume that a successful SETCONFIG call also set "DPMS" to on, and never + * read back the value of "DPMS" because it can be incorrect. * PATH: * Connector path property to identify how this sink is physically * connected. Used by DP MST. This should be set by calling