Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54da691d authored by Thomas Gummerer's avatar Thomas Gummerer Committed by Jani Nikula
Browse files

drm/i915: fix screen flickering



Commit c9f038a1 ("drm/i915: Don't assume primary & cursor are
always on for wm calculation (v4)") fixes a null pointer dereference.
Setting the primary and cursor panes to false in
ilk_compute_wm_parameters to false does however give the following
errors in the kernel log and causes the screen to flicker.

[  101.133716] [drm:intel_set_cpu_fifo_underrun_reporting [i915]]
*ERROR* uncleared fifo underrun on pipe A
[  101.133725] [drm:intel_cpu_fifo_underrun_irq_handler [i915]]
*ERROR* CPU pipe A FIFO underrun

Always setting the panes to enabled fixes this error.

Helped-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarThomas Gummerer <t.gummerer@gmail.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Tested-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent e2608180
Loading
Loading
Loading
Loading
+11 −13
Original line number Original line Diff line number Diff line
@@ -2045,22 +2045,20 @@ static void ilk_compute_wm_parameters(struct drm_crtc *crtc,
	p->pipe_htotal = intel_crtc->config->base.adjusted_mode.crtc_htotal;
	p->pipe_htotal = intel_crtc->config->base.adjusted_mode.crtc_htotal;
	p->pixel_rate = ilk_pipe_pixel_rate(dev, crtc);
	p->pixel_rate = ilk_pipe_pixel_rate(dev, crtc);


	if (crtc->primary->state->fb) {
	if (crtc->primary->state->fb)
		p->pri.enabled = true;
		p->pri.bytes_per_pixel =
		p->pri.bytes_per_pixel =
			crtc->primary->state->fb->bits_per_pixel / 8;
			crtc->primary->state->fb->bits_per_pixel / 8;
	} else {
	else
		p->pri.enabled = false;
		p->pri.bytes_per_pixel = 4;
		p->pri.bytes_per_pixel = 0;
	}


	if (crtc->cursor->state->fb) {
		p->cur.enabled = true;
	p->cur.bytes_per_pixel = 4;
	p->cur.bytes_per_pixel = 4;
	} else {
	/*
		p->cur.enabled = false;
	 * TODO: for now, assume primary and cursor planes are always enabled.
		p->cur.bytes_per_pixel = 0;
	 * Setting them to false makes the screen flicker.
	}
	 */
	p->pri.enabled = true;
	p->cur.enabled = true;

	p->pri.horiz_pixels = intel_crtc->config->pipe_src_w;
	p->pri.horiz_pixels = intel_crtc->config->pipe_src_w;
	p->cur.horiz_pixels = intel_crtc->base.cursor->state->crtc_w;
	p->cur.horiz_pixels = intel_crtc->base.cursor->state->crtc_w;