Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260060
b: refs/heads/master
c: 173b3de
h: refs/heads/master
v: v3
  • Loading branch information
Octavian Purdila authored and Greg Kroah-Hartman committed Jul 15, 2011
1 parent d5f3377 commit fee8b11
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3de78a9dbf173952270e761c21f2df3a7e1ed256
refs/heads/master: 173b3de9a5817ec2c264eca1b8795c7dbda3c50e
2 changes: 2 additions & 0 deletions trunk/drivers/staging/gma500/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ int gma_backlight_init(struct drm_device *dev)
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private;
return dev_priv->ops->backlight_init(dev);
#else
return 0;
#endif
}

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/staging/gma500/mdfld_dsi_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@ static int mdfld_dsi_connector_set_property(struct drm_connector * connector,
uint64_t value)
{
struct drm_encoder * encoder = connector->encoder;
struct backlight_device * psb_bd;
struct drm_psb_private * dev_priv = encoder->dev->dev_private;

if (!strcmp(property->name, "scaling mode") && encoder) {
struct psb_intel_crtc * psb_crtc = to_psb_intel_crtc(encoder->crtc);
Expand Down Expand Up @@ -515,13 +513,14 @@ static int mdfld_dsi_connector_set_property(struct drm_connector * connector,
}
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
} else if (!strcmp(property->name, "backlight") && encoder) {
struct drm_psb_private *dev_priv = encoder->dev->dev_private;
struct backlight_device *psb_bd = dev_priv->backlight_device;
dev_dbg(encoder->dev->dev, "backlight level = %d\n", (int)value);
if (drm_connector_property_set_value(connector, property, value))
goto set_prop_error;
else {
dev_dbg(encoder->dev->dev,
"set brightness to %d", (int)value);
psb_bd = dev_priv->backlight_device;
if (psb_bd) {
psb_bd->props.brightness = value;
backlight_update_status(psb_bd);
Expand Down
28 changes: 13 additions & 15 deletions trunk/drivers/staging/gma500/psb_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,20 +536,24 @@ static int psb_dc_state_ioctl(struct drm_device *dev, void * data,
return -EINVAL;
}

static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
static inline void get_brightness(struct backlight_device *bd)
{
struct drm_psb_private *dev_priv = psb_priv(dev);
uint32_t *arg = data;
struct backlight_device *bd = dev_priv->backlight_device;
dev_priv->blc_adj2 = *arg;

#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
if (bd) {
bd->props.brightness = bd->ops->get_brightness(bd);
backlight_update_status(bd);
}
#endif
}

static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_psb_private *dev_priv = psb_priv(dev);
uint32_t *arg = data;

dev_priv->blc_adj2 = *arg;
get_brightness(dev_priv->backlight_device);
return 0;
}

Expand All @@ -558,15 +562,9 @@ static int psb_adb_ioctl(struct drm_device *dev, void *data,
{
struct drm_psb_private *dev_priv = psb_priv(dev);
uint32_t *arg = data;
struct backlight_device *bd = dev_priv->backlight_device;
dev_priv->blc_adj1 = *arg;

#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
if (bd) {
bd->props.brightness = bd->ops->get_brightness(bd);
backlight_update_status(bd);
}
#endif
dev_priv->blc_adj1 = *arg;
get_brightness(dev_priv->backlight_device);
return 0;
}

Expand Down
19 changes: 7 additions & 12 deletions trunk/drivers/staging/gma500/psb_intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@ static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
struct psb_intel_mode_device *mode_dev =
enc_to_psb_intel_output(encoder)->mode_dev;
struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
u32 pfit_control;
Expand Down Expand Up @@ -571,17 +569,14 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
uint64_t value)
{
struct drm_encoder *encoder = connector->encoder;
struct drm_psb_private *dev_priv;

if (!encoder)
return -1;

dev_priv = encoder->dev->dev_private;

if (!strcmp(property->name, "scaling mode")) {
struct psb_intel_crtc *crtc =
to_psb_intel_crtc(encoder->crtc);
uint64_t curValue;
uint64_t curval;

if (!crtc)
goto set_prop_error;
Expand All @@ -599,10 +594,10 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,

if (drm_connector_property_get_value(connector,
property,
&curValue))
&curval))
goto set_prop_error;

if (curValue == value)
if (curval == value)
goto set_prop_done;

if (drm_connector_property_set_value(connector,
Expand All @@ -626,18 +621,18 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
goto set_prop_error;
else {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct backlight_device *bd =
dev_priv->backlight_device;
struct drm_psb_private *devp = encoder->dev->dev_private;
struct backlight_device *bd = devp->backlight_device;
if (bd) {
bd->props.brightness = value;
backlight_update_status(bd);
}
#endif
}
} else if (!strcmp(property->name, "DPMS")) {
struct drm_encoder_helper_funcs *pEncHFuncs
struct drm_encoder_helper_funcs *hfuncs
= encoder->helper_private;
pEncHFuncs->dpms(encoder, value);
hfuncs->dpms(encoder, value);
}

set_prop_done:
Expand Down

0 comments on commit fee8b11

Please sign in to comment.