Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10908382ybi; Thu, 25 Jul 2019 06:55:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXfYxYPIvlbMgoILX40x1dPUJtfkwCKS1QZc4w81s19FRokjycqVxr1DHSJXToTrhlDPHA X-Received: by 2002:a63:7a01:: with SMTP id v1mr88411324pgc.310.1564062949748; Thu, 25 Jul 2019 06:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564062949; cv=none; d=google.com; s=arc-20160816; b=KJoWoRXutE7DnpUPuGe5E7UADKQWPAMltiuGB0nEvF9II4XM4/3w5qufat8p9kjHaq mEdGia40F1DmOVCa3DwpQP5aB3KVeKG2Lmb5Z3idq/aF5Ij95vOlYoGbgNWmcyO0zvI9 oKxVd9DoK6hHpy1dy2yxQ1j7pui8geCyN4eyDz4bjTZuGzVPsymxrMoIlQpmWvheMqx0 7hRWY0EQLupkhzkFVtBdfFiV/zng2EYB0Qo7iigo93J2Teunr+Q7edAp+qCEWHMaVu+a 4m4rc5/d2TEfbF6XyH61gr9zlUY9kEshbD3DdQ31QRQQcBj8O+12TrTNt4UUrFDPtKI3 H6sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=xBQlbxU4sIAkZTKOezDDuKJzUoBaUMJjzL90w1I4sJI=; b=lAIOKz3nBIjONGHdOut0WeSlhXzeR2LkIxjam9tPyFk9dc05Pvb9Eam/oASpq/GOQ9 YLbhZI8Mp7bxbcZxBWzbDPGbea7toZOOSpgKLKI+f2h2snFNfT8WWJPwAdDu37rDps9R +Ml12qELy46/e0Opji9Hv3S4Z41ANo9uGvdlISsC+h1NlDjop6Yox0jYUQCWN7xfo9tG oZbwqNmnsTOntdhKf0NYubnknBJOxD2AaM6WLp03VzSSB+nkzUy+WuddhuivAgDOEqzc O9oDMlY5cZD9kHZbmCjP3gMUKHh4cIhX6VWfnWnULjAzszSlceRhg3jvoS6jAt3xUIZ0 FoGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=M3t1O2gx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si18209667pgt.451.2019.07.25.06.55.35; Thu, 25 Jul 2019 06:55:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=M3t1O2gx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728554AbfGYMOu (ORCPT + 99 others); Thu, 25 Jul 2019 08:14:50 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:34469 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbfGYMOu (ORCPT ); Thu, 25 Jul 2019 08:14:50 -0400 Received: by mail-ed1-f65.google.com with SMTP id s49so15203187edb.1 for ; Thu, 25 Jul 2019 05:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=xBQlbxU4sIAkZTKOezDDuKJzUoBaUMJjzL90w1I4sJI=; b=M3t1O2gx3+K3rmn/pg3IKsxF+wMha3/LFiBk1fJtQOwd8o0IqWLiVGplJsSGS0D56s 9xudBdZ2cfavEGGdm0BxzNjv7mYMR/gZDIdJDMJnpyWgil3kUhBR8OYvLmQzLxtkugQC Fvqfzg4SzAyYVYQu3pyILKvHWBdT4P88aG3lU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=xBQlbxU4sIAkZTKOezDDuKJzUoBaUMJjzL90w1I4sJI=; b=TUD1HSrBazMuMAiJPu4uAFGtOXGcb7CYWjFR9WxbiOOqMdeDjH38PZ+z+3jr08sbdR GzHr6xPCgtYhPsO+7ADGoYw3DC12yvYhJRRL7zT44q5gbHw2skDTtCBZEhTJnR9k5t0T kL43EqMVb/PSDv9G01RtjBdgE0zVl9LIuLnPBxkNlnMw4jZt+sE9BfLS6pFAueYe5z4f /oKBWOyOb5blNRPx71KnASoWuAiKkZ9C2B18xNLs/j0tJ250jHZ+NCsJh0pGyTvmh43t gozwx1upk76SD/vncFS8VAgnsRnKjPQxujd3JSBTFpwj4ELHxRRdNI4fmq2UIAUpoeFo jn1g== X-Gm-Message-State: APjAAAX4mpmT1B1ljK9l1ifgSWxncSKcsSNzvm/w0/a89BvL4YTZe1Gg XD/fFHyX0vxp4cZoOPqQUjM= X-Received: by 2002:a50:e618:: with SMTP id y24mr76229999edm.142.1564056888257; Thu, 25 Jul 2019 05:14:48 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id 34sm13374689eds.5.2019.07.25.05.14.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 05:14:47 -0700 (PDT) Date: Thu, 25 Jul 2019 14:14:45 +0200 From: Daniel Vetter To: Oleksandr Suvorov Cc: Andrzej Hajda , Neil Armstrong , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Igor Opaniuk , "stable@vger.kernel.org" , Marcel Ziswiler , "maxime.ripard@free-electrons.com" , Jonas Karlman , David Airlie , Jernej Skrabec , Laurent Pinchart , Daniel Vetter Subject: Re: [PATCH 1/1] drm/bridge: vga-dac: Fix detect of monitor connection Message-ID: <20190725121445.GD15868@phenom.ffwll.local> Mail-Followup-To: Oleksandr Suvorov , Andrzej Hajda , Neil Armstrong , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Igor Opaniuk , "stable@vger.kernel.org" , Marcel Ziswiler , "maxime.ripard@free-electrons.com" , Jonas Karlman , David Airlie , Jernej Skrabec , Laurent Pinchart References: <20190725110520.26848-1-oleksandr.suvorov@toradex.com> <20190725110520.26848-2-oleksandr.suvorov@toradex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190725110520.26848-2-oleksandr.suvorov@toradex.com> X-Operating-System: Linux phenom 4.19.0-5-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 11:05:24AM +0000, Oleksandr Suvorov wrote: > DDC and VGA channels are independent, and therefore > we cannot decide whether the monitor is connected or not, > depending on the information from the DDC. > > So the monitor should always be considered connected. > Thus there is no reason to use connector detect callback for this > driver. > > Fixes DRM error of dumb monitor detection like: > ... > DRM: head 'VGA-1' found, connector 32 is disconnected. > ... > > Cc: stable@vger.kernel.org > Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support") > Signed-off-by: Oleksandr Suvorov Uh nope :-) Yes VGA monitors are broken, but the way to fix that is to either override that on the kernel cmdline, or in your userspace somewhere. Not hardcode this in the kernel for everyone. Because not everyone does have a broken VGA monitor, but if you do this _every_ desktop will try to light up that broken monitor. Which leads to lots of bug reports and regressions. This case is exactly what connector_status_unknown is meant for: The kernel couldn't authoritatively figure out whether there is a monitor or not. Userspace should/can try this into account for autoconfiguration. Note a more proper fix would be to somehow wire up load detection. That will work even for dumb VGA monitors, and e.g. i915 then gives you an authoritative connector_status_disconnected if it could execute a load detect cycle (not always possible on some hw) and there's no screen detected with that. Maybe we should document this better somewhere in docs? Would be great if you can type a patch for this ... -Daniel > --- > > drivers/gpu/drm/bridge/dumb-vga-dac.c | 18 ------------------ > 1 file changed, 18 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c > index d32885b906ae..e37c19356d12 100644 > --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c > +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c > @@ -73,25 +73,7 @@ static const struct drm_connector_helper_funcs dumb_vga_con_helper_funcs = { > .get_modes = dumb_vga_get_modes, > }; > > -static enum drm_connector_status > -dumb_vga_connector_detect(struct drm_connector *connector, bool force) > -{ > - struct dumb_vga *vga = drm_connector_to_dumb_vga(connector); > - > - /* > - * Even if we have an I2C bus, we can't assume that the cable > - * is disconnected if drm_probe_ddc fails. Some cables don't > - * wire the DDC pins, or the I2C bus might not be working at > - * all. > - */ > - if (!IS_ERR(vga->ddc) && drm_probe_ddc(vga->ddc)) > - return connector_status_connected; > - > - return connector_status_unknown; > -} > - > static const struct drm_connector_funcs dumb_vga_con_funcs = { > - .detect = dumb_vga_connector_detect, > .fill_modes = drm_helper_probe_single_connector_modes, > .destroy = drm_connector_cleanup, > .reset = drm_atomic_helper_connector_reset, > -- > 2.20.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch