* [PATCH] drm: Fix EDID firmware load on resume @ 2022-07-06 14:58 Matthieu CHARETTE 2022-07-08 7:14 ` Matthieu CHARETTE 2022-07-14 14:23 ` André Almeida 0 siblings, 2 replies; 18+ messages in thread From: Matthieu CHARETTE @ 2022-07-06 14:58 UTC (permalink / raw) To: matthieu.charette Cc: tzimmermann, airlied, linux-kernel, matthieu.charette, dri-devel 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; + } + list_for_each_entry_safe(mode, t, &connector->probed_modes, head) drm_mode_remove(connector, mode); diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 37d8ba3ddb46..5a82be9917ec 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int data_size) return (edid[0x7e] + 1) * EDID_LENGTH; } +static struct platform_device *edid_pdev(const char *connector_name) +{ + struct platform_device *pdev = platform_device_register_simple(connector_name, -1, NULL, 0); + + if (IS_ERR(pdev)) { + DRM_ERROR("Failed to register EDID firmware platform device " + "for connector \"%s\"\n", connector_name); + return ERR_CAST(pdev); + } + + return pdev; +} + static void *edid_load(struct drm_connector *connector, const char *name, const char *connector_name) { @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector *connector, const char *name, fwdata = generic_edid[builtin]; fwsize = sizeof(generic_edid[builtin]); } else { - struct platform_device *pdev; + struct platform_device *pdev = connector->edid_load_pdev; int err; - pdev = platform_device_register_simple(connector_name, -1, NULL, 0); - if (IS_ERR(pdev)) { - DRM_ERROR("Failed to register EDID firmware platform device " - "for connector \"%s\"\n", connector_name); - return ERR_CAST(pdev); + if (WARN_ON(!pdev)) { + pdev = edid_pdev(connector_name); + if (IS_ERR(pdev)) + return ERR_CAST(pdev); + connector->edid_load_pdev = pdev; } err = request_firmware(&fw, name, &pdev->dev); - platform_device_unregister(pdev); if (err) { DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", name, err); @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector *connector, const char *name, return edid; } -struct edid *drm_load_edid_firmware(struct drm_connector *connector) +static char *edid_name(const char *connector_name) { - const char *connector_name = connector->name; char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; - struct edid *edid; if (edid_firmware[0] == '\0') return ERR_PTR(-ENOENT); @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct drm_connector *connector) if (*last == '\n') *last = '\0'; - edid = edid_load(connector, edidname, connector_name); + edidname = kstrdup(edidname, GFP_KERNEL); + if (!edidname) { + kfree(fwstr); + return ERR_PTR(-ENOMEM); + } + kfree(fwstr); + return edidname; +} + +void drm_cache_edid_firmware(struct drm_connector *connector) +{ + const char *connector_name = connector->name; + const char *edidname = edid_name(connector_name); + struct platform_device *pdev; + int err; + + if (IS_ERR(edidname)) + return; + + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= 0) { + kfree(edidname); + return; + } + + pdev = edid_pdev(connector_name); + if (IS_ERR(pdev)) { + kfree(edidname); + return; + } + connector->edid_load_pdev = pdev; + + err = firmware_request_cache(&pdev->dev, edidname); + if (err) + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed (err=%d)\n", + edidname, err); + + kfree(edidname); +} + +struct edid *drm_load_edid_firmware(struct drm_connector *connector) +{ + const char *connector_name = connector->name; + const char *edidname = edid_name(connector_name); + struct edid *edid; + + if (IS_ERR(edidname)) + return ERR_CAST(edidname); + + edid = edid_load(connector, edidname, connector_name); + kfree(edidname); return edid; } diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3ac4bf87f257..47c84741517e 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1573,6 +1573,18 @@ struct drm_connector { */ struct i2c_adapter *ddc; + /** + * @edid_load_pdev: Platform device for loading EDID via firmware. + * + * The platform device is registered in drm_connector_init() in case a + * custom EDID firmware is used with `edid_firmware` parameter. Otherwise, + * it is set to NULL. + * + * Platform device is unregistered in drm_connector_cleanup() if it + * is not NULL. + */ + struct platform_device *edid_load_pdev; + /** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index b2756753370b..b54cea3f1107 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE +void drm_cache_edid_firmware(struct drm_connector *connector); struct edid *drm_load_edid_firmware(struct drm_connector *connector); int __drm_set_edid_firmware_path(const char *path); int __drm_get_edid_firmware_path(char *buf, size_t bufsize); #else +static inline void +drm_cache_edid_firmware(struct drm_connector *connector); static inline struct edid * drm_load_edid_firmware(struct drm_connector *connector) { -- 2.36.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 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 1 sibling, 0 replies; 18+ messages in thread From: Matthieu CHARETTE @ 2022-07-08 7:14 UTC (permalink / raw) To: matthieu.charette; +Cc: tzimmermann, airlied, linux-kernel, dri-devel Sorry, I forgot to add a tag. --- Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 On Wed, Jul 6 2022 at 04:58:08 PM +0200, Matthieu CHARETTE <matthieu.charette@gmail.com> wrote: > 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; > + } > + > list_for_each_entry_safe(mode, t, &connector->probed_modes, head) > drm_mode_remove(connector, mode); > > diff --git a/drivers/gpu/drm/drm_edid_load.c > b/drivers/gpu/drm/drm_edid_load.c > index 37d8ba3ddb46..5a82be9917ec 100644 > --- a/drivers/gpu/drm/drm_edid_load.c > +++ b/drivers/gpu/drm/drm_edid_load.c > @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int > data_size) > return (edid[0x7e] + 1) * EDID_LENGTH; > } > > +static struct platform_device *edid_pdev(const char *connector_name) > +{ > + struct platform_device *pdev = > platform_device_register_simple(connector_name, -1, NULL, 0); > + > + if (IS_ERR(pdev)) { > + DRM_ERROR("Failed to register EDID firmware platform device " > + "for connector \"%s\"\n", connector_name); > + return ERR_CAST(pdev); > + } > + > + return pdev; > +} > + > static void *edid_load(struct drm_connector *connector, const char > *name, > const char *connector_name) > { > @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector > *connector, const char *name, > fwdata = generic_edid[builtin]; > fwsize = sizeof(generic_edid[builtin]); > } else { > - struct platform_device *pdev; > + struct platform_device *pdev = connector->edid_load_pdev; > int err; > > - pdev = platform_device_register_simple(connector_name, -1, NULL, 0); > - if (IS_ERR(pdev)) { > - DRM_ERROR("Failed to register EDID firmware platform device " > - "for connector \"%s\"\n", connector_name); > - return ERR_CAST(pdev); > + if (WARN_ON(!pdev)) { > + pdev = edid_pdev(connector_name); > + if (IS_ERR(pdev)) > + return ERR_CAST(pdev); > + connector->edid_load_pdev = pdev; > } > > err = request_firmware(&fw, name, &pdev->dev); > - platform_device_unregister(pdev); > if (err) { > DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", > name, err); > @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector > *connector, const char *name, > return edid; > } > > -struct edid *drm_load_edid_firmware(struct drm_connector *connector) > +static char *edid_name(const char *connector_name) > { > - const char *connector_name = connector->name; > char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; > - struct edid *edid; > > if (edid_firmware[0] == '\0') > return ERR_PTR(-ENOENT); > @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct > drm_connector *connector) > if (*last == '\n') > *last = '\0'; > > - edid = edid_load(connector, edidname, connector_name); > + edidname = kstrdup(edidname, GFP_KERNEL); > + if (!edidname) { > + kfree(fwstr); > + return ERR_PTR(-ENOMEM); > + } > + > kfree(fwstr); > + return edidname; > +} > + > +void drm_cache_edid_firmware(struct drm_connector *connector) > +{ > + const char *connector_name = connector->name; > + const char *edidname = edid_name(connector_name); > + struct platform_device *pdev; > + int err; > + > + if (IS_ERR(edidname)) > + return; > + > + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= 0) { > + kfree(edidname); > + return; > + } > + > + pdev = edid_pdev(connector_name); > + if (IS_ERR(pdev)) { > + kfree(edidname); > + return; > + } > + connector->edid_load_pdev = pdev; > + > + err = firmware_request_cache(&pdev->dev, edidname); > + if (err) > + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed (err=%d)\n", > + edidname, err); > + > + kfree(edidname); > +} > + > +struct edid *drm_load_edid_firmware(struct drm_connector *connector) > +{ > + const char *connector_name = connector->name; > + const char *edidname = edid_name(connector_name); > + struct edid *edid; > + > + if (IS_ERR(edidname)) > + return ERR_CAST(edidname); > + > + edid = edid_load(connector, edidname, connector_name); > + kfree(edidname); > > return edid; > } > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h > index 3ac4bf87f257..47c84741517e 100644 > --- a/include/drm/drm_connector.h > +++ b/include/drm/drm_connector.h > @@ -1573,6 +1573,18 @@ struct drm_connector { > */ > struct i2c_adapter *ddc; > > + /** > + * @edid_load_pdev: Platform device for loading EDID via firmware. > + * > + * The platform device is registered in drm_connector_init() in case > a > + * custom EDID firmware is used with `edid_firmware` parameter. > Otherwise, > + * it is set to NULL. > + * > + * Platform device is unregistered in drm_connector_cleanup() if it > + * is not NULL. > + */ > + struct platform_device *edid_load_pdev; > + > /** > * @null_edid_counter: track sinks that give us all zeros for the > EDID. > * Needed to workaround some HW bugs where we get all 0s > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h > index b2756753370b..b54cea3f1107 100644 > --- a/include/drm/drm_edid.h > +++ b/include/drm/drm_edid.h > @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector > *connector, > const struct drm_display_mode *mode); > > #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE > +void drm_cache_edid_firmware(struct drm_connector *connector); > struct edid *drm_load_edid_firmware(struct drm_connector *connector); > int __drm_set_edid_firmware_path(const char *path); > int __drm_get_edid_firmware_path(char *buf, size_t bufsize); > #else > +static inline void > +drm_cache_edid_firmware(struct drm_connector *connector); > static inline struct edid * > drm_load_edid_firmware(struct drm_connector *connector) > { > -- > 2.36.1 > > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 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 1 sibling, 1 reply; 18+ messages in thread From: André Almeida @ 2022-07-14 14:23 UTC (permalink / raw) To: Matthieu CHARETTE; +Cc: airlied, dri-devel, linux-kernel, tzimmermann 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é ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-07-14 14:23 ` André Almeida @ 2022-07-15 9:03 ` Matthieu CHARETTE 2022-07-15 9:22 ` Matthieu CHARETTE 0 siblings, 1 reply; 18+ messages in thread From: Matthieu CHARETTE @ 2022-07-15 9:03 UTC (permalink / raw) To: André Almeida; +Cc: tzimmermann, airlied, linux-kernel, dri-devel 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é ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] drm: Fix EDID firmware load on resume 2022-07-15 9:03 ` Matthieu CHARETTE @ 2022-07-15 9:22 ` Matthieu CHARETTE 2022-07-16 19:04 ` kernel test robot ` (3 more replies) 0 siblings, 4 replies; 18+ messages in thread From: Matthieu CHARETTE @ 2022-07-15 9:22 UTC (permalink / raw) To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel, andrealmeid Cc: Matthieu CHARETTE, linux-kernel, dri-devel 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. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 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; + } + list_for_each_entry_safe(mode, t, &connector->probed_modes, head) drm_mode_remove(connector, mode); diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 37d8ba3ddb46..5a82be9917ec 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int data_size) return (edid[0x7e] + 1) * EDID_LENGTH; } +static struct platform_device *edid_pdev(const char *connector_name) +{ + struct platform_device *pdev = platform_device_register_simple(connector_name, -1, NULL, 0); + + if (IS_ERR(pdev)) { + DRM_ERROR("Failed to register EDID firmware platform device " + "for connector \"%s\"\n", connector_name); + return ERR_CAST(pdev); + } + + return pdev; +} + static void *edid_load(struct drm_connector *connector, const char *name, const char *connector_name) { @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector *connector, const char *name, fwdata = generic_edid[builtin]; fwsize = sizeof(generic_edid[builtin]); } else { - struct platform_device *pdev; + struct platform_device *pdev = connector->edid_load_pdev; int err; - pdev = platform_device_register_simple(connector_name, -1, NULL, 0); - if (IS_ERR(pdev)) { - DRM_ERROR("Failed to register EDID firmware platform device " - "for connector \"%s\"\n", connector_name); - return ERR_CAST(pdev); + if (WARN_ON(!pdev)) { + pdev = edid_pdev(connector_name); + if (IS_ERR(pdev)) + return ERR_CAST(pdev); + connector->edid_load_pdev = pdev; } err = request_firmware(&fw, name, &pdev->dev); - platform_device_unregister(pdev); if (err) { DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", name, err); @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector *connector, const char *name, return edid; } -struct edid *drm_load_edid_firmware(struct drm_connector *connector) +static char *edid_name(const char *connector_name) { - const char *connector_name = connector->name; char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; - struct edid *edid; if (edid_firmware[0] == '\0') return ERR_PTR(-ENOENT); @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct drm_connector *connector) if (*last == '\n') *last = '\0'; - edid = edid_load(connector, edidname, connector_name); + edidname = kstrdup(edidname, GFP_KERNEL); + if (!edidname) { + kfree(fwstr); + return ERR_PTR(-ENOMEM); + } + kfree(fwstr); + return edidname; +} + +void drm_cache_edid_firmware(struct drm_connector *connector) +{ + const char *connector_name = connector->name; + const char *edidname = edid_name(connector_name); + struct platform_device *pdev; + int err; + + if (IS_ERR(edidname)) + return; + + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= 0) { + kfree(edidname); + return; + } + + pdev = edid_pdev(connector_name); + if (IS_ERR(pdev)) { + kfree(edidname); + return; + } + connector->edid_load_pdev = pdev; + + err = firmware_request_cache(&pdev->dev, edidname); + if (err) + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed (err=%d)\n", + edidname, err); + + kfree(edidname); +} + +struct edid *drm_load_edid_firmware(struct drm_connector *connector) +{ + const char *connector_name = connector->name; + const char *edidname = edid_name(connector_name); + struct edid *edid; + + if (IS_ERR(edidname)) + return ERR_CAST(edidname); + + edid = edid_load(connector, edidname, connector_name); + kfree(edidname); return edid; } diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3ac4bf87f257..47c84741517e 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1573,6 +1573,18 @@ struct drm_connector { */ struct i2c_adapter *ddc; + /** + * @edid_load_pdev: Platform device for loading EDID via firmware. + * + * The platform device is registered in drm_connector_init() in case a + * custom EDID firmware is used with `edid_firmware` parameter. Otherwise, + * it is set to NULL. + * + * Platform device is unregistered in drm_connector_cleanup() if it + * is not NULL. + */ + struct platform_device *edid_load_pdev; + /** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index b2756753370b..b54cea3f1107 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE +void drm_cache_edid_firmware(struct drm_connector *connector); struct edid *drm_load_edid_firmware(struct drm_connector *connector); int __drm_set_edid_firmware_path(const char *path); int __drm_get_edid_firmware_path(char *buf, size_t bufsize); #else +static inline void +drm_cache_edid_firmware(struct drm_connector *connector); static inline struct edid * drm_load_edid_firmware(struct drm_connector *connector) { -- 2.36.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-07-15 9:22 ` Matthieu CHARETTE @ 2022-07-16 19:04 ` kernel test robot 2022-07-16 22:08 ` kernel test robot ` (2 subsequent siblings) 3 siblings, 0 replies; 18+ messages in thread From: kernel test robot @ 2022-07-16 19:04 UTC (permalink / raw) To: Matthieu CHARETTE, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, andrealmeid Cc: Matthieu CHARETTE, kbuild-all, linux-kernel, dri-devel Hi Matthieu, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on v5.19-rc6] [also build test WARNING on linus/master] [cannot apply to drm-misc/drm-misc-next next-20220715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 base: 32346491ddf24599decca06190ebca03ff9de7f8 config: i386-randconfig-a003 (https://download.01.org/0day-ci/archive/20220717/202207170211.AaMpUwPs-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/e583aaf4f6464add35f2350c728d80a3fe790638 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 git checkout e583aaf4f6464add35f2350c728d80a3fe790638 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from drivers/gpu/drm/drm_connector.c:25: >> include/drm/drm_edid.h:387:1: warning: 'drm_cache_edid_firmware' used but never defined 387 | drm_cache_edid_firmware(struct drm_connector *connector); | ^~~~~~~~~~~~~~~~~~~~~~~ vim +/drm_cache_edid_firmware +387 include/drm/drm_edid.h 374 375 int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads); 376 int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb); 377 int drm_av_sync_delay(struct drm_connector *connector, 378 const struct drm_display_mode *mode); 379 380 #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE 381 void drm_cache_edid_firmware(struct drm_connector *connector); 382 struct edid *drm_load_edid_firmware(struct drm_connector *connector); 383 int __drm_set_edid_firmware_path(const char *path); 384 int __drm_get_edid_firmware_path(char *buf, size_t bufsize); 385 #else 386 static inline void > 387 drm_cache_edid_firmware(struct drm_connector *connector); 388 static inline struct edid * 389 drm_load_edid_firmware(struct drm_connector *connector) 390 { 391 return ERR_PTR(-ENOENT); 392 } 393 #endif 394 -- 0-DAY CI Kernel Test Service https://01.org/lkp ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 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 3 siblings, 0 replies; 18+ messages in thread From: kernel test robot @ 2022-07-16 22:08 UTC (permalink / raw) To: Matthieu CHARETTE, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, andrealmeid Cc: Matthieu CHARETTE, kbuild-all, linux-kernel, dri-devel Hi Matthieu, Thank you for the patch! Yet something to improve: [auto build test ERROR on v5.19-rc6] [also build test ERROR on linus/master] [cannot apply to drm-misc/drm-misc-next next-20220715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 base: 32346491ddf24599decca06190ebca03ff9de7f8 config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220717/202207170521.UXrz8URh-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/e583aaf4f6464add35f2350c728d80a3fe790638 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 git checkout e583aaf4f6464add35f2350c728d80a3fe790638 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): ld: certs/system_keyring.o: in function `load_system_certificate_list': system_keyring.c:(.init.text+0x149): undefined reference to `x509_load_certificate_list' ld: drivers/gpu/drm/drm_connector.o: in function `drm_connector_init': >> drm_connector.c:(.text+0x21ce): undefined reference to `drm_cache_edid_firmware' -- 0-DAY CI Kernel Test Service https://01.org/lkp ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 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 3 siblings, 0 replies; 18+ messages in thread From: kernel test robot @ 2022-07-16 22:39 UTC (permalink / raw) To: Matthieu CHARETTE, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, andrealmeid Cc: Matthieu CHARETTE, kbuild-all, linux-kernel, dri-devel Hi Matthieu, Thank you for the patch! Yet something to improve: [auto build test ERROR on v5.19-rc6] [also build test ERROR on linus/master] [cannot apply to drm-misc/drm-misc-next next-20220715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 base: 32346491ddf24599decca06190ebca03ff9de7f8 config: parisc-randconfig-r023-20220717 (https://download.01.org/0day-ci/archive/20220717/202207170636.Yv3aXya1-lkp@intel.com/config) compiler: hppa-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/e583aaf4f6464add35f2350c728d80a3fe790638 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 git checkout e583aaf4f6464add35f2350c728d80a3fe790638 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): hppa-linux-ld: drivers/gpu/drm/drm_connector.o: in function `.LC507': >> drm_connector.c:(.rodata.cst4+0x1f8): undefined reference to `drm_cache_edid_firmware' -- 0-DAY CI Kernel Test Service https://01.org/lkp ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-07-15 9:22 ` Matthieu CHARETTE ` (2 preceding siblings ...) 2022-07-16 22:39 ` kernel test robot @ 2022-07-17 12:18 ` kernel test robot 2022-07-27 7:41 ` Matthieu CHARETTE 3 siblings, 1 reply; 18+ messages in thread From: kernel test robot @ 2022-07-17 12:18 UTC (permalink / raw) To: Matthieu CHARETTE, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, andrealmeid Cc: Matthieu CHARETTE, kbuild-all, linux-kernel, dri-devel Hi Matthieu, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on v5.19-rc6] [also build test WARNING on linus/master] [cannot apply to drm-misc/drm-misc-next next-20220715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 base: 32346491ddf24599decca06190ebca03ff9de7f8 config: loongarch-randconfig-s052-20220715 (https://download.01.org/0day-ci/archive/20220717/202207172035.mtErdlaw-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/e583aaf4f6464add35f2350c728d80a3fe790638 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthieu-CHARETTE/drm-Fix-EDID-firmware-load-on-resume/20220716-214028 git checkout e583aaf4f6464add35f2350c728d80a3fe790638 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@intel.com> sparse warnings: (new ones prefixed by >>) drivers/gpu/drm/drm_connector.c: note: in included file: >> include/drm/drm_edid.h:387:24: sparse: sparse: marked inline, but without a definition vim +387 include/drm/drm_edid.h 374 375 int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads); 376 int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb); 377 int drm_av_sync_delay(struct drm_connector *connector, 378 const struct drm_display_mode *mode); 379 380 #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE 381 void drm_cache_edid_firmware(struct drm_connector *connector); 382 struct edid *drm_load_edid_firmware(struct drm_connector *connector); 383 int __drm_set_edid_firmware_path(const char *path); 384 int __drm_get_edid_firmware_path(char *buf, size_t bufsize); 385 #else 386 static inline void > 387 drm_cache_edid_firmware(struct drm_connector *connector); 388 static inline struct edid * 389 drm_load_edid_firmware(struct drm_connector *connector) 390 { 391 return ERR_PTR(-ENOENT); 392 } 393 #endif 394 -- 0-DAY CI Kernel Test Service https://01.org/lkp ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] drm: Fix EDID firmware load on resume 2022-07-17 12:18 ` kernel test robot @ 2022-07-27 7:41 ` Matthieu CHARETTE 2022-07-27 8:18 ` Takashi Iwai 2022-08-02 14:29 ` Jani Nikula 0 siblings, 2 replies; 18+ messages in thread From: Matthieu CHARETTE @ 2022-07-27 7:41 UTC (permalink / raw) To: lkp Cc: kbuild-all, tzimmermann, airlied, linux-kernel, dri-devel, matthieu.charette, andrealmeid 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. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 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; + } + list_for_each_entry_safe(mode, t, &connector->probed_modes, head) drm_mode_remove(connector, mode); diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 37d8ba3ddb46..5a82be9917ec 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int data_size) return (edid[0x7e] + 1) * EDID_LENGTH; } +static struct platform_device *edid_pdev(const char *connector_name) +{ + struct platform_device *pdev = platform_device_register_simple(connector_name, -1, NULL, 0); + + if (IS_ERR(pdev)) { + DRM_ERROR("Failed to register EDID firmware platform device " + "for connector \"%s\"\n", connector_name); + return ERR_CAST(pdev); + } + + return pdev; +} + static void *edid_load(struct drm_connector *connector, const char *name, const char *connector_name) { @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector *connector, const char *name, fwdata = generic_edid[builtin]; fwsize = sizeof(generic_edid[builtin]); } else { - struct platform_device *pdev; + struct platform_device *pdev = connector->edid_load_pdev; int err; - pdev = platform_device_register_simple(connector_name, -1, NULL, 0); - if (IS_ERR(pdev)) { - DRM_ERROR("Failed to register EDID firmware platform device " - "for connector \"%s\"\n", connector_name); - return ERR_CAST(pdev); + if (WARN_ON(!pdev)) { + pdev = edid_pdev(connector_name); + if (IS_ERR(pdev)) + return ERR_CAST(pdev); + connector->edid_load_pdev = pdev; } err = request_firmware(&fw, name, &pdev->dev); - platform_device_unregister(pdev); if (err) { DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", name, err); @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector *connector, const char *name, return edid; } -struct edid *drm_load_edid_firmware(struct drm_connector *connector) +static char *edid_name(const char *connector_name) { - const char *connector_name = connector->name; char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; - struct edid *edid; if (edid_firmware[0] == '\0') return ERR_PTR(-ENOENT); @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct drm_connector *connector) if (*last == '\n') *last = '\0'; - edid = edid_load(connector, edidname, connector_name); + edidname = kstrdup(edidname, GFP_KERNEL); + if (!edidname) { + kfree(fwstr); + return ERR_PTR(-ENOMEM); + } + kfree(fwstr); + return edidname; +} + +void drm_cache_edid_firmware(struct drm_connector *connector) +{ + const char *connector_name = connector->name; + const char *edidname = edid_name(connector_name); + struct platform_device *pdev; + int err; + + if (IS_ERR(edidname)) + return; + + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= 0) { + kfree(edidname); + return; + } + + pdev = edid_pdev(connector_name); + if (IS_ERR(pdev)) { + kfree(edidname); + return; + } + connector->edid_load_pdev = pdev; + + err = firmware_request_cache(&pdev->dev, edidname); + if (err) + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed (err=%d)\n", + edidname, err); + + kfree(edidname); +} + +struct edid *drm_load_edid_firmware(struct drm_connector *connector) +{ + const char *connector_name = connector->name; + const char *edidname = edid_name(connector_name); + struct edid *edid; + + if (IS_ERR(edidname)) + return ERR_CAST(edidname); + + edid = edid_load(connector, edidname, connector_name); + kfree(edidname); return edid; } diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3ac4bf87f257..47c84741517e 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1573,6 +1573,18 @@ struct drm_connector { */ struct i2c_adapter *ddc; + /** + * @edid_load_pdev: Platform device for loading EDID via firmware. + * + * The platform device is registered in drm_connector_init() in case a + * custom EDID firmware is used with `edid_firmware` parameter. Otherwise, + * it is set to NULL. + * + * Platform device is unregistered in drm_connector_cleanup() if it + * is not NULL. + */ + struct platform_device *edid_load_pdev; + /** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index b2756753370b..e907c928a35d 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE +void drm_cache_edid_firmware(struct drm_connector *connector); struct edid *drm_load_edid_firmware(struct drm_connector *connector); int __drm_set_edid_firmware_path(const char *path); int __drm_get_edid_firmware_path(char *buf, size_t bufsize); #else +inline void +drm_cache_edid_firmware(struct drm_connector *connector); static inline struct edid * drm_load_edid_firmware(struct drm_connector *connector) { -- 2.37.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 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 1 sibling, 1 reply; 18+ messages in thread From: Takashi Iwai @ 2022-07-27 8:18 UTC (permalink / raw) To: Matthieu CHARETTE Cc: kbuild-all, lkp, airlied, tzimmermann, linux-kernel, dri-devel, andrealmeid On Wed, 27 Jul 2022 09:41:52 +0200, Matthieu CHARETTE wrote: > > 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. > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 > Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com> Can we simply cache the already loaded EDID bytes instead? Something like below (totally untested). thanks, Takashi -- 8< -- diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 1c48d162c77e..b9d2803b518b 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -286,6 +286,7 @@ int drm_connector_init(struct drm_device *dev, connector->status = connector_status_unknown; connector->display_info.panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; + connector->firmware_edid = NULL; drm_connector_get_cmdline_mode(connector); @@ -485,6 +486,7 @@ void drm_connector_cleanup(struct drm_connector *connector) ida_simple_remove(&dev->mode_config.connector_ida, connector->index); + kfree(connector->firmware_edid); kfree(connector->display_info.bus_formats); drm_mode_object_unregister(dev, &connector->base); kfree(connector->name); diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 37d8ba3ddb46..a38fe4e00e4a 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -253,6 +253,13 @@ static void *edid_load(struct drm_connector *connector, const char *name, edid = new_edid; } + connector->firmware_edid = drm_edid_duplicate((struct edid *)edid); + if (!connector->firmware_edid) { + kfree(edid); + edid = ERR_PTR(-ENOMEM); + goto out; + } + DRM_INFO("Got %s EDID base block and %d extension%s from " "\"%s\" for connector \"%s\"\n", (builtin >= 0) ? "built-in" : "external", valid_extensions, valid_extensions == 1 ? "" : "s", @@ -269,6 +276,12 @@ struct edid *drm_load_edid_firmware(struct drm_connector *connector) char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; struct edid *edid; + /* already loaded? */ + if (connector->firmware_edid) { + edid = drm_edid_duplicate(connector->firmware_edid); + return edid ? edid : ERR_PTR(-ENOMEM); + } + if (edid_firmware[0] == '\0') return ERR_PTR(-ENOENT); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3ac4bf87f257..b5d0c87327a3 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1528,6 +1528,8 @@ struct drm_connector { enum drm_connector_force force; /** @override_edid: has the EDID been overwritten through debugfs for testing? */ bool override_edid; + /** @firmware_edid: the cached firmware EDID bytes */ + struct edid *firmware_edid; /** @epoch_counter: used to detect any other changes in connector, besides status */ u64 epoch_counter; ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-07-27 8:18 ` Takashi Iwai @ 2022-07-27 13:53 ` Matthieu CHARETTE 0 siblings, 0 replies; 18+ messages in thread From: Matthieu CHARETTE @ 2022-07-27 13:53 UTC (permalink / raw) To: Takashi Iwai Cc: kbuild-all, lkp, airlied, tzimmermann, linux-kernel, dri-devel, andrealmeid Hi, Caching the EDID via the firmware API makes the kernel able to reclaim the memory in case it's needed. And eventually, the kernel will load it again before suspending. But for 128 bytes, even if we have many monitors it will not make any difference. I don't know if storing a platform device can take more memory than 128 bytes of data. I let you decide which option is better. Just tell me if I should cache the bytes instead. Thanks. Matthieu On Wed, Jul 27 2022 at 10:18:48 AM +0200, Takashi Iwai <tiwai@suse.de> wrote: > On Wed, 27 Jul 2022 09:41:52 +0200, > Matthieu CHARETTE wrote: >> >> 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. >> >> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 >> Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com> > > Can we simply cache the already loaded EDID bytes instead? > Something like below (totally untested). > > > thanks, > > Takashi > > -- 8< -- > diff --git a/drivers/gpu/drm/drm_connector.c > b/drivers/gpu/drm/drm_connector.c > index 1c48d162c77e..b9d2803b518b 100644 > --- a/drivers/gpu/drm/drm_connector.c > +++ b/drivers/gpu/drm/drm_connector.c > @@ -286,6 +286,7 @@ int drm_connector_init(struct drm_device *dev, > connector->status = connector_status_unknown; > connector->display_info.panel_orientation = > DRM_MODE_PANEL_ORIENTATION_UNKNOWN; > + connector->firmware_edid = NULL; > > drm_connector_get_cmdline_mode(connector); > > @@ -485,6 +486,7 @@ void drm_connector_cleanup(struct drm_connector > *connector) > ida_simple_remove(&dev->mode_config.connector_ida, > connector->index); > > + kfree(connector->firmware_edid); > kfree(connector->display_info.bus_formats); > drm_mode_object_unregister(dev, &connector->base); > kfree(connector->name); > diff --git a/drivers/gpu/drm/drm_edid_load.c > b/drivers/gpu/drm/drm_edid_load.c > index 37d8ba3ddb46..a38fe4e00e4a 100644 > --- a/drivers/gpu/drm/drm_edid_load.c > +++ b/drivers/gpu/drm/drm_edid_load.c > @@ -253,6 +253,13 @@ static void *edid_load(struct drm_connector > *connector, const char *name, > edid = new_edid; > } > > + connector->firmware_edid = drm_edid_duplicate((struct edid *)edid); > + if (!connector->firmware_edid) { > + kfree(edid); > + edid = ERR_PTR(-ENOMEM); > + goto out; > + } > + > DRM_INFO("Got %s EDID base block and %d extension%s from " > "\"%s\" for connector \"%s\"\n", (builtin >= 0) ? "built-in" : > "external", valid_extensions, valid_extensions == 1 ? "" : "s", > @@ -269,6 +276,12 @@ struct edid *drm_load_edid_firmware(struct > drm_connector *connector) > char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; > struct edid *edid; > > + /* already loaded? */ > + if (connector->firmware_edid) { > + edid = drm_edid_duplicate(connector->firmware_edid); > + return edid ? edid : ERR_PTR(-ENOMEM); > + } > + > if (edid_firmware[0] == '\0') > return ERR_PTR(-ENOENT); > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h > index 3ac4bf87f257..b5d0c87327a3 100644 > --- a/include/drm/drm_connector.h > +++ b/include/drm/drm_connector.h > @@ -1528,6 +1528,8 @@ struct drm_connector { > enum drm_connector_force force; > /** @override_edid: has the EDID been overwritten through debugfs > for testing? */ > bool override_edid; > + /** @firmware_edid: the cached firmware EDID bytes */ > + struct edid *firmware_edid; > /** @epoch_counter: used to detect any other changes in connector, > besides status */ > u64 epoch_counter; > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-07-27 7:41 ` Matthieu CHARETTE 2022-07-27 8:18 ` Takashi Iwai @ 2022-08-02 14:29 ` Jani Nikula 2022-08-08 15:15 ` Matthieu CHARETTE 2022-08-08 15:17 ` Matthieu CHARETTE 1 sibling, 2 replies; 18+ messages in thread From: Jani Nikula @ 2022-08-02 14:29 UTC (permalink / raw) To: Matthieu CHARETTE, lkp Cc: kbuild-all, airlied, linux-kernel, dri-devel, matthieu.charette, tzimmermann, andrealmeid On Wed, 27 Jul 2022, Matthieu CHARETTE <matthieu.charette@gmail.com> wrote: > 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. AFAICT this breaks changing drm.edid_firmware runtime. BR, Jani. > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 > 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; > + } > + > list_for_each_entry_safe(mode, t, &connector->probed_modes, head) > drm_mode_remove(connector, mode); > > diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c > index 37d8ba3ddb46..5a82be9917ec 100644 > --- a/drivers/gpu/drm/drm_edid_load.c > +++ b/drivers/gpu/drm/drm_edid_load.c > @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int data_size) > return (edid[0x7e] + 1) * EDID_LENGTH; > } > > +static struct platform_device *edid_pdev(const char *connector_name) > +{ > + struct platform_device *pdev = platform_device_register_simple(connector_name, -1, NULL, 0); > + > + if (IS_ERR(pdev)) { > + DRM_ERROR("Failed to register EDID firmware platform device " > + "for connector \"%s\"\n", connector_name); > + return ERR_CAST(pdev); > + } > + > + return pdev; > +} > + > static void *edid_load(struct drm_connector *connector, const char *name, > const char *connector_name) > { > @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector *connector, const char *name, > fwdata = generic_edid[builtin]; > fwsize = sizeof(generic_edid[builtin]); > } else { > - struct platform_device *pdev; > + struct platform_device *pdev = connector->edid_load_pdev; > int err; > > - pdev = platform_device_register_simple(connector_name, -1, NULL, 0); > - if (IS_ERR(pdev)) { > - DRM_ERROR("Failed to register EDID firmware platform device " > - "for connector \"%s\"\n", connector_name); > - return ERR_CAST(pdev); > + if (WARN_ON(!pdev)) { > + pdev = edid_pdev(connector_name); > + if (IS_ERR(pdev)) > + return ERR_CAST(pdev); > + connector->edid_load_pdev = pdev; > } > > err = request_firmware(&fw, name, &pdev->dev); > - platform_device_unregister(pdev); > if (err) { > DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", > name, err); > @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector *connector, const char *name, > return edid; > } > > -struct edid *drm_load_edid_firmware(struct drm_connector *connector) > +static char *edid_name(const char *connector_name) > { > - const char *connector_name = connector->name; > char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; > - struct edid *edid; > > if (edid_firmware[0] == '\0') > return ERR_PTR(-ENOENT); > @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct drm_connector *connector) > if (*last == '\n') > *last = '\0'; > > - edid = edid_load(connector, edidname, connector_name); > + edidname = kstrdup(edidname, GFP_KERNEL); > + if (!edidname) { > + kfree(fwstr); > + return ERR_PTR(-ENOMEM); > + } > + > kfree(fwstr); > + return edidname; > +} > + > +void drm_cache_edid_firmware(struct drm_connector *connector) > +{ > + const char *connector_name = connector->name; > + const char *edidname = edid_name(connector_name); > + struct platform_device *pdev; > + int err; > + > + if (IS_ERR(edidname)) > + return; > + > + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= 0) { > + kfree(edidname); > + return; > + } > + > + pdev = edid_pdev(connector_name); > + if (IS_ERR(pdev)) { > + kfree(edidname); > + return; > + } > + connector->edid_load_pdev = pdev; > + > + err = firmware_request_cache(&pdev->dev, edidname); > + if (err) > + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed (err=%d)\n", > + edidname, err); > + > + kfree(edidname); > +} > + > +struct edid *drm_load_edid_firmware(struct drm_connector *connector) > +{ > + const char *connector_name = connector->name; > + const char *edidname = edid_name(connector_name); > + struct edid *edid; > + > + if (IS_ERR(edidname)) > + return ERR_CAST(edidname); > + > + edid = edid_load(connector, edidname, connector_name); > + kfree(edidname); > > return edid; > } > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h > index 3ac4bf87f257..47c84741517e 100644 > --- a/include/drm/drm_connector.h > +++ b/include/drm/drm_connector.h > @@ -1573,6 +1573,18 @@ struct drm_connector { > */ > struct i2c_adapter *ddc; > > + /** > + * @edid_load_pdev: Platform device for loading EDID via firmware. > + * > + * The platform device is registered in drm_connector_init() in case a > + * custom EDID firmware is used with `edid_firmware` parameter. Otherwise, > + * it is set to NULL. > + * > + * Platform device is unregistered in drm_connector_cleanup() if it > + * is not NULL. > + */ > + struct platform_device *edid_load_pdev; > + > /** > * @null_edid_counter: track sinks that give us all zeros for the EDID. > * Needed to workaround some HW bugs where we get all 0s > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h > index b2756753370b..e907c928a35d 100644 > --- a/include/drm/drm_edid.h > +++ b/include/drm/drm_edid.h > @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector *connector, > const struct drm_display_mode *mode); > > #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE > +void drm_cache_edid_firmware(struct drm_connector *connector); > struct edid *drm_load_edid_firmware(struct drm_connector *connector); > int __drm_set_edid_firmware_path(const char *path); > int __drm_get_edid_firmware_path(char *buf, size_t bufsize); > #else > +inline void > +drm_cache_edid_firmware(struct drm_connector *connector); > static inline struct edid * > drm_load_edid_firmware(struct drm_connector *connector) > { -- Jani Nikula, Intel Open Source Graphics Center ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-08-02 14:29 ` Jani Nikula @ 2022-08-08 15:15 ` Matthieu CHARETTE 2022-08-08 17:19 ` Jani Nikula 2022-08-08 15:17 ` Matthieu CHARETTE 1 sibling, 1 reply; 18+ messages in thread From: Matthieu CHARETTE @ 2022-08-08 15:15 UTC (permalink / raw) To: Jani Nikula Cc: kbuild-all, lkp, airlied, linux-kernel, dri-devel, tzimmermann, andrealmeid [-- Attachment #1: Type: text/plain, Size: 8275 bytes --] Sorry, What do you mean? Matthieu On Tue, Aug 2 2022 at 05:29:12 PM +0300, Jani Nikula <jani.nikula@linux.intel.com> wrote: > On Wed, 27 Jul 2022, Matthieu CHARETTE <matthieu.charette@gmail.com > <mailto:matthieu.charette@gmail.com>> wrote: >> 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. > > AFAICT this breaks changing drm.edid_firmware runtime. > > BR, > Jani. > >> >> Link: <https://gitlab.freedesktop.org/drm/amd/-/issues/2061> >> Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com >> <mailto: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; >> + } >> + >> list_for_each_entry_safe(mode, t, &connector->probed_modes, head) >> drm_mode_remove(connector, mode); >> >> diff --git a/drivers/gpu/drm/drm_edid_load.c >> b/drivers/gpu/drm/drm_edid_load.c >> index 37d8ba3ddb46..5a82be9917ec 100644 >> --- a/drivers/gpu/drm/drm_edid_load.c >> +++ b/drivers/gpu/drm/drm_edid_load.c >> @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int >> data_size) >> return (edid[0x7e] + 1) * EDID_LENGTH; >> } >> >> +static struct platform_device *edid_pdev(const char >> *connector_name) >> +{ >> + struct platform_device *pdev = >> platform_device_register_simple(connector_name, -1, NULL, 0); >> + >> + if (IS_ERR(pdev)) { >> + DRM_ERROR("Failed to register EDID firmware platform device " >> + "for connector \"%s\"\n", connector_name); >> + return ERR_CAST(pdev); >> + } >> + >> + return pdev; >> +} >> + >> static void *edid_load(struct drm_connector *connector, const char >> *name, >> const char *connector_name) >> { >> @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector >> *connector, const char *name, >> fwdata = generic_edid[builtin]; >> fwsize = sizeof(generic_edid[builtin]); >> } else { >> - struct platform_device *pdev; >> + struct platform_device *pdev = connector->edid_load_pdev; >> int err; >> >> - pdev = platform_device_register_simple(connector_name, -1, NULL, >> 0); >> - if (IS_ERR(pdev)) { >> - DRM_ERROR("Failed to register EDID firmware platform device " >> - "for connector \"%s\"\n", connector_name); >> - return ERR_CAST(pdev); >> + if (WARN_ON(!pdev)) { >> + pdev = edid_pdev(connector_name); >> + if (IS_ERR(pdev)) >> + return ERR_CAST(pdev); >> + connector->edid_load_pdev = pdev; >> } >> >> err = request_firmware(&fw, name, &pdev->dev); >> - platform_device_unregister(pdev); >> if (err) { >> DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", >> name, err); >> @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector >> *connector, const char *name, >> return edid; >> } >> >> -struct edid *drm_load_edid_firmware(struct drm_connector >> *connector) >> +static char *edid_name(const char *connector_name) >> { >> - const char *connector_name = connector->name; >> char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; >> - struct edid *edid; >> >> if (edid_firmware[0] == '\0') >> return ERR_PTR(-ENOENT); >> @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct >> drm_connector *connector) >> if (*last == '\n') >> *last = '\0'; >> >> - edid = edid_load(connector, edidname, connector_name); >> + edidname = kstrdup(edidname, GFP_KERNEL); >> + if (!edidname) { >> + kfree(fwstr); >> + return ERR_PTR(-ENOMEM); >> + } >> + >> kfree(fwstr); >> + return edidname; >> +} >> + >> +void drm_cache_edid_firmware(struct drm_connector *connector) >> +{ >> + const char *connector_name = connector->name; >> + const char *edidname = edid_name(connector_name); >> + struct platform_device *pdev; >> + int err; >> + >> + if (IS_ERR(edidname)) >> + return; >> + >> + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= >> 0) { >> + kfree(edidname); >> + return; >> + } >> + >> + pdev = edid_pdev(connector_name); >> + if (IS_ERR(pdev)) { >> + kfree(edidname); >> + return; >> + } >> + connector->edid_load_pdev = pdev; >> + >> + err = firmware_request_cache(&pdev->dev, edidname); >> + if (err) >> + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed >> (err=%d)\n", >> + edidname, err); >> + >> + kfree(edidname); >> +} >> + >> +struct edid *drm_load_edid_firmware(struct drm_connector >> *connector) >> +{ >> + const char *connector_name = connector->name; >> + const char *edidname = edid_name(connector_name); >> + struct edid *edid; >> + >> + if (IS_ERR(edidname)) >> + return ERR_CAST(edidname); >> + >> + edid = edid_load(connector, edidname, connector_name); >> + kfree(edidname); >> >> return edid; >> } >> diff --git a/include/drm/drm_connector.h >> b/include/drm/drm_connector.h >> index 3ac4bf87f257..47c84741517e 100644 >> --- a/include/drm/drm_connector.h >> +++ b/include/drm/drm_connector.h >> @@ -1573,6 +1573,18 @@ struct drm_connector { >> */ >> struct i2c_adapter *ddc; >> >> + /** >> + * @edid_load_pdev: Platform device for loading EDID via firmware. >> + * >> + * The platform device is registered in drm_connector_init() in >> case a >> + * custom EDID firmware is used with `edid_firmware` parameter. >> Otherwise, >> + * it is set to NULL. >> + * >> + * Platform device is unregistered in drm_connector_cleanup() if >> it >> + * is not NULL. >> + */ >> + struct platform_device *edid_load_pdev; >> + >> /** >> * @null_edid_counter: track sinks that give us all zeros for the >> EDID. >> * Needed to workaround some HW bugs where we get all 0s >> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h >> index b2756753370b..e907c928a35d 100644 >> --- a/include/drm/drm_edid.h >> +++ b/include/drm/drm_edid.h >> @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector >> *connector, >> const struct drm_display_mode *mode); >> >> #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE >> +void drm_cache_edid_firmware(struct drm_connector *connector); >> struct edid *drm_load_edid_firmware(struct drm_connector >> *connector); >> int __drm_set_edid_firmware_path(const char *path); >> int __drm_get_edid_firmware_path(char *buf, size_t bufsize); >> #else >> +inline void >> +drm_cache_edid_firmware(struct drm_connector *connector); >> static inline struct edid * >> drm_load_edid_firmware(struct drm_connector *connector) >> { > > -- > Jani Nikula, Intel Open Source Graphics Center [-- Attachment #2: Type: text/html, Size: 7990 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-08-08 15:15 ` Matthieu CHARETTE @ 2022-08-08 17:19 ` Jani Nikula 2022-09-12 16:25 ` Matthieu CHARETTE 0 siblings, 1 reply; 18+ messages in thread From: Jani Nikula @ 2022-08-08 17:19 UTC (permalink / raw) To: Matthieu CHARETTE Cc: kbuild-all, lkp, airlied, linux-kernel, dri-devel, tzimmermann, andrealmeid On Mon, 08 Aug 2022, Matthieu CHARETTE <matthieu.charette@gmail.com> wrote: > Sorry, What do you mean? You cache with one name at connector init time, but the name specified using drm.edid_firmware may be changed whenever, to cause the next EDID read to use a different EDID firmware. BR, Jani. > > Matthieu > > On Tue, Aug 2 2022 at 05:29:12 PM +0300, Jani Nikula > <jani.nikula@linux.intel.com> wrote: >> On Wed, 27 Jul 2022, Matthieu CHARETTE <matthieu.charette@gmail.com >> <mailto:matthieu.charette@gmail.com>> wrote: >>> 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. >> >> AFAICT this breaks changing drm.edid_firmware runtime. >> >> BR, >> Jani. >> >>> >>> Link: <https://gitlab.freedesktop.org/drm/amd/-/issues/2061> >>> Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com >>> <mailto: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; >>> + } >>> + >>> list_for_each_entry_safe(mode, t, &connector->probed_modes, head) >>> drm_mode_remove(connector, mode); >>> >>> diff --git a/drivers/gpu/drm/drm_edid_load.c >>> b/drivers/gpu/drm/drm_edid_load.c >>> index 37d8ba3ddb46..5a82be9917ec 100644 >>> --- a/drivers/gpu/drm/drm_edid_load.c >>> +++ b/drivers/gpu/drm/drm_edid_load.c >>> @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int >>> data_size) >>> return (edid[0x7e] + 1) * EDID_LENGTH; >>> } >>> >>> +static struct platform_device *edid_pdev(const char >>> *connector_name) >>> +{ >>> + struct platform_device *pdev = >>> platform_device_register_simple(connector_name, -1, NULL, 0); >>> + >>> + if (IS_ERR(pdev)) { >>> + DRM_ERROR("Failed to register EDID firmware platform device " >>> + "for connector \"%s\"\n", connector_name); >>> + return ERR_CAST(pdev); >>> + } >>> + >>> + return pdev; >>> +} >>> + >>> static void *edid_load(struct drm_connector *connector, const char >>> *name, >>> const char *connector_name) >>> { >>> @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector >>> *connector, const char *name, >>> fwdata = generic_edid[builtin]; >>> fwsize = sizeof(generic_edid[builtin]); >>> } else { >>> - struct platform_device *pdev; >>> + struct platform_device *pdev = connector->edid_load_pdev; >>> int err; >>> >>> - pdev = platform_device_register_simple(connector_name, -1, NULL, >>> 0); >>> - if (IS_ERR(pdev)) { >>> - DRM_ERROR("Failed to register EDID firmware platform device " >>> - "for connector \"%s\"\n", connector_name); >>> - return ERR_CAST(pdev); >>> + if (WARN_ON(!pdev)) { >>> + pdev = edid_pdev(connector_name); >>> + if (IS_ERR(pdev)) >>> + return ERR_CAST(pdev); >>> + connector->edid_load_pdev = pdev; >>> } >>> >>> err = request_firmware(&fw, name, &pdev->dev); >>> - platform_device_unregister(pdev); >>> if (err) { >>> DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", >>> name, err); >>> @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector >>> *connector, const char *name, >>> return edid; >>> } >>> >>> -struct edid *drm_load_edid_firmware(struct drm_connector >>> *connector) >>> +static char *edid_name(const char *connector_name) >>> { >>> - const char *connector_name = connector->name; >>> char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; >>> - struct edid *edid; >>> >>> if (edid_firmware[0] == '\0') >>> return ERR_PTR(-ENOENT); >>> @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct >>> drm_connector *connector) >>> if (*last == '\n') >>> *last = '\0'; >>> >>> - edid = edid_load(connector, edidname, connector_name); >>> + edidname = kstrdup(edidname, GFP_KERNEL); >>> + if (!edidname) { >>> + kfree(fwstr); >>> + return ERR_PTR(-ENOMEM); >>> + } >>> + >>> kfree(fwstr); >>> + return edidname; >>> +} >>> + >>> +void drm_cache_edid_firmware(struct drm_connector *connector) >>> +{ >>> + const char *connector_name = connector->name; >>> + const char *edidname = edid_name(connector_name); >>> + struct platform_device *pdev; >>> + int err; >>> + >>> + if (IS_ERR(edidname)) >>> + return; >>> + >>> + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= >>> 0) { >>> + kfree(edidname); >>> + return; >>> + } >>> + >>> + pdev = edid_pdev(connector_name); >>> + if (IS_ERR(pdev)) { >>> + kfree(edidname); >>> + return; >>> + } >>> + connector->edid_load_pdev = pdev; >>> + >>> + err = firmware_request_cache(&pdev->dev, edidname); >>> + if (err) >>> + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed >>> (err=%d)\n", >>> + edidname, err); >>> + >>> + kfree(edidname); >>> +} >>> + >>> +struct edid *drm_load_edid_firmware(struct drm_connector >>> *connector) >>> +{ >>> + const char *connector_name = connector->name; >>> + const char *edidname = edid_name(connector_name); >>> + struct edid *edid; >>> + >>> + if (IS_ERR(edidname)) >>> + return ERR_CAST(edidname); >>> + >>> + edid = edid_load(connector, edidname, connector_name); >>> + kfree(edidname); >>> >>> return edid; >>> } >>> diff --git a/include/drm/drm_connector.h >>> b/include/drm/drm_connector.h >>> index 3ac4bf87f257..47c84741517e 100644 >>> --- a/include/drm/drm_connector.h >>> +++ b/include/drm/drm_connector.h >>> @@ -1573,6 +1573,18 @@ struct drm_connector { >>> */ >>> struct i2c_adapter *ddc; >>> >>> + /** >>> + * @edid_load_pdev: Platform device for loading EDID via firmware. >>> + * >>> + * The platform device is registered in drm_connector_init() in >>> case a >>> + * custom EDID firmware is used with `edid_firmware` parameter. >>> Otherwise, >>> + * it is set to NULL. >>> + * >>> + * Platform device is unregistered in drm_connector_cleanup() if >>> it >>> + * is not NULL. >>> + */ >>> + struct platform_device *edid_load_pdev; >>> + >>> /** >>> * @null_edid_counter: track sinks that give us all zeros for the >>> EDID. >>> * Needed to workaround some HW bugs where we get all 0s >>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h >>> index b2756753370b..e907c928a35d 100644 >>> --- a/include/drm/drm_edid.h >>> +++ b/include/drm/drm_edid.h >>> @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector >>> *connector, >>> const struct drm_display_mode *mode); >>> >>> #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE >>> +void drm_cache_edid_firmware(struct drm_connector *connector); >>> struct edid *drm_load_edid_firmware(struct drm_connector >>> *connector); >>> int __drm_set_edid_firmware_path(const char *path); >>> int __drm_get_edid_firmware_path(char *buf, size_t bufsize); >>> #else >>> +inline void >>> +drm_cache_edid_firmware(struct drm_connector *connector); >>> static inline struct edid * >>> drm_load_edid_firmware(struct drm_connector *connector) >>> { >> >> -- >> Jani Nikula, Intel Open Source Graphics Center > -- Jani Nikula, Intel Open Source Graphics Center ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-08-08 17:19 ` Jani Nikula @ 2022-09-12 16:25 ` Matthieu CHARETTE 2022-10-06 22:23 ` Jani Nikula 0 siblings, 1 reply; 18+ messages in thread From: Matthieu CHARETTE @ 2022-09-12 16:25 UTC (permalink / raw) To: Jani Nikula Cc: kbuild-all, lkp, airlied, linux-kernel, dri-devel, tzimmermann, andrealmeid Hi, Sorry for late reply. How do you propose to go then? Can we still use a persistent platform device to load the firmware and cache it? But, in this case the system will still crash in case the user change drm.edid_firmware then, without replugging the device, he suspends and resumes the machine. Or you may have a better idea? Thanks, Matthieu On Mon, Aug 8 2022 at 08:19:01 PM +0300, Jani Nikula <jani.nikula@linux.intel.com> wrote: > On Mon, 08 Aug 2022, Matthieu CHARETTE <matthieu.charette@gmail.com> > wrote: >> Sorry, What do you mean? > > You cache with one name at connector init time, but the name specified > using drm.edid_firmware may be changed whenever, to cause the next > EDID > read to use a different EDID firmware. > > BR, > Jani. > > >> >> Matthieu >> >> On Tue, Aug 2 2022 at 05:29:12 PM +0300, Jani Nikula >> <jani.nikula@linux.intel.com> wrote: >>> On Wed, 27 Jul 2022, Matthieu CHARETTE <matthieu.charette@gmail.com >>> <mailto:matthieu.charette@gmail.com>> wrote: >>>> 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. >>> >>> AFAICT this breaks changing drm.edid_firmware runtime. >>> >>> BR, >>> Jani. >>> >>>> >>>> Link: <https://gitlab.freedesktop.org/drm/amd/-/issues/2061> >>>> Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com >>>> <mailto: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; >>>> + } >>>> + >>>> list_for_each_entry_safe(mode, t, &connector->probed_modes, >>>> head) >>>> drm_mode_remove(connector, mode); >>>> >>>> diff --git a/drivers/gpu/drm/drm_edid_load.c >>>> b/drivers/gpu/drm/drm_edid_load.c >>>> index 37d8ba3ddb46..5a82be9917ec 100644 >>>> --- a/drivers/gpu/drm/drm_edid_load.c >>>> +++ b/drivers/gpu/drm/drm_edid_load.c >>>> @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int >>>> data_size) >>>> return (edid[0x7e] + 1) * EDID_LENGTH; >>>> } >>>> >>>> +static struct platform_device *edid_pdev(const char >>>> *connector_name) >>>> +{ >>>> + struct platform_device *pdev = >>>> platform_device_register_simple(connector_name, -1, NULL, 0); >>>> + >>>> + if (IS_ERR(pdev)) { >>>> + DRM_ERROR("Failed to register EDID firmware platform device " >>>> + "for connector \"%s\"\n", connector_name); >>>> + return ERR_CAST(pdev); >>>> + } >>>> + >>>> + return pdev; >>>> +} >>>> + >>>> static void *edid_load(struct drm_connector *connector, const >>>> char >>>> *name, >>>> const char *connector_name) >>>> { >>>> @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector >>>> *connector, const char *name, >>>> fwdata = generic_edid[builtin]; >>>> fwsize = sizeof(generic_edid[builtin]); >>>> } else { >>>> - struct platform_device *pdev; >>>> + struct platform_device *pdev = connector->edid_load_pdev; >>>> int err; >>>> >>>> - pdev = platform_device_register_simple(connector_name, -1, >>>> NULL, >>>> 0); >>>> - if (IS_ERR(pdev)) { >>>> - DRM_ERROR("Failed to register EDID firmware platform device " >>>> - "for connector \"%s\"\n", connector_name); >>>> - return ERR_CAST(pdev); >>>> + if (WARN_ON(!pdev)) { >>>> + pdev = edid_pdev(connector_name); >>>> + if (IS_ERR(pdev)) >>>> + return ERR_CAST(pdev); >>>> + connector->edid_load_pdev = pdev; >>>> } >>>> >>>> err = request_firmware(&fw, name, &pdev->dev); >>>> - platform_device_unregister(pdev); >>>> if (err) { >>>> DRM_ERROR("Requesting EDID firmware \"%s\" failed >>>> (err=%d)\n", >>>> name, err); >>>> @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector >>>> *connector, const char *name, >>>> return edid; >>>> } >>>> >>>> -struct edid *drm_load_edid_firmware(struct drm_connector >>>> *connector) >>>> +static char *edid_name(const char *connector_name) >>>> { >>>> - const char *connector_name = connector->name; >>>> char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = >>>> NULL; >>>> - struct edid *edid; >>>> >>>> if (edid_firmware[0] == '\0') >>>> return ERR_PTR(-ENOENT); >>>> @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct >>>> drm_connector *connector) >>>> if (*last == '\n') >>>> *last = '\0'; >>>> >>>> - edid = edid_load(connector, edidname, connector_name); >>>> + edidname = kstrdup(edidname, GFP_KERNEL); >>>> + if (!edidname) { >>>> + kfree(fwstr); >>>> + return ERR_PTR(-ENOMEM); >>>> + } >>>> + >>>> kfree(fwstr); >>>> + return edidname; >>>> +} >>>> + >>>> +void drm_cache_edid_firmware(struct drm_connector *connector) >>>> +{ >>>> + const char *connector_name = connector->name; >>>> + const char *edidname = edid_name(connector_name); >>>> + struct platform_device *pdev; >>>> + int err; >>>> + >>>> + if (IS_ERR(edidname)) >>>> + return; >>>> + >>>> + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= >>>> 0) { >>>> + kfree(edidname); >>>> + return; >>>> + } >>>> + >>>> + pdev = edid_pdev(connector_name); >>>> + if (IS_ERR(pdev)) { >>>> + kfree(edidname); >>>> + return; >>>> + } >>>> + connector->edid_load_pdev = pdev; >>>> + >>>> + err = firmware_request_cache(&pdev->dev, edidname); >>>> + if (err) >>>> + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed >>>> (err=%d)\n", >>>> + edidname, err); >>>> + >>>> + kfree(edidname); >>>> +} >>>> + >>>> +struct edid *drm_load_edid_firmware(struct drm_connector >>>> *connector) >>>> +{ >>>> + const char *connector_name = connector->name; >>>> + const char *edidname = edid_name(connector_name); >>>> + struct edid *edid; >>>> + >>>> + if (IS_ERR(edidname)) >>>> + return ERR_CAST(edidname); >>>> + >>>> + edid = edid_load(connector, edidname, connector_name); >>>> + kfree(edidname); >>>> >>>> return edid; >>>> } >>>> diff --git a/include/drm/drm_connector.h >>>> b/include/drm/drm_connector.h >>>> index 3ac4bf87f257..47c84741517e 100644 >>>> --- a/include/drm/drm_connector.h >>>> +++ b/include/drm/drm_connector.h >>>> @@ -1573,6 +1573,18 @@ struct drm_connector { >>>> */ >>>> struct i2c_adapter *ddc; >>>> >>>> + /** >>>> + * @edid_load_pdev: Platform device for loading EDID via >>>> firmware. >>>> + * >>>> + * The platform device is registered in drm_connector_init() in >>>> case a >>>> + * custom EDID firmware is used with `edid_firmware` parameter. >>>> Otherwise, >>>> + * it is set to NULL. >>>> + * >>>> + * Platform device is unregistered in drm_connector_cleanup() >>>> if >>>> it >>>> + * is not NULL. >>>> + */ >>>> + struct platform_device *edid_load_pdev; >>>> + >>>> /** >>>> * @null_edid_counter: track sinks that give us all zeros for >>>> the >>>> EDID. >>>> * Needed to workaround some HW bugs where we get all 0s >>>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h >>>> index b2756753370b..e907c928a35d 100644 >>>> --- a/include/drm/drm_edid.h >>>> +++ b/include/drm/drm_edid.h >>>> @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector >>>> *connector, >>>> const struct drm_display_mode *mode); >>>> >>>> #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE >>>> +void drm_cache_edid_firmware(struct drm_connector *connector); >>>> struct edid *drm_load_edid_firmware(struct drm_connector >>>> *connector); >>>> int __drm_set_edid_firmware_path(const char *path); >>>> int __drm_get_edid_firmware_path(char *buf, size_t bufsize); >>>> #else >>>> +inline void >>>> +drm_cache_edid_firmware(struct drm_connector *connector); >>>> static inline struct edid * >>>> drm_load_edid_firmware(struct drm_connector *connector) >>>> { >>> >>> -- >>> Jani Nikula, Intel Open Source Graphics Center >> > > -- > Jani Nikula, Intel Open Source Graphics Center ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-09-12 16:25 ` Matthieu CHARETTE @ 2022-10-06 22:23 ` Jani Nikula 0 siblings, 0 replies; 18+ messages in thread From: Jani Nikula @ 2022-10-06 22:23 UTC (permalink / raw) To: Matthieu CHARETTE Cc: kbuild-all, lkp, airlied, linux-kernel, dri-devel, tzimmermann, andrealmeid On Mon, 12 Sep 2022, Matthieu CHARETTE <matthieu.charette@gmail.com> wrote: > Hi, > > Sorry for late reply. > > How do you propose to go then? > Can we still use a persistent platform device to load the firmware and > cache it? But, in this case the system will still crash in case the > user change drm.edid_firmware then, without replugging the device, he > suspends and resumes the machine. > Or you may have a better idea? Maybe. Please try [1]. Could it be as simple as that? BR, Jani. [1] https://patchwork.freedesktop.org/patch/msgid/20221006222146.2375217-1-jani.nikula@intel.com > > Thanks, > Matthieu > > On Mon, Aug 8 2022 at 08:19:01 PM +0300, Jani Nikula > <jani.nikula@linux.intel.com> wrote: >> On Mon, 08 Aug 2022, Matthieu CHARETTE <matthieu.charette@gmail.com> >> wrote: >>> Sorry, What do you mean? >> >> You cache with one name at connector init time, but the name specified >> using drm.edid_firmware may be changed whenever, to cause the next >> EDID >> read to use a different EDID firmware. >> >> BR, >> Jani. >> >> >>> >>> Matthieu >>> >>> On Tue, Aug 2 2022 at 05:29:12 PM +0300, Jani Nikula >>> <jani.nikula@linux.intel.com> wrote: >>>> On Wed, 27 Jul 2022, Matthieu CHARETTE <matthieu.charette@gmail.com >>>> <mailto:matthieu.charette@gmail.com>> wrote: >>>>> 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. >>>> >>>> AFAICT this breaks changing drm.edid_firmware runtime. >>>> >>>> BR, >>>> Jani. >>>> >>>>> >>>>> Link: <https://gitlab.freedesktop.org/drm/amd/-/issues/2061> >>>>> Signed-off-by: Matthieu CHARETTE <matthieu.charette@gmail.com >>>>> <mailto: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; >>>>> + } >>>>> + >>>>> list_for_each_entry_safe(mode, t, &connector->probed_modes, >>>>> head) >>>>> drm_mode_remove(connector, mode); >>>>> >>>>> diff --git a/drivers/gpu/drm/drm_edid_load.c >>>>> b/drivers/gpu/drm/drm_edid_load.c >>>>> index 37d8ba3ddb46..5a82be9917ec 100644 >>>>> --- a/drivers/gpu/drm/drm_edid_load.c >>>>> +++ b/drivers/gpu/drm/drm_edid_load.c >>>>> @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int >>>>> data_size) >>>>> return (edid[0x7e] + 1) * EDID_LENGTH; >>>>> } >>>>> >>>>> +static struct platform_device *edid_pdev(const char >>>>> *connector_name) >>>>> +{ >>>>> + struct platform_device *pdev = >>>>> platform_device_register_simple(connector_name, -1, NULL, 0); >>>>> + >>>>> + if (IS_ERR(pdev)) { >>>>> + DRM_ERROR("Failed to register EDID firmware platform device " >>>>> + "for connector \"%s\"\n", connector_name); >>>>> + return ERR_CAST(pdev); >>>>> + } >>>>> + >>>>> + return pdev; >>>>> +} >>>>> + >>>>> static void *edid_load(struct drm_connector *connector, const >>>>> char >>>>> *name, >>>>> const char *connector_name) >>>>> { >>>>> @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector >>>>> *connector, const char *name, >>>>> fwdata = generic_edid[builtin]; >>>>> fwsize = sizeof(generic_edid[builtin]); >>>>> } else { >>>>> - struct platform_device *pdev; >>>>> + struct platform_device *pdev = connector->edid_load_pdev; >>>>> int err; >>>>> >>>>> - pdev = platform_device_register_simple(connector_name, -1, >>>>> NULL, >>>>> 0); >>>>> - if (IS_ERR(pdev)) { >>>>> - DRM_ERROR("Failed to register EDID firmware platform device " >>>>> - "for connector \"%s\"\n", connector_name); >>>>> - return ERR_CAST(pdev); >>>>> + if (WARN_ON(!pdev)) { >>>>> + pdev = edid_pdev(connector_name); >>>>> + if (IS_ERR(pdev)) >>>>> + return ERR_CAST(pdev); >>>>> + connector->edid_load_pdev = pdev; >>>>> } >>>>> >>>>> err = request_firmware(&fw, name, &pdev->dev); >>>>> - platform_device_unregister(pdev); >>>>> if (err) { >>>>> DRM_ERROR("Requesting EDID firmware \"%s\" failed >>>>> (err=%d)\n", >>>>> name, err); >>>>> @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector >>>>> *connector, const char *name, >>>>> return edid; >>>>> } >>>>> >>>>> -struct edid *drm_load_edid_firmware(struct drm_connector >>>>> *connector) >>>>> +static char *edid_name(const char *connector_name) >>>>> { >>>>> - const char *connector_name = connector->name; >>>>> char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = >>>>> NULL; >>>>> - struct edid *edid; >>>>> >>>>> if (edid_firmware[0] == '\0') >>>>> return ERR_PTR(-ENOENT); >>>>> @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct >>>>> drm_connector *connector) >>>>> if (*last == '\n') >>>>> *last = '\0'; >>>>> >>>>> - edid = edid_load(connector, edidname, connector_name); >>>>> + edidname = kstrdup(edidname, GFP_KERNEL); >>>>> + if (!edidname) { >>>>> + kfree(fwstr); >>>>> + return ERR_PTR(-ENOMEM); >>>>> + } >>>>> + >>>>> kfree(fwstr); >>>>> + return edidname; >>>>> +} >>>>> + >>>>> +void drm_cache_edid_firmware(struct drm_connector *connector) >>>>> +{ >>>>> + const char *connector_name = connector->name; >>>>> + const char *edidname = edid_name(connector_name); >>>>> + struct platform_device *pdev; >>>>> + int err; >>>>> + >>>>> + if (IS_ERR(edidname)) >>>>> + return; >>>>> + >>>>> + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= >>>>> 0) { >>>>> + kfree(edidname); >>>>> + return; >>>>> + } >>>>> + >>>>> + pdev = edid_pdev(connector_name); >>>>> + if (IS_ERR(pdev)) { >>>>> + kfree(edidname); >>>>> + return; >>>>> + } >>>>> + connector->edid_load_pdev = pdev; >>>>> + >>>>> + err = firmware_request_cache(&pdev->dev, edidname); >>>>> + if (err) >>>>> + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed >>>>> (err=%d)\n", >>>>> + edidname, err); >>>>> + >>>>> + kfree(edidname); >>>>> +} >>>>> + >>>>> +struct edid *drm_load_edid_firmware(struct drm_connector >>>>> *connector) >>>>> +{ >>>>> + const char *connector_name = connector->name; >>>>> + const char *edidname = edid_name(connector_name); >>>>> + struct edid *edid; >>>>> + >>>>> + if (IS_ERR(edidname)) >>>>> + return ERR_CAST(edidname); >>>>> + >>>>> + edid = edid_load(connector, edidname, connector_name); >>>>> + kfree(edidname); >>>>> >>>>> return edid; >>>>> } >>>>> diff --git a/include/drm/drm_connector.h >>>>> b/include/drm/drm_connector.h >>>>> index 3ac4bf87f257..47c84741517e 100644 >>>>> --- a/include/drm/drm_connector.h >>>>> +++ b/include/drm/drm_connector.h >>>>> @@ -1573,6 +1573,18 @@ struct drm_connector { >>>>> */ >>>>> struct i2c_adapter *ddc; >>>>> >>>>> + /** >>>>> + * @edid_load_pdev: Platform device for loading EDID via >>>>> firmware. >>>>> + * >>>>> + * The platform device is registered in drm_connector_init() in >>>>> case a >>>>> + * custom EDID firmware is used with `edid_firmware` parameter. >>>>> Otherwise, >>>>> + * it is set to NULL. >>>>> + * >>>>> + * Platform device is unregistered in drm_connector_cleanup() >>>>> if >>>>> it >>>>> + * is not NULL. >>>>> + */ >>>>> + struct platform_device *edid_load_pdev; >>>>> + >>>>> /** >>>>> * @null_edid_counter: track sinks that give us all zeros for >>>>> the >>>>> EDID. >>>>> * Needed to workaround some HW bugs where we get all 0s >>>>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h >>>>> index b2756753370b..e907c928a35d 100644 >>>>> --- a/include/drm/drm_edid.h >>>>> +++ b/include/drm/drm_edid.h >>>>> @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector >>>>> *connector, >>>>> const struct drm_display_mode *mode); >>>>> >>>>> #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE >>>>> +void drm_cache_edid_firmware(struct drm_connector *connector); >>>>> struct edid *drm_load_edid_firmware(struct drm_connector >>>>> *connector); >>>>> int __drm_set_edid_firmware_path(const char *path); >>>>> int __drm_get_edid_firmware_path(char *buf, size_t bufsize); >>>>> #else >>>>> +inline void >>>>> +drm_cache_edid_firmware(struct drm_connector *connector); >>>>> static inline struct edid * >>>>> drm_load_edid_firmware(struct drm_connector *connector) >>>>> { >>>> >>>> -- >>>> Jani Nikula, Intel Open Source Graphics Center >>> >> >> -- >> Jani Nikula, Intel Open Source Graphics Center > > -- Jani Nikula, Intel Open Source Graphics Center ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm: Fix EDID firmware load on resume 2022-08-02 14:29 ` Jani Nikula 2022-08-08 15:15 ` Matthieu CHARETTE @ 2022-08-08 15:17 ` Matthieu CHARETTE 1 sibling, 0 replies; 18+ messages in thread From: Matthieu CHARETTE @ 2022-08-08 15:17 UTC (permalink / raw) To: Jani Nikula Cc: kbuild-all, lkp, airlied, linux-kernel, dri-devel, tzimmermann, andrealmeid Sorry, What do you mean? Matthieu On Tue, Aug 2 2022 at 05:29:12 PM +0300, Jani Nikula <jani.nikula@linux.intel.com> wrote: > On Wed, 27 Jul 2022, Matthieu CHARETTE <matthieu.charette@gmail.com> > wrote: >> 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. > > AFAICT this breaks changing drm.edid_firmware runtime. > > BR, > Jani. > >> >> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2061 >> 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; >> + } >> + >> list_for_each_entry_safe(mode, t, &connector->probed_modes, head) >> drm_mode_remove(connector, mode); >> >> diff --git a/drivers/gpu/drm/drm_edid_load.c >> b/drivers/gpu/drm/drm_edid_load.c >> index 37d8ba3ddb46..5a82be9917ec 100644 >> --- a/drivers/gpu/drm/drm_edid_load.c >> +++ b/drivers/gpu/drm/drm_edid_load.c >> @@ -167,6 +167,19 @@ static int edid_size(const u8 *edid, int >> data_size) >> return (edid[0x7e] + 1) * EDID_LENGTH; >> } >> >> +static struct platform_device *edid_pdev(const char >> *connector_name) >> +{ >> + struct platform_device *pdev = >> platform_device_register_simple(connector_name, -1, NULL, 0); >> + >> + if (IS_ERR(pdev)) { >> + DRM_ERROR("Failed to register EDID firmware platform device " >> + "for connector \"%s\"\n", connector_name); >> + return ERR_CAST(pdev); >> + } >> + >> + return pdev; >> +} >> + >> static void *edid_load(struct drm_connector *connector, const char >> *name, >> const char *connector_name) >> { >> @@ -182,18 +195,17 @@ static void *edid_load(struct drm_connector >> *connector, const char *name, >> fwdata = generic_edid[builtin]; >> fwsize = sizeof(generic_edid[builtin]); >> } else { >> - struct platform_device *pdev; >> + struct platform_device *pdev = connector->edid_load_pdev; >> int err; >> >> - pdev = platform_device_register_simple(connector_name, -1, NULL, >> 0); >> - if (IS_ERR(pdev)) { >> - DRM_ERROR("Failed to register EDID firmware platform device " >> - "for connector \"%s\"\n", connector_name); >> - return ERR_CAST(pdev); >> + if (WARN_ON(!pdev)) { >> + pdev = edid_pdev(connector_name); >> + if (IS_ERR(pdev)) >> + return ERR_CAST(pdev); >> + connector->edid_load_pdev = pdev; >> } >> >> err = request_firmware(&fw, name, &pdev->dev); >> - platform_device_unregister(pdev); >> if (err) { >> DRM_ERROR("Requesting EDID firmware \"%s\" failed (err=%d)\n", >> name, err); >> @@ -263,11 +275,9 @@ static void *edid_load(struct drm_connector >> *connector, const char *name, >> return edid; >> } >> >> -struct edid *drm_load_edid_firmware(struct drm_connector >> *connector) >> +static char *edid_name(const char *connector_name) >> { >> - const char *connector_name = connector->name; >> char *edidname, *last, *colon, *fwstr, *edidstr, *fallback = NULL; >> - struct edid *edid; >> >> if (edid_firmware[0] == '\0') >> return ERR_PTR(-ENOENT); >> @@ -310,8 +320,57 @@ struct edid *drm_load_edid_firmware(struct >> drm_connector *connector) >> if (*last == '\n') >> *last = '\0'; >> >> - edid = edid_load(connector, edidname, connector_name); >> + edidname = kstrdup(edidname, GFP_KERNEL); >> + if (!edidname) { >> + kfree(fwstr); >> + return ERR_PTR(-ENOMEM); >> + } >> + >> kfree(fwstr); >> + return edidname; >> +} >> + >> +void drm_cache_edid_firmware(struct drm_connector *connector) >> +{ >> + const char *connector_name = connector->name; >> + const char *edidname = edid_name(connector_name); >> + struct platform_device *pdev; >> + int err; >> + >> + if (IS_ERR(edidname)) >> + return; >> + >> + if (match_string(generic_edid_name, GENERIC_EDIDS, edidname) >= >> 0) { >> + kfree(edidname); >> + return; >> + } >> + >> + pdev = edid_pdev(connector_name); >> + if (IS_ERR(pdev)) { >> + kfree(edidname); >> + return; >> + } >> + connector->edid_load_pdev = pdev; >> + >> + err = firmware_request_cache(&pdev->dev, edidname); >> + if (err) >> + DRM_ERROR("Requesting EDID firmware cache \"%s\" failed >> (err=%d)\n", >> + edidname, err); >> + >> + kfree(edidname); >> +} >> + >> +struct edid *drm_load_edid_firmware(struct drm_connector >> *connector) >> +{ >> + const char *connector_name = connector->name; >> + const char *edidname = edid_name(connector_name); >> + struct edid *edid; >> + >> + if (IS_ERR(edidname)) >> + return ERR_CAST(edidname); >> + >> + edid = edid_load(connector, edidname, connector_name); >> + kfree(edidname); >> >> return edid; >> } >> diff --git a/include/drm/drm_connector.h >> b/include/drm/drm_connector.h >> index 3ac4bf87f257..47c84741517e 100644 >> --- a/include/drm/drm_connector.h >> +++ b/include/drm/drm_connector.h >> @@ -1573,6 +1573,18 @@ struct drm_connector { >> */ >> struct i2c_adapter *ddc; >> >> + /** >> + * @edid_load_pdev: Platform device for loading EDID via firmware. >> + * >> + * The platform device is registered in drm_connector_init() in >> case a >> + * custom EDID firmware is used with `edid_firmware` parameter. >> Otherwise, >> + * it is set to NULL. >> + * >> + * Platform device is unregistered in drm_connector_cleanup() if >> it >> + * is not NULL. >> + */ >> + struct platform_device *edid_load_pdev; >> + >> /** >> * @null_edid_counter: track sinks that give us all zeros for the >> EDID. >> * Needed to workaround some HW bugs where we get all 0s >> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h >> index b2756753370b..e907c928a35d 100644 >> --- a/include/drm/drm_edid.h >> +++ b/include/drm/drm_edid.h >> @@ -378,10 +378,13 @@ int drm_av_sync_delay(struct drm_connector >> *connector, >> const struct drm_display_mode *mode); >> >> #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE >> +void drm_cache_edid_firmware(struct drm_connector *connector); >> struct edid *drm_load_edid_firmware(struct drm_connector >> *connector); >> int __drm_set_edid_firmware_path(const char *path); >> int __drm_get_edid_firmware_path(char *buf, size_t bufsize); >> #else >> +inline void >> +drm_cache_edid_firmware(struct drm_connector *connector); >> static inline struct edid * >> drm_load_edid_firmware(struct drm_connector *connector) >> { > > -- > Jani Nikula, Intel Open Source Graphics Center ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2022-10-06 22:23 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 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
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).