aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2014-12-23 13:41:51 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-12 17:59:15 -0500
commit4a3b8769f8b847d1dc3c0c14a0b0e1878be2d01c (patch)
tree61bd9ef1887744d4c20aa040c8b8fce4a1071ca9
parentc34c9ee4828f251a4f4200211d40d3cb79761ef0 (diff)
drm/i915: Clarify sprite plane function names (v4)
A few of the sprite-related function names in i915 are very similar (e.g., intel_enable_planes() vs intel_crtc_enable_planes()) and don't make it clear whether they only operate on sprite planes, or whether they also apply to all universal plane types. Rename a few functions to be more consistent with our function naming for primary/cursor planes or to clarify that they apply specifically to sprite planes: - s/intel_disable_planes/intel_disable_sprite_planes/ - s/intel_enable_planes/intel_enable_sprite_planes/ Also, drop the sprite-specific intel_destroy_plane() and just use the type-agnostic intel_plane_destroy() function. The extra 'disable' call that intel_destroy_plane() did is unnecessary since the plane will already be disabled due to framebuffer destruction by the point it gets called. v2: Earlier consolidation patches have reduced the number of functions we need to rename here. v3: Also rename intel_plane_funcs vtable to intel_sprite_plane_funcs for consistency with primary/cursor. (Ander) v4: Convert comment for intel_plane_destroy() to kerneldoc now that it is no longer a static function. (Ander) Reviewed-by(v1): Bob Paauwe <bob.j.paauwe@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c18
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c14
3 files changed, 16 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b7c59d56c3a6..d304cb87493d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4037,7 +4037,7 @@ static void ironlake_pfit_enable(struct intel_crtc *crtc)
4037 } 4037 }
4038} 4038}
4039 4039
4040static void intel_enable_planes(struct drm_crtc *crtc) 4040static void intel_enable_sprite_planes(struct drm_crtc *crtc)
4041{ 4041{
4042 struct drm_device *dev = crtc->dev; 4042 struct drm_device *dev = crtc->dev;
4043 enum pipe pipe = to_intel_crtc(crtc)->pipe; 4043 enum pipe pipe = to_intel_crtc(crtc)->pipe;
@@ -4051,7 +4051,7 @@ static void intel_enable_planes(struct drm_crtc *crtc)
4051 } 4051 }
4052} 4052}
4053 4053
4054static void intel_disable_planes(struct drm_crtc *crtc) 4054static void intel_disable_sprite_planes(struct drm_crtc *crtc)
4055{ 4055{
4056 struct drm_device *dev = crtc->dev; 4056 struct drm_device *dev = crtc->dev;
4057 enum pipe pipe = to_intel_crtc(crtc)->pipe; 4057 enum pipe pipe = to_intel_crtc(crtc)->pipe;
@@ -4195,7 +4195,7 @@ static void intel_crtc_enable_planes(struct drm_crtc *crtc)
4195 int pipe = intel_crtc->pipe; 4195 int pipe = intel_crtc->pipe;
4196 4196
4197 intel_enable_primary_hw_plane(crtc->primary, crtc); 4197 intel_enable_primary_hw_plane(crtc->primary, crtc);
4198 intel_enable_planes(crtc); 4198 intel_enable_sprite_planes(crtc);
4199 intel_crtc_update_cursor(crtc, true); 4199 intel_crtc_update_cursor(crtc, true);
4200 intel_crtc_dpms_overlay(intel_crtc, true); 4200 intel_crtc_dpms_overlay(intel_crtc, true);
4201 4201
@@ -4230,7 +4230,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc)
4230 4230
4231 intel_crtc_dpms_overlay(intel_crtc, false); 4231 intel_crtc_dpms_overlay(intel_crtc, false);
4232 intel_crtc_update_cursor(crtc, false); 4232 intel_crtc_update_cursor(crtc, false);
4233 intel_disable_planes(crtc); 4233 intel_disable_sprite_planes(crtc);
4234 intel_disable_primary_hw_plane(crtc->primary, crtc); 4234 intel_disable_primary_hw_plane(crtc->primary, crtc);
4235 4235
4236 /* 4236 /*
@@ -12012,8 +12012,14 @@ intel_disable_plane(struct drm_plane *plane)
12012 0, 0, 0, 0, 0, 0, 0, 0); 12012 0, 0, 0, 0, 0, 0, 0, 0);
12013} 12013}
12014 12014
12015/* Common destruction function for both primary and cursor planes */ 12015/**
12016static void intel_plane_destroy(struct drm_plane *plane) 12016 * intel_plane_destroy - destroy a plane
12017 * @plane: plane to destroy
12018 *
12019 * Common destruction function for all types of planes (primary, cursor,
12020 * sprite).
12021 */
12022void intel_plane_destroy(struct drm_plane *plane)
12017{ 12023{
12018 struct intel_plane *intel_plane = to_intel_plane(plane); 12024 struct intel_plane *intel_plane = to_intel_plane(plane);
12019 drm_plane_cleanup(plane); 12025 drm_plane_cleanup(plane);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 8051468a3f7e..8022ea570a21 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1055,6 +1055,7 @@ int intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
1055 uint32_t src_x, uint32_t src_y, 1055 uint32_t src_x, uint32_t src_y,
1056 uint32_t src_w, uint32_t src_h); 1056 uint32_t src_w, uint32_t src_h);
1057int intel_disable_plane(struct drm_plane *plane); 1057int intel_disable_plane(struct drm_plane *plane);
1058void intel_plane_destroy(struct drm_plane *plane);
1058 1059
1059/* intel_dp_mst.c */ 1060/* intel_dp_mst.c */
1060int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id); 1061int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 1dfdccbb9ab2..bb67ae70dafd 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1306,14 +1306,6 @@ intel_commit_sprite_plane(struct drm_plane *plane,
1306 } 1306 }
1307} 1307}
1308 1308
1309static void intel_destroy_plane(struct drm_plane *plane)
1310{
1311 struct intel_plane *intel_plane = to_intel_plane(plane);
1312 intel_disable_plane(plane);
1313 drm_plane_cleanup(plane);
1314 kfree(intel_plane);
1315}
1316
1317int intel_sprite_set_colorkey(struct drm_device *dev, void *data, 1309int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
1318 struct drm_file *file_priv) 1310 struct drm_file *file_priv)
1319{ 1311{
@@ -1413,10 +1405,10 @@ int intel_plane_restore(struct drm_plane *plane)
1413 intel_plane->src_w, intel_plane->src_h); 1405 intel_plane->src_w, intel_plane->src_h);
1414} 1406}
1415 1407
1416static const struct drm_plane_funcs intel_plane_funcs = { 1408static const struct drm_plane_funcs intel_sprite_plane_funcs = {
1417 .update_plane = intel_update_plane, 1409 .update_plane = intel_update_plane,
1418 .disable_plane = intel_disable_plane, 1410 .disable_plane = intel_disable_plane,
1419 .destroy = intel_destroy_plane, 1411 .destroy = intel_plane_destroy,
1420 .set_property = intel_plane_set_property, 1412 .set_property = intel_plane_set_property,
1421}; 1413};
1422 1414
@@ -1553,7 +1545,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
1553 intel_plane->commit_plane = intel_commit_sprite_plane; 1545 intel_plane->commit_plane = intel_commit_sprite_plane;
1554 possible_crtcs = (1 << pipe); 1546 possible_crtcs = (1 << pipe);
1555 ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, 1547 ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs,
1556 &intel_plane_funcs, 1548 &intel_sprite_plane_funcs,
1557 plane_formats, num_plane_formats, 1549 plane_formats, num_plane_formats,
1558 DRM_PLANE_TYPE_OVERLAY); 1550 DRM_PLANE_TYPE_OVERLAY);
1559 if (ret) { 1551 if (ret) {