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

Commit e5a95eb7 authored by Zhao Yakui's avatar Zhao Yakui Committed by Eric Anholt
Browse files

drm/i915: Select the correct BPC for LVDS on Ironlake



Select the correct BPC for LVDS on Ironlake. If it is 18-bit LVDS panel,
the BPC will be 6. When it is 24-bit LVDS panel, the BPC will 8.
At the same time the BPC will be 8 when the output device is CRT/HDMI/DP.

Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent 8faf3b31
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -2993,6 +2993,18 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,


		/* determine panel color depth */
		/* determine panel color depth */
		temp = I915_READ(pipeconf_reg);
		temp = I915_READ(pipeconf_reg);
		temp &= ~PIPE_BPC_MASK;
		if (is_lvds) {
			int lvds_reg = I915_READ(PCH_LVDS);
			/* the BPC will be 6 if it is 18-bit LVDS panel */
			if ((lvds_reg & LVDS_A3_POWER_MASK) == LVDS_A3_POWER_UP)
				temp |= PIPE_8BPC;
			else
				temp |= PIPE_6BPC;
		} else
			temp |= PIPE_8BPC;
		I915_WRITE(pipeconf_reg, temp);
		I915_READ(pipeconf_reg);


		switch (temp & PIPE_BPC_MASK) {
		switch (temp & PIPE_BPC_MASK) {
		case PIPE_8BPC:
		case PIPE_8BPC: