drm/i915/tv: Fix return value for intel_tv_compute_config()
Subsystems (2)
PATCH 1/2 drm/i915/tv: Fix return value for intel_tv_compute_config()
From: Ville Syrjälä <[email protected]>
Ever since commit 204474a6b859 ("drm/i915: Pass down rc in intel_encoder->compute_config()") we're supposed to return an errno from .compute_config(). I failed to notice that when pushing the TV encoder fixes which were written before said commmit. Fix up the return value for the error case.
--- drivers/gpu/drm/i915/intel_tv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_tv.c +1 -1
@@ -1189,7 +1189,7 @@ intel_tv_compute_config(struct intel_encoder *encoder,if (extra <0 ) {DRM_DEBUG_KMS ("No vertical scaling for >1024 pixel wide modes\n" ); -return false; +return -EINVAL ; }/* Need to turn off the vertical filter and center the image */
Signature · 6 lines
2.19.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915/tv: Use the scanline counter for timestamps on i965gm TV output
From: Ville Syrjälä <[email protected]>
Just like the frame counter, the pixel counter also reads zero all the time when the TV encoder is used. Fortunately the scanline counter still works sufficiently well so let's use that to correct the vblank timestamps. Otherwise the timestamps may en up out of whack, and since we use them to guesstimate the vblank counter value that may end up incorrect as well.
--- drivers/gpu/drm/i915/i915_irq.c | 7 +++++-- drivers/gpu/drm/i915/intel_drv.h | 4 +++- drivers/gpu/drm/i915/intel_tv.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +5 -2
@@ -1014,6 +1014,9 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,int position;int vbl_start, vbl_end, hsync_start, htotal, vtotal;unsigned long irqflags; +bool use_scanline_counter =INTEL_GEN (dev_priv) >=5 || +IS_G4X (dev_priv) ||IS_GEN (dev_priv,2 ) || + mode->private_flags &I915_MODE_FLAG_USE_SCANLINE_COUNTER ;if (WARN_ON (!mode->crtc_clock)) { DRM_DEBUG_DRIVER("trying to get scanoutpos for disabled "
@@ -1046,7 +1049,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,if (stime) *stime =ktime_get (); -if (IS_GEN (dev_priv,2 ) ||IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) { +if (use_scanline_counter) {/* No obvious pixelcount register. Only query vertical * scanout position from Display scan line register. */
@@ -1106,7 +1109,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,else position += vtotal - vbl_end; -if (IS_GEN (dev_priv,2 ) ||IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) { +if (use_scanline_counter) { *vpos = position; *hpos =0 ; }else {
drivers/gpu/drm/i915/intel_drv.h +3 -1
@@ -630,9 +630,11 @@ struct intel_crtc_scaler_state { };/* drm_mode->private_flags */ -#define I915_MODE_FLAG_INHERITED 1 +#define I915_MODE_FLAG_INHERITED (1<<0)/* Flag to get scanline using frame time stamps */ #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1) +/* Flag to use the scanline counter instead of the pixel counter */ +#define I915_MODE_FLAG_USE_SCANLINE_COUNTER (1<<2)struct intel_pipe_wm {struct intel_wm_level wm[5 ];
drivers/gpu/drm/i915/intel_tv.c +10 -0
@@ -1150,6 +1150,11 @@ intel_tv_get_config(struct intel_encoder *encoder, ypos, mode.vdisplay - ysize - ypos); adjusted_mode->crtc_clock = mode.clock; + +/* pixel counter doesn't work on i965gm TV output */ +if (IS_I965GM (dev_priv)) + adjusted_mode->private_flags |= +I915_MODE_FLAG_USE_SCANLINE_COUNTER ; } static int
@@ -1295,6 +1300,11 @@ intel_tv_compute_config(struct intel_encoder *encoder,drm_mode_set_crtcinfo (adjusted_mode,0 ); adjusted_mode->name[0 ] ='\0' ; +/* pixel counter doesn't work on i965gm TV output */ +if (IS_I965GM (dev_priv)) + adjusted_mode->private_flags |= +I915_MODE_FLAG_USE_SCANLINE_COUNTER ; +return 0 ; }
Signature · 6 lines
2.19.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915/tv: Use the scanline counter for timestamps on i965gm TV output
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Just like the frame counter, the pixel counter also reads zero all the time when the TV encoder is used. Fortunately the scanline counter still works sufficiently well so let's use that to correct the vblank timestamps. Otherwise the timestamps may en up out of whack, and since we use them to guesstimate the vblank counter value that may end up incorrect as well.
Cc Imre Deak <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 86 lines
--- drivers/gpu/drm/i915/i915_irq.c | 7 +++++-- drivers/gpu/drm/i915/intel_drv.h | 4 +++- drivers/gpu/drm/i915/intel_tv.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_irq.c +5
-2@@ -1014,6 +1014,9 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,int position;int vbl_start, vbl_end, hsync_start, htotal, vtotal;unsigned long irqflags; +bool use_scanline_counter =INTEL_GEN (dev_priv) >=5 || +IS_G4X (dev_priv) ||IS_GEN (dev_priv,2 ) || + mode->private_flags &I915_MODE_FLAG_USE_SCANLINE_COUNTER ;if (WARN_ON (!mode->crtc_clock)) { DRM_DEBUG_DRIVER("trying to get scanoutpos for disabled "@@ -1046,7 +1049,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,if (stime) *stime =ktime_get (); -if (IS_GEN (dev_priv,2 ) ||IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) { +if (use_scanline_counter) {/* No obvious pixelcount register. Only query vertical * scanout position from Display scan line register. */ @@ -1106,7 +1109,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,else position += vtotal - vbl_end; -if (IS_GEN (dev_priv,2 ) ||IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) { +if (use_scanline_counter) { *vpos = position; *hpos =0 ; }else {drivers/gpu/drm/i915/intel_drv.h +3
-1@@ -630,9 +630,11 @@ struct intel_crtc_scaler_state { };/* drm_mode->private_flags */ -#define I915_MODE_FLAG_INHERITED 1 +#define I915_MODE_FLAG_INHERITED (1<<0)/* Flag to get scanline using frame time stamps */ #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1) +/* Flag to use the scanline counter instead of the pixel counter */ +#define I915_MODE_FLAG_USE_SCANLINE_COUNTER (1<<2)struct intel_pipe_wm {struct intel_wm_level wm[5 ];drivers/gpu/drm/i915/intel_tv.c +10
-0@@ -1150,6 +1150,11 @@ intel_tv_get_config(struct intel_encoder *encoder, ypos, mode.vdisplay - ysize - ypos); adjusted_mode->crtc_clock = mode.clock; + +/* pixel counter doesn't work on i965gm TV output */ +if (IS_I965GM (dev_priv)) + adjusted_mode->private_flags |= +I915_MODE_FLAG_USE_SCANLINE_COUNTER ; } static int@@ -1295,6 +1300,11 @@ intel_tv_compute_config(struct intel_encoder *encoder,drm_mode_set_crtcinfo (adjusted_mode,0 ); adjusted_mode->name[0 ] ='\0' ; +/* pixel counter doesn't work on i965gm TV output */ +if (IS_I965GM (dev_priv)) + adjusted_mode->private_flags |= +I915_MODE_FLAG_USE_SCANLINE_COUNTER ; +return 0 ; }Signature · 1 line
2.19.2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915/tv: Use the scanline counter for timestamps on i965gm TV output
Quoted 10 lines · Imre Deak
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Just like the frame counter, the pixel counter also reads zero all the time when the TV encoder is used. Fortunately the scanline counter still works sufficiently well so let's use that to correct the vblank timestamps. Otherwise the timestamps may en up out of whack, and since we use them to guesstimate the vblank counter value that may end up incorrect as well.
Quoted 4 lines
Quoted 2 lines
Cc Imre Deak <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Imre Deak <[email protected]>
Thanks. Series pushed to dinq.
Quoted 87 lines
Quoted 87 lines
--- drivers/gpu/drm/i915/i915_irq.c | 7 +++++-- drivers/gpu/drm/i915/intel_drv.h | 4 +++- drivers/gpu/drm/i915/intel_tv.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/i915_irq.c +5
-2@@ -1014,6 +1014,9 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,int position;int vbl_start, vbl_end, hsync_start, htotal, vtotal;unsigned long irqflags; +bool use_scanline_counter =INTEL_GEN (dev_priv) >=5 || +IS_G4X (dev_priv) ||IS_GEN (dev_priv,2 ) || + mode->private_flags &I915_MODE_FLAG_USE_SCANLINE_COUNTER ;if (WARN_ON (!mode->crtc_clock)) { DRM_DEBUG_DRIVER("trying to get scanoutpos for disabled "@@ -1046,7 +1049,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,if (stime) *stime =ktime_get (); -if (IS_GEN (dev_priv,2 ) ||IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) { +if (use_scanline_counter) {/* No obvious pixelcount register. Only query vertical * scanout position from Display scan line register. */ @@ -1106,7 +1109,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,else position += vtotal - vbl_end; -if (IS_GEN (dev_priv,2 ) ||IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) { +if (use_scanline_counter) { *vpos = position; *hpos =0 ; }else {drivers/gpu/drm/i915/intel_drv.h +3
-1@@ -630,9 +630,11 @@ struct intel_crtc_scaler_state { };/* drm_mode->private_flags */ -#define I915_MODE_FLAG_INHERITED 1 +#define I915_MODE_FLAG_INHERITED (1<<0)/* Flag to get scanline using frame time stamps */ #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1) +/* Flag to use the scanline counter instead of the pixel counter */ +#define I915_MODE_FLAG_USE_SCANLINE_COUNTER (1<<2)struct intel_pipe_wm {struct intel_wm_level wm[5 ];drivers/gpu/drm/i915/intel_tv.c +10
-0@@ -1150,6 +1150,11 @@ intel_tv_get_config(struct intel_encoder *encoder, ypos, mode.vdisplay - ysize - ypos); adjusted_mode->crtc_clock = mode.clock; + +/* pixel counter doesn't work on i965gm TV output */ +if (IS_I965GM (dev_priv)) + adjusted_mode->private_flags |= +I915_MODE_FLAG_USE_SCANLINE_COUNTER ; } static int@@ -1295,6 +1300,11 @@ intel_tv_compute_config(struct intel_encoder *encoder,drm_mode_set_crtcinfo (adjusted_mode,0 ); adjusted_mode->name[0 ] ='\0' ; +/* pixel counter doesn't work on i965gm TV output */ +if (IS_I965GM (dev_priv)) + adjusted_mode->private_flags |= +I915_MODE_FLAG_USE_SCANLINE_COUNTER ; +return 0 ; }Signature · 1 line
2.19.2
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/tv: Fix return value for intel_tv_compute_config()
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915/tv: Fix return value for intel_tv_compute_config()
URL : https://patchwork.freedesktop.org/series/55743/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
03b411930b07 drm/i915/tv: Fix return value for intel_tv_compute_config()
32e0a172c9d3 drm/i915/tv: Use the scanline counter for timestamps on i965gm TV output
-:61: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV)
#61: FILE: drivers/gpu/drm/i915/intel_drv.h:633:
+#define I915_MODE_FLAG_INHERITED (1<<0)
^-:65: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #65: FILE: drivers/gpu/drm/i915/intel_drv.h:637:
+#define I915_MODE_FLAG_USE_SCANLINE_COUNTER (1<<2)
^
total: 0 errors, 0 warnings, 2 checks, 59 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/tv: Fix return value for intel_tv_compute_config()
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915/tv: Fix return value for intel_tv_compute_config()
URL : https://patchwork.freedesktop.org/series/55743/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5486 -> Patchwork_12044
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/55743/revisions/1/mbox/
Known issues
------------
Here are the changes found in Patchwork_12044 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_busy@basic-flip-a:
- fi-gdg-551: PASS -> FAIL [fdo#103182]
* igt@kms_flip@basic-flip-vs-modeset:
- fi-skl-6700hq: PASS -> DMESG-WARN [fdo#105998] +1
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: NOTRUN -> FAIL [fdo#103191] / [fdo#107362]
* igt@kms_pipe_crc_basic@read-crc-pipe-b:
- fi-byt-clapper: NOTRUN -> FAIL [fdo#107362]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS
* igt@kms_flip@basic-flip-vs-wf_vblank:
- fi-bsw-n3050: FAIL [fdo#100368] -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#105998]: https://bugs.freedesktop.org/show_bug.cgi?id=105998
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
Participating hosts (43 -> 41)
------------------------------
Additional (2): fi-byt-clapper fi-pnv-d510
Missing (4): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan
Build changes
-------------
* Linux: CI_DRM_5486 -> Patchwork_12044
CI_DRM_5486: 186ccd79d43ff0c930c7211e24ba5afa78c6594e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4790: dcdf4b04e16312f8f52ad389388d834f9d74b8f0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12044: 32e0a172c9d3191d2530fd05a82cec82519e35ed @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
32e0a172c9d3 drm/i915/tv: Use the scanline counter for timestamps on i965gm TV output 03b411930b07 drm/i915/tv: Fix return value for intel_tv_compute_config()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12044/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Ever since commit
204474a6b859("drm/i915: Pass down rc inintel_encoder->compute_config()") we're supposed to return an errno from .compute_config(). I failed to notice that when pushing the TV encoder fixes which were written before said commmit. Fix up the return value for the error case.Cc Imre Deak <[email protected]>Fixes 690157f0a9e7 ("drm/i915/tv: Fix >1024 modes on gen3")Signed-off-by Ville Syrjälä <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/i915/intel_tv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_tv.c +1
-1@@ -1189,7 +1189,7 @@ intel_tv_compute_config(struct intel_encoder *encoder,if (extra <0 ) {DRM_DEBUG_KMS ("No vertical scaling for >1024 pixel wide modes\n" ); -return false; +return -EINVAL ; }/* Need to turn off the vertical filter and center the image */ Signature · 1 line
2.19.2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915/tv: Fix return value for intel_tv_compute_config()
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915/tv: Fix return value for intel_tv_compute_config()
URL : https://patchwork.freedesktop.org/series/55743/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5486_full -> Patchwork_12044_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_12044_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_isolation@bcs0-s3:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665]
* igt@kms_available_modes_crc@available_mode_test_crc:
- shard-apl: PASS -> FAIL [fdo#106641]
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
- shard-kbl: PASS -> DMESG-WARN [fdo#107956]
* igt@kms_cursor_crc@cursor-256x256-random:
- shard-glk: PASS -> FAIL [fdo#103232] +1
* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: PASS -> FAIL [fdo#103166] +2
* igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
- shard-glk: PASS -> FAIL [fdo#103166]
* igt@kms_setmode@basic:
- shard-hsw: PASS -> FAIL [fdo#99912]
- shard-kbl: PASS -> FAIL [fdo#99912]
* igt@perf_pmu@rc6-runtime-pm-long:
- shard-kbl: PASS -> FAIL [fdo#105010]
#### Possible fixes ####
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-hsw: DMESG-WARN [fdo#107956] -> PASS
* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: FAIL [fdo#103232] -> PASS +1
* igt@kms_flip@2x-flip-vs-modeset-interruptible:
- shard-hsw: DMESG-WARN [fdo#102614] -> PASS
* igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-apl: FAIL [fdo#103166] -> PASS +1
[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* Linux: CI_DRM_5486 -> Patchwork_12044
CI_DRM_5486: 186ccd79d43ff0c930c7211e24ba5afa78c6594e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4790: dcdf4b04e16312f8f52ad389388d834f9d74b8f0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12044: 32e0a172c9d3191d2530fd05a82cec82519e35ed @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12044/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx