aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-07-17 23:30:04 -0400
committerDave Airlie <airlied@redhat.com>2014-07-18 00:25:15 -0400
commit7707e6535f43328e05e4729ac96eee864b90e8a4 (patch)
treef4b5ef3ab0b67b86b2a75a8f3c5a7e7f0086848c
parent6d385c0aa31de99da391fda0fc43462e2df20863 (diff)
drm/i915: use helpers
Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c9
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c9
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c12
3 files changed, 12 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 927d2476f60a..8796eb18c9a4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11738,21 +11738,20 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
11738 struct drm_file *file) 11738 struct drm_file *file)
11739{ 11739{
11740 struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data; 11740 struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
11741 struct drm_mode_object *drmmode_obj; 11741 struct drm_crtc *drmmode_crtc;
11742 struct intel_crtc *crtc; 11742 struct intel_crtc *crtc;
11743 11743
11744 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 11744 if (!drm_core_check_feature(dev, DRIVER_MODESET))
11745 return -ENODEV; 11745 return -ENODEV;
11746 11746
11747 drmmode_obj = drm_mode_object_find(dev, pipe_from_crtc_id->crtc_id, 11747 drmmode_crtc = drm_crtc_find(dev, pipe_from_crtc_id->crtc_id);
11748 DRM_MODE_OBJECT_CRTC);
11749 11748
11750 if (!drmmode_obj) { 11749 if (!drmmode_crtc) {
11751 DRM_ERROR("no such CRTC id\n"); 11750 DRM_ERROR("no such CRTC id\n");
11752 return -ENOENT; 11751 return -ENOENT;
11753 } 11752 }
11754 11753
11755 crtc = to_intel_crtc(obj_to_crtc(drmmode_obj)); 11754 crtc = to_intel_crtc(drmmode_crtc);
11756 pipe_from_crtc_id->pipe = crtc->pipe; 11755 pipe_from_crtc_id->pipe = crtc->pipe;
11757 11756
11758 return 0; 11757 return 0;
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 307c2f1842b7..dc2f4f26c961 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1039,7 +1039,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
1039 struct drm_intel_overlay_put_image *put_image_rec = data; 1039 struct drm_intel_overlay_put_image *put_image_rec = data;
1040 struct drm_i915_private *dev_priv = dev->dev_private; 1040 struct drm_i915_private *dev_priv = dev->dev_private;
1041 struct intel_overlay *overlay; 1041 struct intel_overlay *overlay;
1042 struct drm_mode_object *drmmode_obj; 1042 struct drm_crtc *drmmode_crtc;
1043 struct intel_crtc *crtc; 1043 struct intel_crtc *crtc;
1044 struct drm_i915_gem_object *new_bo; 1044 struct drm_i915_gem_object *new_bo;
1045 struct put_image_params *params; 1045 struct put_image_params *params;
@@ -1068,13 +1068,12 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
1068 if (!params) 1068 if (!params)
1069 return -ENOMEM; 1069 return -ENOMEM;
1070 1070
1071 drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id, 1071 drmmode_crtc = drm_crtc_find(dev, put_image_rec->crtc_id);
1072 DRM_MODE_OBJECT_CRTC); 1072 if (!drmmode_crtc) {
1073 if (!drmmode_obj) {
1074 ret = -ENOENT; 1073 ret = -ENOENT;
1075 goto out_free; 1074 goto out_free;
1076 } 1075 }
1077 crtc = to_intel_crtc(obj_to_crtc(drmmode_obj)); 1076 crtc = to_intel_crtc(drmmode_crtc);
1078 1077
1079 new_bo = to_intel_bo(drm_gem_object_lookup(dev, file_priv, 1078 new_bo = to_intel_bo(drm_gem_object_lookup(dev, file_priv,
1080 put_image_rec->bo_handle)); 1079 put_image_rec->bo_handle));
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 985317eb1dc9..6afd1cfe7c44 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1123,7 +1123,6 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
1123 struct drm_file *file_priv) 1123 struct drm_file *file_priv)
1124{ 1124{
1125 struct drm_intel_sprite_colorkey *set = data; 1125 struct drm_intel_sprite_colorkey *set = data;
1126 struct drm_mode_object *obj;
1127 struct drm_plane *plane; 1126 struct drm_plane *plane;
1128 struct intel_plane *intel_plane; 1127 struct intel_plane *intel_plane;
1129 int ret = 0; 1128 int ret = 0;
@@ -1137,13 +1136,12 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
1137 1136
1138 drm_modeset_lock_all(dev); 1137 drm_modeset_lock_all(dev);
1139 1138
1140 obj = drm_mode_object_find(dev, set->plane_id, DRM_MODE_OBJECT_PLANE); 1139 plane = drm_plane_find(dev, set->plane_id);
1141 if (!obj) { 1140 if (!plane) {
1142 ret = -ENOENT; 1141 ret = -ENOENT;
1143 goto out_unlock; 1142 goto out_unlock;
1144 } 1143 }
1145 1144
1146 plane = obj_to_plane(obj);
1147 intel_plane = to_intel_plane(plane); 1145 intel_plane = to_intel_plane(plane);
1148 ret = intel_plane->update_colorkey(plane, set); 1146 ret = intel_plane->update_colorkey(plane, set);
1149 1147
@@ -1156,7 +1154,6 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
1156 struct drm_file *file_priv) 1154 struct drm_file *file_priv)
1157{ 1155{
1158 struct drm_intel_sprite_colorkey *get = data; 1156 struct drm_intel_sprite_colorkey *get = data;
1159 struct drm_mode_object *obj;
1160 struct drm_plane *plane; 1157 struct drm_plane *plane;
1161 struct intel_plane *intel_plane; 1158 struct intel_plane *intel_plane;
1162 int ret = 0; 1159 int ret = 0;
@@ -1166,13 +1163,12 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
1166 1163
1167 drm_modeset_lock_all(dev); 1164 drm_modeset_lock_all(dev);
1168 1165
1169 obj = drm_mode_object_find(dev, get->plane_id, DRM_MODE_OBJECT_PLANE); 1166 plane = drm_plane_find(dev, get->plane_id);
1170 if (!obj) { 1167 if (!plane) {
1171 ret = -ENOENT; 1168 ret = -ENOENT;
1172 goto out_unlock; 1169 goto out_unlock;
1173 } 1170 }
1174 1171
1175 plane = obj_to_plane(obj);
1176 intel_plane = to_intel_plane(plane); 1172 intel_plane = to_intel_plane(plane);
1177 intel_plane->get_colorkey(plane, get); 1173 intel_plane->get_colorkey(plane, get);
1178 1174