* [PATCH] drm/dp: Do not prune the last mode on the connector
@ 2017-09-28 0:00 Manasi Navare
2017-09-28 0:31 ` Keith Packard
2017-09-28 1:04 ` [PATCH v2] " Manasi Navare
0 siblings, 2 replies; 4+ messages in thread
From: Manasi Navare @ 2017-09-28 0:00 UTC (permalink / raw)
To: intel-gfx; +Cc: Keith Packard, Daniel Vetter, Manasi Navare, dri-devel
Currently the drm_mode_prune_invalid() function will
prune all the modes if it finds that the mode-status
is not MODE_OK. But if it ends up pruning all modes
then there are no modes left for that connector which will
eventually result into a black screen as userspace sees no
modes from the kernel. This can happen pretty quickly in case of
eDP panel that has only mode that might get pruned.
This patch fixes this problem by checking if the mode being pruned
is the last mode on that connector and if so doesnt prune it.
Cc: dri-devel@lists.freedesktop.org
Cc: Keith Packard <keithp@keithp.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
drivers/gpu/drm/drm_modes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 4a3f68a..a9369eb 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1185,7 +1185,8 @@ void drm_mode_prune_invalid(struct drm_device *dev,
struct drm_display_mode *mode, *t;
list_for_each_entry_safe(mode, t, mode_list, head) {
- if (mode->status != MODE_OK) {
+ if (mode->status != MODE_OK &&
+ !(list_is_last(&mode->head, mode_list))) {
list_del(&mode->head);
if (verbose) {
drm_mode_debug_printmodeline(mode);
--
2.1.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm/dp: Do not prune the last mode on the connector
2017-09-28 0:00 [PATCH] drm/dp: Do not prune the last mode on the connector Manasi Navare
@ 2017-09-28 0:31 ` Keith Packard
2017-09-28 0:48 ` Manasi Navare
2017-09-28 1:04 ` [PATCH v2] " Manasi Navare
1 sibling, 1 reply; 4+ messages in thread
From: Keith Packard @ 2017-09-28 0:31 UTC (permalink / raw)
To: intel-gfx; +Cc: Manasi Navare, dri-devel, Daniel Vetter
[-- Attachment #1.1: Type: text/plain, Size: 474 bytes --]
Manasi Navare <manasi.d.navare@intel.com> writes:
> This patch fixes this problem by checking if the mode being pruned
> is the last mode on that connector and if so doesnt prune it.
I think you want to stop pruning when you've gotten to a single mode on
the list, not at the last mode in the list (which may well need to be
pruned).
This is entirely untested, but perhaps
+ !(list_is_singular(mode_list))) {
is what you want?
--
-keith
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/dp: Do not prune the last mode on the connector
2017-09-28 0:31 ` Keith Packard
@ 2017-09-28 0:48 ` Manasi Navare
0 siblings, 0 replies; 4+ messages in thread
From: Manasi Navare @ 2017-09-28 0:48 UTC (permalink / raw)
To: Keith Packard; +Cc: intel-gfx, dri-devel, Daniel Vetter
On Wed, Sep 27, 2017 at 05:31:56PM -0700, Keith Packard wrote:
> Manasi Navare <manasi.d.navare@intel.com> writes:
>
> > This patch fixes this problem by checking if the mode being pruned
> > is the last mode on that connector and if so doesnt prune it.
>
> I think you want to stop pruning when you've gotten to a single mode on
> the list, not at the last mode in the list (which may well need to be
> pruned).
>
> This is entirely untested, but perhaps
>
> + !(list_is_singular(mode_list))) {
>
> is what you want?
>
Thanks Keith. Yes thats correct, I got confused by the macro name.
But its correct I should use the list_is_singular instead.
Manasi
> --
> -keith
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] drm/dp: Do not prune the last mode on the connector
2017-09-28 0:00 [PATCH] drm/dp: Do not prune the last mode on the connector Manasi Navare
2017-09-28 0:31 ` Keith Packard
@ 2017-09-28 1:04 ` Manasi Navare
1 sibling, 0 replies; 4+ messages in thread
From: Manasi Navare @ 2017-09-28 1:04 UTC (permalink / raw)
To: intel-gfx; +Cc: Keith Packard, Daniel Vetter, dri-devel
Currently the drm_mode_prune_invalid() function will
prune all the modes if it finds that the mode-status
is not MODE_OK. But if it ends up pruning all modes
then there are no modes left for that connector which will
eventually result into a black screen as userspace sees no
modes from the kernel. This can happen pretty quickly in case of
eDP panel that has only mode that might get pruned.
This patch fixes this problem by checking if the mode being pruned
is the last mode(only mode) on that connector and if so doesnt prune it.
v2:
* Use correct macro from list.h (Keith Packard)
Cc: dri-devel@lists.freedesktop.org
Cc: Keith Packard <keithp@keithp.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
drivers/gpu/drm/drm_modes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 4a3f68a..9dc38a4 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1185,7 +1185,8 @@ void drm_mode_prune_invalid(struct drm_device *dev,
struct drm_display_mode *mode, *t;
list_for_each_entry_safe(mode, t, mode_list, head) {
- if (mode->status != MODE_OK) {
+ if (mode->status != MODE_OK &&
+ !list_is_singular(mode_list)) {
list_del(&mode->head);
if (verbose) {
drm_mode_debug_printmodeline(mode);
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-28 1:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-28 0:00 [PATCH] drm/dp: Do not prune the last mode on the connector Manasi Navare
2017-09-28 0:31 ` Keith Packard
2017-09-28 0:48 ` Manasi Navare
2017-09-28 1:04 ` [PATCH v2] " Manasi Navare
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).