From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 739ECC433F5 for ; Tue, 19 Oct 2021 22:43:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57549610E6 for ; Tue, 19 Oct 2021 22:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbhJSWqI (ORCPT ); Tue, 19 Oct 2021 18:46:08 -0400 Received: from msg-2.mailo.com ([213.182.54.12]:43540 "EHLO msg-2.mailo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbhJSWqH (ORCPT ); Tue, 19 Oct 2021 18:46:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=net-c.es; s=mailo; t=1634683253; bh=wO90rGU6MhdAHFHZM4DSTSVrgFBdt+grYWoEJdFQb5o=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To; b=LcyS7cA+lr21Qf2IXkL+iVBukZ+htLmi/0EnuDi8za6fmtPBBmhu3358Sy9SxuDtl pxOT3e4q8mYLTcaeJAg7BIpaj4RLxnUbjtBlvw4e1kkdpV2gezQoOlUAd9Ro6nqpER iYuXXnjek58793jA/WM/LFYxFkKwsB6nfpNunp+o= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Wed, 20 Oct 2021 00:40:23 +0200 (CEST) X-EA-Auth: rjXwpQ396seHTSefM986rJ+z/3H3+BzurlzyNXwUfcqw/AEL5XVBNOJkTIPVCCi7ulQ2bi9qCPxsXZRs0J5aCF77eKqTbF9k Date: Wed, 20 Oct 2021 00:40:20 +0200 From: Claudio Suarez To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org, David Airlie , Daniel Vetter , Laurent Pinchart , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , Pan Xinhui , Emma Anholt , Maxime Ripard , Thierry Reding , Patrik Jakobsson , Jingoo Han , Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Chen-Yu Tsai , Sandy Huang , heiko@sntech.de, Neil Armstrong , Robert Foss , Ben Skeggs , nouveau@lists.freedesktop.org Subject: Re: [PATCH v2 01/13] gpu/drm: make drm_add_edid_modes() consistent when updating connector->display_info Message-ID: References: <20211016184226.3862-1-cssk@net-c.es> <20211016184226.3862-2-cssk@net-c.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Tue, Oct 19, 2021 at 09:35:08PM +0300, Ville Syrjälä wrote: > On Sat, Oct 16, 2021 at 08:42:14PM +0200, Claudio Suarez wrote: > > According to the documentation, drm_add_edid_modes > > "... Also fills out the &drm_display_info structure and ELD in @connector > > with any information which can be derived from the edid." > > > > drm_add_edid_modes accepts a struct edid *edid parameter which may have a > > value or may be null. When it is not null, connector->display_info and > > connector->eld are updated according to the edid. When edid=NULL, only > > connector->eld is reset. Reset connector->display_info to be consistent > > and accurate. > > > > Signed-off-by: Claudio Suarez > > --- > > drivers/gpu/drm/drm_edid.c | 11 +++++------ > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 6325877c5fd6..c643db17782c 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -5356,14 +5356,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) > > int num_modes = 0; > > u32 quirks; > > > > - if (edid == NULL) { > > - clear_eld(connector); > > - return 0; > > - } > > if (!drm_edid_is_valid(edid)) { > > OK, so drm_edid_is_valid() will happily accept NULL and considers > it invalid. You may want to mention that explicitly in the commit > message. Thank you for your comments, I appreciate :) I'm sending new mails with the new commit messages. > > + /* edid == NULL or invalid here */ > > clear_eld(connector); > > - drm_warn(connector->dev, "%s: EDID invalid.\n", > > - connector->name); > > + drm_reset_display_info(connector); > > + if (edid) > > + drm_warn(connector->dev, "%s: EDID invalid.\n", > > + connector->name); > > Could you respin this to use the standard [CONNECTOR:%d:%s] form > while at it? Or I guess a patch to mass convert the whole drm_edid.c > might be another option. Good point. I like the idea of a new patch. I'll start working on it. I can change this drm_warn here to avoid merge conflicts. > Patch looks good. > Reviewed-by: Ville Syrjälä Thanks! BR Claudio Suarez. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 836FDC433FE for ; Tue, 19 Oct 2021 22:43:54 +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 04BD1610E5 for ; Tue, 19 Oct 2021 22:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 04BD1610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=net-c.es Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 514E26E038; Tue, 19 Oct 2021 22:43:53 +0000 (UTC) Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1ABE56E02B; Tue, 19 Oct 2021 22:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=net-c.es; s=mailo; t=1634683253; bh=wO90rGU6MhdAHFHZM4DSTSVrgFBdt+grYWoEJdFQb5o=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To; b=LcyS7cA+lr21Qf2IXkL+iVBukZ+htLmi/0EnuDi8za6fmtPBBmhu3358Sy9SxuDtl pxOT3e4q8mYLTcaeJAg7BIpaj4RLxnUbjtBlvw4e1kkdpV2gezQoOlUAd9Ro6nqpER iYuXXnjek58793jA/WM/LFYxFkKwsB6nfpNunp+o= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Wed, 20 Oct 2021 00:40:23 +0200 (CEST) X-EA-Auth: rjXwpQ396seHTSefM986rJ+z/3H3+BzurlzyNXwUfcqw/AEL5XVBNOJkTIPVCCi7ulQ2bi9qCPxsXZRs0J5aCF77eKqTbF9k Date: Wed, 20 Oct 2021 00:40:20 +0200 From: Claudio Suarez To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org, David Airlie , Daniel Vetter , Laurent Pinchart , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , Pan Xinhui , Emma Anholt , Maxime Ripard , Thierry Reding , Patrik Jakobsson , Jingoo Han , Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Chen-Yu Tsai , Sandy Huang , heiko@sntech.de, Neil Armstrong , Robert Foss , Ben Skeggs , nouveau@lists.freedesktop.org Message-ID: References: <20211016184226.3862-1-cssk@net-c.es> <20211016184226.3862-2-cssk@net-c.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [Nouveau] [PATCH v2 01/13] gpu/drm: make drm_add_edid_modes() consistent when updating connector->display_info X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Tue, Oct 19, 2021 at 09:35:08PM +0300, Ville Syrjälä wrote: > On Sat, Oct 16, 2021 at 08:42:14PM +0200, Claudio Suarez wrote: > > According to the documentation, drm_add_edid_modes > > "... Also fills out the &drm_display_info structure and ELD in @connector > > with any information which can be derived from the edid." > > > > drm_add_edid_modes accepts a struct edid *edid parameter which may have a > > value or may be null. When it is not null, connector->display_info and > > connector->eld are updated according to the edid. When edid=NULL, only > > connector->eld is reset. Reset connector->display_info to be consistent > > and accurate. > > > > Signed-off-by: Claudio Suarez > > --- > > drivers/gpu/drm/drm_edid.c | 11 +++++------ > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 6325877c5fd6..c643db17782c 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -5356,14 +5356,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) > > int num_modes = 0; > > u32 quirks; > > > > - if (edid == NULL) { > > - clear_eld(connector); > > - return 0; > > - } > > if (!drm_edid_is_valid(edid)) { > > OK, so drm_edid_is_valid() will happily accept NULL and considers > it invalid. You may want to mention that explicitly in the commit > message. Thank you for your comments, I appreciate :) I'm sending new mails with the new commit messages. > > + /* edid == NULL or invalid here */ > > clear_eld(connector); > > - drm_warn(connector->dev, "%s: EDID invalid.\n", > > - connector->name); > > + drm_reset_display_info(connector); > > + if (edid) > > + drm_warn(connector->dev, "%s: EDID invalid.\n", > > + connector->name); > > Could you respin this to use the standard [CONNECTOR:%d:%s] form > while at it? Or I guess a patch to mass convert the whole drm_edid.c > might be another option. Good point. I like the idea of a new patch. I'll start working on it. I can change this drm_warn here to avoid merge conflicts. > Patch looks good. > Reviewed-by: Ville Syrjälä Thanks! BR Claudio Suarez. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B2A5C433F5 for ; Tue, 19 Oct 2021 22:44:03 +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 3901D610A1 for ; Tue, 19 Oct 2021 22:44:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3901D610A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=net-c.es Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AEEB6E086; Tue, 19 Oct 2021 22:43:55 +0000 (UTC) Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1ABE56E02B; Tue, 19 Oct 2021 22:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=net-c.es; s=mailo; t=1634683253; bh=wO90rGU6MhdAHFHZM4DSTSVrgFBdt+grYWoEJdFQb5o=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To; b=LcyS7cA+lr21Qf2IXkL+iVBukZ+htLmi/0EnuDi8za6fmtPBBmhu3358Sy9SxuDtl pxOT3e4q8mYLTcaeJAg7BIpaj4RLxnUbjtBlvw4e1kkdpV2gezQoOlUAd9Ro6nqpER iYuXXnjek58793jA/WM/LFYxFkKwsB6nfpNunp+o= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Wed, 20 Oct 2021 00:40:23 +0200 (CEST) X-EA-Auth: rjXwpQ396seHTSefM986rJ+z/3H3+BzurlzyNXwUfcqw/AEL5XVBNOJkTIPVCCi7ulQ2bi9qCPxsXZRs0J5aCF77eKqTbF9k Date: Wed, 20 Oct 2021 00:40:20 +0200 From: Claudio Suarez To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org, David Airlie , Daniel Vetter , Laurent Pinchart , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , Pan Xinhui , Emma Anholt , Maxime Ripard , Thierry Reding , Patrik Jakobsson , Jingoo Han , Rob Clark , Sean Paul , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Chen-Yu Tsai , Sandy Huang , heiko@sntech.de, Neil Armstrong , Robert Foss , Ben Skeggs , nouveau@lists.freedesktop.org Message-ID: References: <20211016184226.3862-1-cssk@net-c.es> <20211016184226.3862-2-cssk@net-c.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [Intel-gfx] [PATCH v2 01/13] gpu/drm: make drm_add_edid_modes() consistent when updating connector->display_info X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Oct 19, 2021 at 09:35:08PM +0300, Ville Syrjälä wrote: > On Sat, Oct 16, 2021 at 08:42:14PM +0200, Claudio Suarez wrote: > > According to the documentation, drm_add_edid_modes > > "... Also fills out the &drm_display_info structure and ELD in @connector > > with any information which can be derived from the edid." > > > > drm_add_edid_modes accepts a struct edid *edid parameter which may have a > > value or may be null. When it is not null, connector->display_info and > > connector->eld are updated according to the edid. When edid=NULL, only > > connector->eld is reset. Reset connector->display_info to be consistent > > and accurate. > > > > Signed-off-by: Claudio Suarez > > --- > > drivers/gpu/drm/drm_edid.c | 11 +++++------ > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 6325877c5fd6..c643db17782c 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -5356,14 +5356,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) > > int num_modes = 0; > > u32 quirks; > > > > - if (edid == NULL) { > > - clear_eld(connector); > > - return 0; > > - } > > if (!drm_edid_is_valid(edid)) { > > OK, so drm_edid_is_valid() will happily accept NULL and considers > it invalid. You may want to mention that explicitly in the commit > message. Thank you for your comments, I appreciate :) I'm sending new mails with the new commit messages. > > + /* edid == NULL or invalid here */ > > clear_eld(connector); > > - drm_warn(connector->dev, "%s: EDID invalid.\n", > > - connector->name); > > + drm_reset_display_info(connector); > > + if (edid) > > + drm_warn(connector->dev, "%s: EDID invalid.\n", > > + connector->name); > > Could you respin this to use the standard [CONNECTOR:%d:%s] form > while at it? Or I guess a patch to mass convert the whole drm_edid.c > might be another option. Good point. I like the idea of a new patch. I'll start working on it. I can change this drm_warn here to avoid merge conflicts. > Patch looks good. > Reviewed-by: Ville Syrjälä Thanks! BR Claudio Suarez.