Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307393
b: refs/heads/master
c: bffd9de
h: refs/heads/master
i:
  307391: 176b22e
v: v3
  • Loading branch information
Paulo Zanoni authored and Dave Airlie committed May 17, 2012
1 parent de1fcd1 commit a4361e6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 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: 7f88a9bedfb814a2d4d537db8295c524298256cb
refs/heads/master: bffd9de0297702566e6aec0678c7ebc3806fe3db
20 changes: 20 additions & 0 deletions trunk/drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
if (ret)
goto out;

crtc->base.properties = &crtc->properties;

list_add_tail(&crtc->head, &dev->mode_config.crtc_list);
dev->mode_config.num_crtc++;

Expand Down Expand Up @@ -3141,6 +3143,21 @@ static int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj,
return ret;
}

static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
struct drm_property *property,
uint64_t value)
{
int ret = -EINVAL;
struct drm_crtc *crtc = obj_to_crtc(obj);

if (crtc->funcs->set_property)
ret = crtc->funcs->set_property(crtc, property, value);
if (!ret)
drm_object_property_set_value(obj, property, value);

return ret;
}

int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
Expand Down Expand Up @@ -3239,6 +3256,9 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
ret = drm_mode_connector_set_obj_prop(arg_obj, property,
arg->value);
break;
case DRM_MODE_OBJECT_CRTC:
ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value);
break;
}

out:
Expand Down
9 changes: 8 additions & 1 deletion trunk/include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ struct drm_plane;
* @mode_fixup: fixup proposed mode
* @mode_set: set the desired mode on the CRTC
* @gamma_set: specify color ramp for CRTC
* @destroy: deinit and free object.
* @destroy: deinit and free object
* @set_property: called when a property is changed
*
* The drm_crtc_funcs structure is the central CRTC management structure
* in the DRM. Each CRTC controls one or more connectors (note that the name
Expand Down Expand Up @@ -350,6 +351,9 @@ struct drm_crtc_funcs {
int (*page_flip)(struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event);

int (*set_property)(struct drm_crtc *crtc,
struct drm_property *property, uint64_t val);
};

/**
Expand All @@ -369,6 +373,7 @@ struct drm_crtc_funcs {
* @framedur_ns: precise line timing
* @pixeldur_ns: precise pixel timing
* @helper_private: mid-layer private data
* @properties: property tracking for this CRTC
*
* Each CRTC may have one or more connectors associated with it. This structure
* allows the CRTC to be controlled.
Expand Down Expand Up @@ -404,6 +409,8 @@ struct drm_crtc {

/* if you are using the helper */
void *helper_private;

struct drm_object_properties properties;
};


Expand Down

0 comments on commit a4361e6

Please sign in to comment.