summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2008-07-06 11:08:49 +0200
committerMaarten Maathuis <madman2003@gmail.com>2008-07-06 11:08:49 +0200
commit6738e7b00bf05529303ed690873495db6d83337c (patch)
treec29353f4c78fb75de913683add74ee6580be2972
parente810cb9243fe6c4905182869d9e3272d861a14cb (diff)
modesetting-101: Rename DPMS modes to avoid compatibility issues with xorg definitions.
-rw-r--r--linux-core/drm_crtc.c8
-rw-r--r--linux-core/drm_crtc_helper.c4
-rw-r--r--linux-core/dvo_ch7017.c6
-rw-r--r--linux-core/dvo_ch7xxx.c2
-rw-r--r--linux-core/dvo_ivch.c6
-rw-r--r--linux-core/dvo_sil164.c2
-rw-r--r--linux-core/dvo_tfp410.c2
-rw-r--r--linux-core/intel_crt.c8
-rw-r--r--linux-core/intel_display.c34
-rw-r--r--linux-core/intel_dvo.c2
-rw-r--r--linux-core/intel_lvds.c2
-rw-r--r--linux-core/intel_sdvo.c12
-rw-r--r--linux-core/intel_tv.c8
-rw-r--r--linux-core/nv50_dac.c8
-rw-r--r--linux-core/nv50_kms_wrapper.c4
-rw-r--r--linux-core/nv50_sor.c2
-rw-r--r--shared-core/drm.h9
17 files changed, 60 insertions, 59 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index 47885a07..fc8d1fe8 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -43,10 +43,10 @@ struct drm_prop_enum_list {
* Global properties
*/
static struct drm_prop_enum_list drm_dpms_enum_list[] =
-{ { DPMSModeOn, "On" },
- { DPMSModeStandby, "Standby" },
- { DPMSModeSuspend, "Suspend" },
- { DPMSModeOff, "Off" }
+{ { DRM_MODE_DPMS_ON, "On" },
+ { DRM_MODE_DPMS_STANDBY, "Standby" },
+ { DRM_MODE_DPMS_SUSPEND, "Suspend" },
+ { DRM_MODE_DPMS_OFF, "Off" }
};
char *drm_get_dpms_name(int val)
diff --git a/linux-core/drm_crtc_helper.c b/linux-core/drm_crtc_helper.c
index d5a9f279..18fc9d98 100644
--- a/linux-core/drm_crtc_helper.c
+++ b/linux-core/drm_crtc_helper.c
@@ -182,14 +182,14 @@ void drm_helper_disable_unused_functions(struct drm_device *dev)
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
encoder_funcs = encoder->helper_private;
if (!encoder->crtc)
- (*encoder_funcs->dpms)(encoder, DPMSModeOff);
+ (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
}
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
crtc->enabled = drm_helper_crtc_in_use(crtc);
if (!crtc->enabled) {
- crtc_funcs->dpms(crtc, DPMSModeOff);
+ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
crtc->fb = NULL;
}
}
diff --git a/linux-core/dvo_ch7017.c b/linux-core/dvo_ch7017.c
index 194a7af1..b10e0388 100644
--- a/linux-core/dvo_ch7017.c
+++ b/linux-core/dvo_ch7017.c
@@ -327,7 +327,7 @@ static void ch7017_mode_set(struct intel_dvo_device *dvo,
lvds_power_down = CH7017_LVDS_POWER_DOWN_DEFAULT_RESERVED |
(mode->hdisplay & 0x0700) >> 8;
- ch7017_dpms(dvo, DPMSModeOff);
+ ch7017_dpms(dvo, DRM_MODE_DPMS_OFF);
ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT,
horizontal_active_pixel_input);
ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_OUTPUT,
@@ -363,7 +363,7 @@ static void ch7017_dpms(struct intel_dvo_device *dvo, int mode)
CH7017_DAC3_POWER_DOWN |
CH7017_TV_POWER_DOWN_EN);
- if (mode == DPMSModeOn) {
+ if (mode == DRM_MODE_DPMS_ON) {
/* Turn on the LVDS */
ch7017_write(dvo, CH7017_LVDS_POWER_DOWN,
val & ~CH7017_LVDS_POWER_DOWN_EN);
@@ -418,7 +418,7 @@ static void ch7017_restore(struct intel_dvo_device *dvo)
struct ch7017_priv *priv = dvo->dev_priv;
/* Power down before changing mode */
- ch7017_dpms(dvo, DPMSModeOff);
+ 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);
diff --git a/linux-core/dvo_ch7xxx.c b/linux-core/dvo_ch7xxx.c
index 1fe9eb0f..ebf54bff 100644
--- a/linux-core/dvo_ch7xxx.c
+++ b/linux-core/dvo_ch7xxx.c
@@ -301,7 +301,7 @@ static void ch7xxx_mode_set(struct intel_dvo_device *dvo,
/* set the CH7xxx power state */
static void ch7xxx_dpms(struct intel_dvo_device *dvo, int mode)
{
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_DVIL | CH7xxx_PM_DVIP);
else
ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_FPD);
diff --git a/linux-core/dvo_ivch.c b/linux-core/dvo_ivch.c
index 7ba00b34..3a29ab6a 100644
--- a/linux-core/dvo_ivch.c
+++ b/linux-core/dvo_ivch.c
@@ -321,13 +321,13 @@ static void ivch_dpms(struct intel_dvo_device *dvo, int mode)
if (!ivch_read(dvo, VR01, &vr01))
return;
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
backlight = 1;
else
backlight = 0;
ivch_write(dvo, VR80, backlight);
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
vr01 |= VR01_LCD_ENABLE | VR01_DVO_ENABLE;
else
vr01 &= ~(VR01_LCD_ENABLE | VR01_DVO_ENABLE);
@@ -339,7 +339,7 @@ static void ivch_dpms(struct intel_dvo_device *dvo, int mode)
if (!ivch_read(dvo, VR30, &vr30))
break;
- if (((vr30 & VR30_PANEL_ON) != 0) == (mode == DPMSModeOn))
+ if (((vr30 & VR30_PANEL_ON) != 0) == (mode == DRM_MODE_DPMS_ON))
break;
udelay(1000);
}
diff --git a/linux-core/dvo_sil164.c b/linux-core/dvo_sil164.c
index d0fa4913..033a4bb0 100644
--- a/linux-core/dvo_sil164.c
+++ b/linux-core/dvo_sil164.c
@@ -226,7 +226,7 @@ static void sil164_dpms(struct intel_dvo_device *dvo, int mode)
if (ret == false)
return;
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
ch |= SIL164_8_PD;
else
ch &= ~SIL164_8_PD;
diff --git a/linux-core/dvo_tfp410.c b/linux-core/dvo_tfp410.c
index c1d1aa96..8e26235c 100644
--- a/linux-core/dvo_tfp410.c
+++ b/linux-core/dvo_tfp410.c
@@ -248,7 +248,7 @@ static void tfp410_dpms(struct intel_dvo_device *dvo, int mode)
if (!tfp410_readb(dvo, TFP410_CTL_1, &ctl1))
return;
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
ctl1 |= TFP410_CTL_1_PD;
else
ctl1 &= ~TFP410_CTL_1_PD;
diff --git a/linux-core/intel_crt.c b/linux-core/intel_crt.c
index 4326aef9..1b2b5b7e 100644
--- a/linux-core/intel_crt.c
+++ b/linux-core/intel_crt.c
@@ -44,16 +44,16 @@ static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
temp &= ~ADPA_DAC_ENABLE;
switch(mode) {
- case DPMSModeOn:
+ case DRM_MODE_DPMS_ON:
temp |= ADPA_DAC_ENABLE;
break;
- case DPMSModeStandby:
+ case DRM_MODE_DPMS_STANDBY:
temp |= ADPA_DAC_ENABLE | ADPA_HSYNC_CNTL_DISABLE;
break;
- case DPMSModeSuspend:
+ case DRM_MODE_DPMS_SUSPEND:
temp |= ADPA_DAC_ENABLE | ADPA_VSYNC_CNTL_DISABLE;
break;
- case DPMSModeOff:
+ case DRM_MODE_DPMS_OFF:
temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE;
break;
}
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index b82993fc..29aae169 100644
--- a/linux-core/intel_display.c
+++ b/linux-core/intel_display.c
@@ -468,12 +468,12 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
bool enabled;
/* XXX: When our outputs are all unaware of DPMS modes other than off
- * and on, we should map those modes to DPMSModeOff in the CRTC.
+ * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC.
*/
switch (mode) {
- case DPMSModeOn:
- case DPMSModeStandby:
- case DPMSModeSuspend:
+ case DRM_MODE_DPMS_ON:
+ case DRM_MODE_DPMS_STANDBY:
+ case DRM_MODE_DPMS_SUSPEND:
/* Enable the DPLL */
temp = I915_READ(dpll_reg);
if ((temp & DPLL_VCO_ENABLE) == 0) {
@@ -509,7 +509,7 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
/* Give the overlay scaler a chance to enable if it's on this pipe */
//intel_crtc_dpms_video(crtc, TRUE); TODO
break;
- case DPMSModeOff:
+ case DRM_MODE_DPMS_OFF:
/* Give the overlay scaler a chance to disable if it's on this pipe */
//intel_crtc_dpms_video(crtc, FALSE); TODO
@@ -558,7 +558,7 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
if (!master_priv->sarea_priv)
return;
- enabled = crtc->enabled && mode != DPMSModeOff;
+ enabled = crtc->enabled && mode != DRM_MODE_DPMS_OFF;
switch (pipe) {
case 0:
@@ -580,27 +580,27 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
static void intel_crtc_prepare (struct drm_crtc *crtc)
{
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
- crtc_funcs->dpms(crtc, DPMSModeOff);
+ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
}
static void intel_crtc_commit (struct drm_crtc *crtc)
{
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
- crtc_funcs->dpms(crtc, DPMSModeOn);
+ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
}
void intel_encoder_prepare (struct drm_encoder *encoder)
{
struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
/* lvds has its own version of prepare see intel_lvds_prepare */
- encoder_funcs->dpms(encoder, DPMSModeOff);
+ encoder_funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
}
void intel_encoder_commit (struct drm_encoder *encoder)
{
struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
/* lvds has its own version of commit see intel_lvds_commit */
- encoder_funcs->dpms(encoder, DPMSModeOn);
+ encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
}
static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -1145,10 +1145,10 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
/* Make sure the crtc and connector are running */
intel_crtc = to_intel_crtc(crtc);
*dpms_mode = intel_crtc->dpms_mode;
- if (intel_crtc->dpms_mode != DPMSModeOn) {
+ if (intel_crtc->dpms_mode != DRM_MODE_DPMS_ON) {
crtc_funcs = crtc->helper_private;
- crtc_funcs->dpms(crtc, DPMSModeOn);
- encoder_funcs->dpms(encoder, DPMSModeOn);
+ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
+ encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
}
return crtc;
}
@@ -1184,9 +1184,9 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
mode = &load_detect_mode;
drm_crtc_helper_set_mode(crtc, mode, 0, 0);
} else {
- if (intel_crtc->dpms_mode != DPMSModeOn) {
+ if (intel_crtc->dpms_mode != DRM_MODE_DPMS_ON) {
crtc_funcs = crtc->helper_private;
- crtc_funcs->dpms(crtc, DPMSModeOn);
+ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
}
/* Add this connector to the crtc */
@@ -1215,7 +1215,7 @@ void intel_release_load_detect_pipe(struct intel_output *intel_output, int dpms_
}
/* Switch crtc and output back off if necessary */
- if (crtc->enabled && dpms_mode != DPMSModeOn) {
+ if (crtc->enabled && dpms_mode != DRM_MODE_DPMS_ON) {
if (encoder->crtc == crtc)
encoder_funcs->dpms(encoder, dpms_mode);
crtc_funcs->dpms(crtc, dpms_mode);
@@ -1378,7 +1378,7 @@ void intel_crtc_init(struct drm_device *dev, int pipe)
}
intel_crtc->cursor_addr = 0;
- intel_crtc->dpms_mode = DPMSModeOff;
+ intel_crtc->dpms_mode = DRM_MODE_DPMS_OFF;
drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
intel_crtc->mode_set.crtc = &intel_crtc->base;
diff --git a/linux-core/intel_dvo.c b/linux-core/intel_dvo.c
index a3842a91..39ec65d2 100644
--- a/linux-core/intel_dvo.c
+++ b/linux-core/intel_dvo.c
@@ -93,7 +93,7 @@ static void intel_dvo_dpms(struct drm_encoder *encoder, int mode)
u32 dvo_reg = dvo->dvo_reg;
u32 temp = I915_READ(dvo_reg);
- if (mode == DPMSModeOn) {
+ if (mode == DRM_MODE_DPMS_ON) {
I915_WRITE(dvo_reg, temp | DVO_ENABLE);
I915_READ(dvo_reg);
dvo->dev_ops->dpms(dvo, mode);
diff --git a/linux-core/intel_lvds.c b/linux-core/intel_lvds.c
index 04e110e4..06b99867 100644
--- a/linux-core/intel_lvds.c
+++ b/linux-core/intel_lvds.c
@@ -93,7 +93,7 @@ static void intel_lvds_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
intel_lvds_set_power(dev, true);
else
intel_lvds_set_power(dev, false);
diff --git a/linux-core/intel_sdvo.c b/linux-core/intel_sdvo.c
index 2143bdc0..6624bde2 100644
--- a/linux-core/intel_sdvo.c
+++ b/linux-core/intel_sdvo.c
@@ -363,16 +363,16 @@ static bool intel_sdvo_set_encoder_power_state(struct intel_output *intel_output
u8 status, state = SDVO_ENCODER_STATE_ON;
switch (mode) {
- case DPMSModeOn:
+ case DRM_MODE_DPMS_ON:
state = SDVO_ENCODER_STATE_ON;
break;
- case DPMSModeStandby:
+ case DRM_MODE_DPMS_STANDBY:
state = SDVO_ENCODER_STATE_STANDBY;
break;
- case DPMSModeSuspend:
+ case DRM_MODE_DPMS_SUSPEND:
state = SDVO_ENCODER_STATE_SUSPEND;
break;
- case DPMSModeOff:
+ case DRM_MODE_DPMS_OFF:
state = SDVO_ENCODER_STATE_OFF;
break;
}
@@ -691,12 +691,12 @@ static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
u32 temp;
- if (mode != DPMSModeOn) {
+ if (mode != DRM_MODE_DPMS_ON) {
intel_sdvo_set_active_outputs(intel_output, 0);
if (0)
intel_sdvo_set_encoder_power_state(intel_output, mode);
- if (mode == DPMSModeOff) {
+ if (mode == DRM_MODE_DPMS_OFF) {
temp = I915_READ(sdvo_priv->output_device);
if ((temp & SDVO_ENABLE) != 0) {
intel_sdvo_write_sdvox(intel_output, temp & ~SDVO_ENABLE);
diff --git a/linux-core/intel_tv.c b/linux-core/intel_tv.c
index f564fa91..389487bb 100644
--- a/linux-core/intel_tv.c
+++ b/linux-core/intel_tv.c
@@ -904,12 +904,12 @@ intel_tv_dpms(struct drm_encoder *encoder, int mode)
struct drm_i915_private *dev_priv = dev->dev_private;
switch(mode) {
- case DPMSModeOn:
+ case DRM_MODE_DPMS_ON:
I915_WRITE(TV_CTL, I915_READ(TV_CTL) | TV_ENC_ENABLE);
break;
- case DPMSModeStandby:
- case DPMSModeSuspend:
- case DPMSModeOff:
+ case DRM_MODE_DPMS_STANDBY:
+ case DRM_MODE_DPMS_SUSPEND:
+ case DRM_MODE_DPMS_OFF:
I915_WRITE(TV_CTL, I915_READ(TV_CTL) & ~TV_ENC_ENABLE);
break;
}
diff --git a/linux-core/nv50_dac.c b/linux-core/nv50_dac.c
index ce01d573..ca4bb5e1 100644
--- a/linux-core/nv50_dac.c
+++ b/linux-core/nv50_dac.c
@@ -109,17 +109,17 @@ static int nv50_dac_set_power_mode(struct nv50_output *output, int mode)
val = NV_READ(NV50_PDISPLAY_DAC_REGS_DPMS_CTRL(or)) & ~0x7F;
- if (mode != DPMSModeOn)
+ if (mode != DRM_MODE_DPMS_ON)
val |= NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_BLANKED;
switch (mode) {
- case DPMSModeStandby:
+ case DRM_MODE_DPMS_STANDBY:
val |= NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_HSYNC_OFF;
break;
- case DPMSModeSuspend:
+ case DRM_MODE_DPMS_SUSPEND:
val |= NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_VSYNC_OFF;
break;
- case DPMSModeOff:
+ case DRM_MODE_DPMS_OFF:
val |= NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_OFF;
val |= NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_HSYNC_OFF;
val |= NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_VSYNC_OFF;
diff --git a/linux-core/nv50_kms_wrapper.c b/linux-core/nv50_kms_wrapper.c
index b7ba7b00..8f71e649 100644
--- a/linux-core/nv50_kms_wrapper.c
+++ b/linux-core/nv50_kms_wrapper.c
@@ -681,7 +681,7 @@ int nv50_kms_crtc_set_config(struct drm_mode_set *set)
if (output->crtc != crtc)
continue;
- rval = output->set_power_mode(output, DPMSModeOn);
+ rval = output->set_power_mode(output, DRM_MODE_DPMS_ON);
if (rval != 0) {
DRM_ERROR("output set power mode failed\n");
goto out;
@@ -698,7 +698,7 @@ int nv50_kms_crtc_set_config(struct drm_mode_set *set)
rval = drm_connector_property_set_value(drm_connector,
dev->mode_config.dpms_property,
- DPMSModeOn);
+ DRM_MODE_DPMS_ON);
if (rval != 0) {
DRM_ERROR("failed to update dpms state\n");
goto out;
diff --git a/linux-core/nv50_sor.c b/linux-core/nv50_sor.c
index 021a45bf..41116923 100644
--- a/linux-core/nv50_sor.c
+++ b/linux-core/nv50_sor.c
@@ -127,7 +127,7 @@ static int nv50_sor_set_power_mode(struct nv50_output *output, int mode)
val = NV_READ(NV50_PDISPLAY_SOR_REGS_DPMS_CTRL(or));
- if (mode == DPMSModeOn)
+ if (mode == DRM_MODE_DPMS_ON)
val |= NV50_PDISPLAY_SOR_REGS_DPMS_CTRL_ON;
else
val &= ~NV50_PDISPLAY_SOR_REGS_DPMS_CTRL_ON;
diff --git a/shared-core/drm.h b/shared-core/drm.h
index c7c7f13c..2e4d2a94 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -1028,10 +1028,11 @@ struct drm_mm_info_arg {
#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
/* DPMS flags */
-#define DPMSModeOn 0
-#define DPMSModeStandby 1
-#define DPMSModeSuspend 2
-#define DPMSModeOff 3
+/* bit compatible with the xorg definitions. */
+#define DRM_MODE_DPMS_ON 0
+#define DRM_MODE_DPMS_STANDBY 1
+#define DRM_MODE_DPMS_SUSPEND 2
+#define DRM_MODE_DPMS_OFF 3
struct drm_mode_modeinfo {
unsigned int clock;