mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 23:25:54 +00:00
drm/i915: use helpers
Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
6d385c0aa3
commit
7707e6535f
@ -11738,21 +11738,20 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
|
|||||||
struct drm_file *file)
|
struct drm_file *file)
|
||||||
{
|
{
|
||||||
struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
|
struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
|
||||||
struct drm_mode_object *drmmode_obj;
|
struct drm_crtc *drmmode_crtc;
|
||||||
struct intel_crtc *crtc;
|
struct intel_crtc *crtc;
|
||||||
|
|
||||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
drmmode_obj = drm_mode_object_find(dev, pipe_from_crtc_id->crtc_id,
|
drmmode_crtc = drm_crtc_find(dev, pipe_from_crtc_id->crtc_id);
|
||||||
DRM_MODE_OBJECT_CRTC);
|
|
||||||
|
|
||||||
if (!drmmode_obj) {
|
if (!drmmode_crtc) {
|
||||||
DRM_ERROR("no such CRTC id\n");
|
DRM_ERROR("no such CRTC id\n");
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
|
crtc = to_intel_crtc(drmmode_crtc);
|
||||||
pipe_from_crtc_id->pipe = crtc->pipe;
|
pipe_from_crtc_id->pipe = crtc->pipe;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1039,7 +1039,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
|
|||||||
struct drm_intel_overlay_put_image *put_image_rec = data;
|
struct drm_intel_overlay_put_image *put_image_rec = data;
|
||||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||||
struct intel_overlay *overlay;
|
struct intel_overlay *overlay;
|
||||||
struct drm_mode_object *drmmode_obj;
|
struct drm_crtc *drmmode_crtc;
|
||||||
struct intel_crtc *crtc;
|
struct intel_crtc *crtc;
|
||||||
struct drm_i915_gem_object *new_bo;
|
struct drm_i915_gem_object *new_bo;
|
||||||
struct put_image_params *params;
|
struct put_image_params *params;
|
||||||
@ -1068,13 +1068,12 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
|
|||||||
if (!params)
|
if (!params)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id,
|
drmmode_crtc = drm_crtc_find(dev, put_image_rec->crtc_id);
|
||||||
DRM_MODE_OBJECT_CRTC);
|
if (!drmmode_crtc) {
|
||||||
if (!drmmode_obj) {
|
|
||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
|
crtc = to_intel_crtc(drmmode_crtc);
|
||||||
|
|
||||||
new_bo = to_intel_bo(drm_gem_object_lookup(dev, file_priv,
|
new_bo = to_intel_bo(drm_gem_object_lookup(dev, file_priv,
|
||||||
put_image_rec->bo_handle));
|
put_image_rec->bo_handle));
|
||||||
|
@ -1123,7 +1123,6 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
|
|||||||
struct drm_file *file_priv)
|
struct drm_file *file_priv)
|
||||||
{
|
{
|
||||||
struct drm_intel_sprite_colorkey *set = data;
|
struct drm_intel_sprite_colorkey *set = data;
|
||||||
struct drm_mode_object *obj;
|
|
||||||
struct drm_plane *plane;
|
struct drm_plane *plane;
|
||||||
struct intel_plane *intel_plane;
|
struct intel_plane *intel_plane;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -1137,13 +1136,12 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
|
|||||||
|
|
||||||
drm_modeset_lock_all(dev);
|
drm_modeset_lock_all(dev);
|
||||||
|
|
||||||
obj = drm_mode_object_find(dev, set->plane_id, DRM_MODE_OBJECT_PLANE);
|
plane = drm_plane_find(dev, set->plane_id);
|
||||||
if (!obj) {
|
if (!plane) {
|
||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
plane = obj_to_plane(obj);
|
|
||||||
intel_plane = to_intel_plane(plane);
|
intel_plane = to_intel_plane(plane);
|
||||||
ret = intel_plane->update_colorkey(plane, set);
|
ret = intel_plane->update_colorkey(plane, set);
|
||||||
|
|
||||||
@ -1156,7 +1154,6 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
|
|||||||
struct drm_file *file_priv)
|
struct drm_file *file_priv)
|
||||||
{
|
{
|
||||||
struct drm_intel_sprite_colorkey *get = data;
|
struct drm_intel_sprite_colorkey *get = data;
|
||||||
struct drm_mode_object *obj;
|
|
||||||
struct drm_plane *plane;
|
struct drm_plane *plane;
|
||||||
struct intel_plane *intel_plane;
|
struct intel_plane *intel_plane;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -1166,13 +1163,12 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
|
|||||||
|
|
||||||
drm_modeset_lock_all(dev);
|
drm_modeset_lock_all(dev);
|
||||||
|
|
||||||
obj = drm_mode_object_find(dev, get->plane_id, DRM_MODE_OBJECT_PLANE);
|
plane = drm_plane_find(dev, get->plane_id);
|
||||||
if (!obj) {
|
if (!plane) {
|
||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
plane = obj_to_plane(obj);
|
|
||||||
intel_plane = to_intel_plane(plane);
|
intel_plane = to_intel_plane(plane);
|
||||||
intel_plane->get_colorkey(plane, get);
|
intel_plane->get_colorkey(plane, get);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user