Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139842
b: refs/heads/master
c: ebcc8f2
h: refs/heads/master
v: v3
  • Loading branch information
Zhenyu Wang authored and Eric Anholt committed Apr 1, 2009
1 parent 72ea9ed commit 6b41252
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 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: 580982d399071474c349538b7f5780bc79b54e7f
refs/heads/master: ebcc8f2eade76946dbb5d5c545b91f8157051aa8
27 changes: 20 additions & 7 deletions trunk/drivers/gpu/drm/i915/intel_tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,32 +1571,45 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop
struct intel_output *intel_output = to_intel_output(connector);
struct intel_tv_priv *tv_priv = intel_output->dev_priv;
int ret = 0;
bool changed = false;

ret = drm_connector_property_set_value(connector, property, val);
if (ret < 0)
goto out;

if (property == dev->mode_config.tv_left_margin_property)
if (property == dev->mode_config.tv_left_margin_property &&
tv_priv->margin[TV_MARGIN_LEFT] != val) {
tv_priv->margin[TV_MARGIN_LEFT] = val;
else if (property == dev->mode_config.tv_right_margin_property)
changed = true;
} else if (property == dev->mode_config.tv_right_margin_property &&
tv_priv->margin[TV_MARGIN_RIGHT] != val) {
tv_priv->margin[TV_MARGIN_RIGHT] = val;
else if (property == dev->mode_config.tv_top_margin_property)
changed = true;
} else if (property == dev->mode_config.tv_top_margin_property &&
tv_priv->margin[TV_MARGIN_TOP] != val) {
tv_priv->margin[TV_MARGIN_TOP] = val;
else if (property == dev->mode_config.tv_bottom_margin_property)
changed = true;
} else if (property == dev->mode_config.tv_bottom_margin_property &&
tv_priv->margin[TV_MARGIN_BOTTOM] != val) {
tv_priv->margin[TV_MARGIN_BOTTOM] = val;
else if (property == dev->mode_config.tv_mode_property) {
changed = true;
} else if (property == dev->mode_config.tv_mode_property) {
if (val >= NUM_TV_MODES) {
ret = -EINVAL;
goto out;
}
if (!strcmp(tv_priv->tv_format, tv_modes[val].name))
goto out;

tv_priv->tv_format = tv_modes[val].name;
intel_tv_mode_set(&intel_output->enc, NULL, NULL);
changed = true;
} else {
ret = -EINVAL;
goto out;
}

intel_tv_mode_set(&intel_output->enc, NULL, NULL);
if (changed)
intel_tv_mode_set(&intel_output->enc, NULL, NULL);
out:
return ret;
}
Expand Down

0 comments on commit 6b41252

Please sign in to comment.