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

Commit 6443170f authored by Eric Anholt's avatar Eric Anholt
Browse files

drm/i915: Remove dead KMS encoder save/restore code.

This was brought over from UMS, and used for a while until we decided
that drm_helper_resume_force_mode was easier and more reliable, since
it didn't require duplicating all the code deleted here.  We just
forgot to delete all that junk for a while.
parent 335af9a2
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -69,16 +69,6 @@ struct intel_dvo_dev_ops {
	 */
	void (*dpms)(struct intel_dvo_device *dvo, int mode);

	/*
	 * Saves the output's state for restoration on VT switch.
	 */
	void (*save)(struct intel_dvo_device *dvo);

	/*
	 * Restore's the output's state at VT switch.
	 */
	void (*restore)(struct intel_dvo_device *dvo);

	/*
	 * Callback for testing a video mode for a given output.
	 *
+1 −45
Original line number Diff line number Diff line
@@ -159,16 +159,7 @@
#define CH7017_BANG_LIMIT_CONTROL	0x7f

struct ch7017_priv {
	uint8_t save_hapi;
	uint8_t save_vali;
	uint8_t save_valo;
	uint8_t save_ailo;
	uint8_t save_lvds_pll_vco;
	uint8_t save_feedback_div;
	uint8_t save_lvds_control_2;
	uint8_t save_outputs_enable;
	uint8_t save_lvds_power_down;
	uint8_t save_power_management;
	uint8_t dummy;
};

static void ch7017_dump_regs(struct intel_dvo_device *dvo);
@@ -401,39 +392,6 @@ do { \
	DUMP(CH7017_LVDS_POWER_DOWN);
}

static void ch7017_save(struct intel_dvo_device *dvo)
{
	struct ch7017_priv *priv = dvo->dev_priv;

	ch7017_read(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT, &priv->save_hapi);
	ch7017_read(dvo, CH7017_VERTICAL_ACTIVE_LINE_OUTPUT, &priv->save_valo);
	ch7017_read(dvo, CH7017_ACTIVE_INPUT_LINE_OUTPUT, &priv->save_ailo);
	ch7017_read(dvo, CH7017_LVDS_PLL_VCO_CONTROL, &priv->save_lvds_pll_vco);
	ch7017_read(dvo, CH7017_LVDS_PLL_FEEDBACK_DIV, &priv->save_feedback_div);
	ch7017_read(dvo, CH7017_LVDS_CONTROL_2, &priv->save_lvds_control_2);
	ch7017_read(dvo, CH7017_OUTPUTS_ENABLE, &priv->save_outputs_enable);
	ch7017_read(dvo, CH7017_LVDS_POWER_DOWN, &priv->save_lvds_power_down);
	ch7017_read(dvo, CH7017_POWER_MANAGEMENT, &priv->save_power_management);
}

static void ch7017_restore(struct intel_dvo_device *dvo)
{
	struct ch7017_priv *priv = dvo->dev_priv;

	/* Power down before changing mode */
	ch7017_dpms(dvo, DRM_MODE_DPMS_OFF);

	ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT, priv->save_hapi);
	ch7017_write(dvo, CH7017_VERTICAL_ACTIVE_LINE_OUTPUT, priv->save_valo);
	ch7017_write(dvo, CH7017_ACTIVE_INPUT_LINE_OUTPUT, priv->save_ailo);
	ch7017_write(dvo, CH7017_LVDS_PLL_VCO_CONTROL, priv->save_lvds_pll_vco);
	ch7017_write(dvo, CH7017_LVDS_PLL_FEEDBACK_DIV, priv->save_feedback_div);
	ch7017_write(dvo, CH7017_LVDS_CONTROL_2, priv->save_lvds_control_2);
	ch7017_write(dvo, CH7017_OUTPUTS_ENABLE, priv->save_outputs_enable);
	ch7017_write(dvo, CH7017_LVDS_POWER_DOWN, priv->save_lvds_power_down);
	ch7017_write(dvo, CH7017_POWER_MANAGEMENT, priv->save_power_management);
}

static void ch7017_destroy(struct intel_dvo_device *dvo)
{
	struct ch7017_priv *priv = dvo->dev_priv;
@@ -451,7 +409,5 @@ struct intel_dvo_dev_ops ch7017_ops = {
	.mode_set = ch7017_mode_set,
	.dpms = ch7017_dpms,
	.dump_regs = ch7017_dump_regs,
	.save = ch7017_save,
	.restore = ch7017_restore,
	.destroy = ch7017_destroy,
};
+3 −41
Original line number Diff line number Diff line
@@ -92,21 +92,10 @@ static struct ch7xxx_id_struct {
	{ CH7301_VID, "CH7301" },
};

struct ch7xxx_reg_state {
    uint8_t regs[CH7xxx_NUM_REGS];
};

struct ch7xxx_priv {
	bool quiet;

	struct ch7xxx_reg_state save_reg;
	struct ch7xxx_reg_state mode_reg;
	uint8_t save_TCTL, save_TPCP, save_TPD, save_TPVT;
	uint8_t save_TLPF, save_TCT, save_PM, save_IDF;
};

static void ch7xxx_save(struct intel_dvo_device *dvo);

static char *ch7xxx_get_id(uint8_t vid)
{
	int i;
@@ -312,40 +301,15 @@ static void ch7xxx_dpms(struct intel_dvo_device *dvo, int mode)

static void ch7xxx_dump_regs(struct intel_dvo_device *dvo)
{
	struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
	int i;

	for (i = 0; i < CH7xxx_NUM_REGS; i++) {
		uint8_t val;
		if ((i % 8) == 0 )
			DRM_LOG_KMS("\n %02X: ", i);
		DRM_LOG_KMS("%02X ", ch7xxx->mode_reg.regs[i]);
	}
		ch7xxx_readb(dvo, i, &val);
		DRM_LOG_KMS("%02X ", val);
	}

static void ch7xxx_save(struct intel_dvo_device *dvo)
{
	struct ch7xxx_priv *ch7xxx= dvo->dev_priv;

	ch7xxx_readb(dvo, CH7xxx_TCTL, &ch7xxx->save_TCTL);
	ch7xxx_readb(dvo, CH7xxx_TPCP, &ch7xxx->save_TPCP);
	ch7xxx_readb(dvo, CH7xxx_TPD, &ch7xxx->save_TPD);
	ch7xxx_readb(dvo, CH7xxx_TPVT, &ch7xxx->save_TPVT);
	ch7xxx_readb(dvo, CH7xxx_TLPF, &ch7xxx->save_TLPF);
	ch7xxx_readb(dvo, CH7xxx_PM, &ch7xxx->save_PM);
	ch7xxx_readb(dvo, CH7xxx_IDF, &ch7xxx->save_IDF);
}

static void ch7xxx_restore(struct intel_dvo_device *dvo)
{
	struct ch7xxx_priv *ch7xxx = dvo->dev_priv;

	ch7xxx_writeb(dvo, CH7xxx_TCTL, ch7xxx->save_TCTL);
	ch7xxx_writeb(dvo, CH7xxx_TPCP, ch7xxx->save_TPCP);
	ch7xxx_writeb(dvo, CH7xxx_TPD, ch7xxx->save_TPD);
	ch7xxx_writeb(dvo, CH7xxx_TPVT, ch7xxx->save_TPVT);
	ch7xxx_writeb(dvo, CH7xxx_TLPF, ch7xxx->save_TLPF);
	ch7xxx_writeb(dvo, CH7xxx_IDF, ch7xxx->save_IDF);
	ch7xxx_writeb(dvo, CH7xxx_PM, ch7xxx->save_PM);
}

static void ch7xxx_destroy(struct intel_dvo_device *dvo)
@@ -365,7 +329,5 @@ struct intel_dvo_dev_ops ch7xxx_ops = {
	.mode_set = ch7xxx_mode_set,
	.dpms = ch7xxx_dpms,
	.dump_regs = ch7xxx_dump_regs,
	.save = ch7xxx_save,
	.restore = ch7xxx_restore,
	.destroy = ch7xxx_destroy,
};
+0 −21
Original line number Diff line number Diff line
@@ -153,9 +153,6 @@ struct ivch_priv {
	bool quiet;

	uint16_t width, height;

	uint16_t save_VR01;
	uint16_t save_VR40;
};


@@ -405,22 +402,6 @@ static void ivch_dump_regs(struct intel_dvo_device *dvo)
	DRM_LOG_KMS("VR8F: 0x%04x\n", val);
}

static void ivch_save(struct intel_dvo_device *dvo)
{
	struct ivch_priv *priv = dvo->dev_priv;

	ivch_read(dvo, VR01, &priv->save_VR01);
	ivch_read(dvo, VR40, &priv->save_VR40);
}

static void ivch_restore(struct intel_dvo_device *dvo)
{
	struct ivch_priv *priv = dvo->dev_priv;

	ivch_write(dvo, VR01, priv->save_VR01);
	ivch_write(dvo, VR40, priv->save_VR40);
}

static void ivch_destroy(struct intel_dvo_device *dvo)
{
	struct ivch_priv *priv = dvo->dev_priv;
@@ -434,8 +415,6 @@ static void ivch_destroy(struct intel_dvo_device *dvo)
struct intel_dvo_dev_ops ivch_ops= {
	.init = ivch_init,
	.dpms = ivch_dpms,
	.save = ivch_save,
	.restore = ivch_restore,
	.mode_valid = ivch_mode_valid,
	.mode_set = ivch_mode_set,
	.detect = ivch_detect,
+0 −38
Original line number Diff line number Diff line
@@ -58,17 +58,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#define SIL164_REGC 0x0c

struct sil164_save_rec {
	uint8_t reg8;
	uint8_t reg9;
	uint8_t regc;
};

struct sil164_priv {
	//I2CDevRec d;
	bool quiet;
	struct sil164_save_rec save_regs;
	struct sil164_save_rec mode_regs;
};

#define SILPTR(d) ((SIL164Ptr)(d->DriverPrivate.ptr))
@@ -252,34 +244,6 @@ static void sil164_dump_regs(struct intel_dvo_device *dvo)
	DRM_LOG_KMS("SIL164_REGC: 0x%02x\n", val);
}

static void sil164_save(struct intel_dvo_device *dvo)
{
	struct sil164_priv *sil= dvo->dev_priv;

	if (!sil164_readb(dvo, SIL164_REG8, &sil->save_regs.reg8))
		return;

	if (!sil164_readb(dvo, SIL164_REG9, &sil->save_regs.reg9))
		return;

	if (!sil164_readb(dvo, SIL164_REGC, &sil->save_regs.regc))
		return;

	return;
}

static void sil164_restore(struct intel_dvo_device *dvo)
{
	struct sil164_priv *sil = dvo->dev_priv;

	/* Restore it powered down initially */
	sil164_writeb(dvo, SIL164_REG8, sil->save_regs.reg8 & ~0x1);

	sil164_writeb(dvo, SIL164_REG9, sil->save_regs.reg9);
	sil164_writeb(dvo, SIL164_REGC, sil->save_regs.regc);
	sil164_writeb(dvo, SIL164_REG8, sil->save_regs.reg8);
}

static void sil164_destroy(struct intel_dvo_device *dvo)
{
	struct sil164_priv *sil = dvo->dev_priv;
@@ -297,7 +261,5 @@ struct intel_dvo_dev_ops sil164_ops = {
	.mode_set = sil164_mode_set,
	.dpms = sil164_dpms,
	.dump_regs = sil164_dump_regs,
	.save = sil164_save,
	.restore = sil164_restore,
	.destroy = sil164_destroy,
};
Loading