[i-g-t,4/5] lib/kms: warn if we commit without outputs

Submitted by Daniel Vetter on Nov. 22, 2018, 9:36 a.m.

Details

Message ID 20181122093700.31211-4-daniel.vetter@ffwll.ch
State New
Series "Series without cover letter"
Headers show

Commit Message

Daniel Vetter Nov. 22, 2018, 9:36 a.m.
With the high-level helpers requiring outputs there's not point
in silently ignoring issues anymore. Complain about that if it
ever happens.

This reverts

commit 212b71372bfbb73663d872df31118d6b396ada4f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 14 21:03:38 2018 +0100

    lib/kms: Skip no-op display updates

which created an in my opinion serious API issue by silently dropping
possible errors on the floor. Instead of silently second guess what
the test might have wanted to do in the absence of display outputs
it's much better to be explicit, and enforce that.

v2: Improve commit message.

v3: Switch to an assert and update comments, to make it clear this is
igt_display api abuse (Arek).

Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> (v2)
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/igt_kms.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7214101e2696..73cea75d19f0 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3292,8 +3292,8 @@  static int do_display_commit(igt_display_t *display,
 	enum pipe pipe;
 	LOG_INDENT(display, "commit");
 
-	if (!display->n_pipes || !display->n_outputs)
-		return 0; /* nothing to do */
+	/* someone managed to bypass igt_display_require, catch them */
+	assert(display->n_pipes && display->n_outputs);
 
 	igt_display_refresh(display);
 
@@ -3345,8 +3345,8 @@  int igt_display_try_commit_atomic(igt_display_t *display, uint32_t flags, void *
 {
 	int ret;
 
-	if (!display->n_pipes || !display->n_outputs)
-		return 0; /* nothing to do */
+	/* someone managed to bypass igt_display_require, catch them */
+	assert(display->n_pipes && display->n_outputs);
 
 	LOG_INDENT(display, "commit");
 

Comments

Arkadiusz Hiler Nov. 26, 2018, 12:33 p.m.
On Thu, Nov 22, 2018 at 10:36:59AM +0100, Daniel Vetter wrote:
> With the high-level helpers requiring outputs there's not point
> in silently ignoring issues anymore. Complain about that if it
> ever happens.
> 
> This reverts
> 
> commit 212b71372bfbb73663d872df31118d6b396ada4f
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Fri Sep 14 21:03:38 2018 +0100
> 
>     lib/kms: Skip no-op display updates
> 
> which created an in my opinion serious API issue by silently dropping
> possible errors on the floor. Instead of silently second guess what
> the test might have wanted to do in the absence of display outputs
> it's much better to be explicit, and enforce that.
> 
> v2: Improve commit message.
> 
> v3: Switch to an assert and update comments, to make it clear this is
> igt_display api abuse (Arek).
> 
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> (v2)
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>