UPSTREAM: drm: Make drm_atomic_replace_property_blob_from_id() more generic
Change drm_atomic_replace_property_blob_from_id()'s first parameter
from drm_crtc to drm_device, so that the function can be used for other
drm_mode_objects too.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/851b8504c7f294a10645ba6f6d391ac9764068b7.1492768073.git.jsarha@ti.com
(cherry picked from commit dafee60d48)
Change-Id: I479323a163deaeb6e6ecac2f04fecb39d48444b1
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
parent
4280fa5581
commit
5cb9cc3e1b
3 changed files with 6 additions and 7 deletions
|
|
@ -447,13 +447,12 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob,
|
|||
}
|
||||
|
||||
int
|
||||
drm_atomic_replace_property_blob_from_id(struct drm_crtc *crtc,
|
||||
drm_atomic_replace_property_blob_from_id(struct drm_device *dev,
|
||||
struct drm_property_blob **blob,
|
||||
uint64_t blob_id,
|
||||
ssize_t expected_size,
|
||||
bool *replaced)
|
||||
{
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct drm_property_blob *new_blob = NULL;
|
||||
|
||||
if (blob_id != 0) {
|
||||
|
|
@ -504,7 +503,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
|
|||
drm_property_unreference_blob(mode);
|
||||
return ret;
|
||||
} else if (property == config->degamma_lut_property) {
|
||||
ret = drm_atomic_replace_property_blob_from_id(crtc,
|
||||
ret = drm_atomic_replace_property_blob_from_id(dev,
|
||||
&state->degamma_lut,
|
||||
val,
|
||||
-1,
|
||||
|
|
@ -512,7 +511,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
|
|||
state->color_mgmt_changed = replaced;
|
||||
return ret;
|
||||
} else if (property == config->ctm_property) {
|
||||
ret = drm_atomic_replace_property_blob_from_id(crtc,
|
||||
ret = drm_atomic_replace_property_blob_from_id(dev,
|
||||
&state->ctm,
|
||||
val,
|
||||
sizeof(struct drm_color_ctm),
|
||||
|
|
@ -520,7 +519,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
|
|||
state->color_mgmt_changed = replaced;
|
||||
return ret;
|
||||
} else if (property == config->gamma_lut_property) {
|
||||
ret = drm_atomic_replace_property_blob_from_id(crtc,
|
||||
ret = drm_atomic_replace_property_blob_from_id(dev,
|
||||
&state->gamma_lut,
|
||||
val,
|
||||
-1,
|
||||
|
|
|
|||
|
|
@ -2829,7 +2829,7 @@ static int vop_crtc_atomic_set_property(struct drm_crtc *crtc,
|
|||
bool replaced;
|
||||
ssize_t size = vop->cabc_lut_len * 4;
|
||||
|
||||
return drm_atomic_replace_property_blob_from_id(crtc,
|
||||
return drm_atomic_replace_property_blob_from_id(crtc->dev,
|
||||
&s->cabc_lut,
|
||||
val,
|
||||
size,
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ drm_atomic_get_existing_connector_state(struct drm_atomic_state *state,
|
|||
return state->connector_states[index];
|
||||
}
|
||||
|
||||
int drm_atomic_replace_property_blob_from_id(struct drm_crtc *crtc,
|
||||
int drm_atomic_replace_property_blob_from_id(struct drm_device *dev,
|
||||
struct drm_property_blob **blob,
|
||||
uint64_t blob_id,
|
||||
ssize_t expected_size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue