dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu CHARETTE <matthieu.charette@gmail.com>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: tzimmermann@suse.de, airlied@linux.ie,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Fix EDID firmware load on resume
Date: Fri, 15 Jul 2022 11:03:23 +0200	[thread overview]
Message-ID: <N512FR.B1R49X9JM9FW2@gmail.com> (raw)
In-Reply-To: <120a8dc1-7e5c-85da-e087-10d21fedbf20@igalia.com>

Hi,

Sorry, my email client removed every tab. I will send the v2 in a new 
thread.

Thanks.

Matthieu

On Thu, Jul 14 2022 at 11:23:10 AM -0300, André Almeida 
<andrealmeid@igalia.com> wrote:
> Hi Matthieu,
> 
> Thanks for your patch.
> 
> Às 11:58 de 06/07/22, Matthieu CHARETTE escreveu:
>>  Loading an EDID using drm.edid_firmware parameter makes resume to 
>> fail
>>  after firmware cache is being cleaned. This is because edid_load() 
>> use a
>>  temporary device to request the firmware. This cause the EDID 
>> firmware
>>  not to be cached from suspend. And, requesting the EDID firmware 
>> return
>>  an error during resume.
>>  So the request_firmware() call should use a permanent device for 
>> each
>>  connector. Also, we should cache the EDID even if no monitor is
>>  connected, in case it's plugged while suspended.
>> 
>>  Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com>
>>  ---
>>  drivers/gpu/drm/drm_connector.c | 9 ++++
>>  drivers/gpu/drm/drm_edid_load.c | 81 
>> ++++++++++++++++++++++++++++-----
>>  include/drm/drm_connector.h | 12 +++++
>>  include/drm/drm_edid.h | 3 ++
>>  4 files changed, 94 insertions(+), 11 deletions(-)
>> 
>>  diff --git a/drivers/gpu/drm/drm_connector.c
>>  b/drivers/gpu/drm/drm_connector.c
>>  index 1c48d162c77e..e8819ebf1c4b 100644
>>  --- a/drivers/gpu/drm/drm_connector.c
>>  +++ b/drivers/gpu/drm/drm_connector.c
>>  @@ -31,6 +31,7 @@
>>  #include <drm/drm_privacy_screen_consumer.h>
>>  #include <drm/drm_sysfs.h>
>> 
>>  +#include <linux/platform_device.h>
>>  #include <linux/uaccess.h>
>> 
>>  #include "drm_crtc_internal.h"
>>  @@ -289,6 +290,9 @@ int drm_connector_init(struct drm_device *dev,
>> 
>>   drm_connector_get_cmdline_mode(connector);
>> 
>>  + connector->edid_load_pdev = NULL;
>>  + drm_cache_edid_firmware(connector);
>>  +
>>   /* We should add connectors at the end to avoid upsetting the 
>> connector
>>    * index too much.
>>    */
>>  @@ -473,6 +477,11 @@ void drm_connector_cleanup(struct drm_connector
>>  *connector)
>>    connector->tile_group = NULL;
>>   }
>> 
>>  + if (connector->edid_load_pdev) {
>>  + platform_device_unregister(connector->edid_load_pdev);
>>  + connector->edid_load_pdev = NULL;
>>  + }
>>  +
> 
> The indentation of your patch is wrong in different places, like in 
> this
> if here. It should be like
> 
> + if (connector->edid_load_pdev) {
> + 	platform_device_unregister(connector->edid_load_pdev);
> + 	connector->edid_load_pdev = NULL;
> + }
> 
> ./scripts/checkpatch.pl can help you detect those issues for your v2
> 
> Thanks,
> 	André



  reply	other threads:[~2022-07-15  9:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 14:58 [PATCH] drm: Fix EDID firmware load on resume Matthieu CHARETTE
2022-07-08  7:14 ` Matthieu CHARETTE
2022-07-14 14:23 ` André Almeida
2022-07-15  9:03   ` Matthieu CHARETTE [this message]
2022-07-15  9:22     ` Matthieu CHARETTE
2022-07-16 19:04       ` kernel test robot
2022-07-16 22:08       ` kernel test robot
2022-07-16 22:39       ` kernel test robot
2022-07-17 12:18       ` kernel test robot
2022-07-27  7:41         ` Matthieu CHARETTE
2022-07-27  8:18           ` Takashi Iwai
2022-07-27 13:53             ` Matthieu CHARETTE
2022-08-02 14:29           ` Jani Nikula
2022-08-08 15:15             ` Matthieu CHARETTE
2022-08-08 17:19               ` Jani Nikula
2022-09-12 16:25                 ` Matthieu CHARETTE
2022-10-06 22:23                   ` Jani Nikula
2022-08-08 15:17             ` Matthieu CHARETTE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=N512FR.B1R49X9JM9FW2@gmail.com \
    --to=matthieu.charette@gmail.com \
    --cc=airlied@linux.ie \
    --cc=andrealmeid@igalia.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).