Skip to content

Commit 68e94f6

Browse files
committed
drm/i915/tv: Bypass the vertical filter if possible
Let's switch the pipe into interlaced mode and switch off the TV encoder vertical filter if the pipe vdisplay matches the TV YSIZE exactly. While I didn't measure it I presume this might reduce the power consumption a little bit, and the pixel rate is halved as the pipe will now fetching in interlaced mode rather than in progressive mode (effectively the same difference as between IF-ID vs. PF-ID pfit modes on more modern hardware) so a bit easier on the memory bandwidth. Cc: Imre Deak <imre.deak@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190129141913.5515-2-ville.syrjala@linux.intel.com Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent addc80f commit 68e94f6

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

drivers/gpu/drm/i915/intel_tv.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,22 @@ intel_tv_get_config(struct intel_encoder *encoder,
11591159
I915_MODE_FLAG_USE_SCANLINE_COUNTER;
11601160
}
11611161

1162+
static bool intel_tv_source_too_wide(struct drm_i915_private *dev_priv,
1163+
int hdisplay)
1164+
{
1165+
return IS_GEN(dev_priv, 3) && hdisplay > 1024;
1166+
}
1167+
1168+
static bool intel_tv_vert_scaling(const struct drm_display_mode *tv_mode,
1169+
const struct drm_connector_state *conn_state,
1170+
int vdisplay)
1171+
{
1172+
return tv_mode->crtc_vdisplay -
1173+
conn_state->tv.margins.top -
1174+
conn_state->tv.margins.bottom !=
1175+
vdisplay;
1176+
}
1177+
11621178
static int
11631179
intel_tv_compute_config(struct intel_encoder *encoder,
11641180
struct intel_crtc_state *pipe_config,
@@ -1189,7 +1205,8 @@ intel_tv_compute_config(struct intel_encoder *encoder,
11891205
intel_tv_mode_to_mode(adjusted_mode, tv_mode);
11901206
drm_mode_set_crtcinfo(adjusted_mode, 0);
11911207

1192-
if (IS_GEN(dev_priv, 3) && hdisplay > 1024) {
1208+
if (intel_tv_source_too_wide(dev_priv, hdisplay) ||
1209+
!intel_tv_vert_scaling(adjusted_mode, conn_state, vdisplay)) {
11931210
int extra, top, bottom;
11941211

11951212
extra = adjusted_mode->crtc_vdisplay - vdisplay;

0 commit comments

Comments
 (0)