Skip to content

Commit 4a3b876

Browse files
mattropedanvet
authored andcommitted
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>
1 parent c34c9ee commit 4a3b876

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4037,7 +4037,7 @@ static void ironlake_pfit_enable(struct intel_crtc *crtc)
40374037
}
40384038
}
40394039

4040-
static void intel_enable_planes(struct drm_crtc *crtc)
4040+
static void intel_enable_sprite_planes(struct drm_crtc *crtc)
40414041
{
40424042
struct drm_device *dev = crtc->dev;
40434043
enum pipe pipe = to_intel_crtc(crtc)->pipe;
@@ -4051,7 +4051,7 @@ static void intel_enable_planes(struct drm_crtc *crtc)
40514051
}
40524052
}
40534053

4054-
static void intel_disable_planes(struct drm_crtc *crtc)
4054+
static void intel_disable_sprite_planes(struct drm_crtc *crtc)
40554055
{
40564056
struct drm_device *dev = crtc->dev;
40574057
enum pipe pipe = to_intel_crtc(crtc)->pipe;
@@ -4195,7 +4195,7 @@ static void intel_crtc_enable_planes(struct drm_crtc *crtc)
41954195
int pipe = intel_crtc->pipe;
41964196

41974197
intel_enable_primary_hw_plane(crtc->primary, crtc);
4198-
intel_enable_planes(crtc);
4198+
intel_enable_sprite_planes(crtc);
41994199
intel_crtc_update_cursor(crtc, true);
42004200
intel_crtc_dpms_overlay(intel_crtc, true);
42014201

@@ -4230,7 +4230,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc)
42304230

42314231
intel_crtc_dpms_overlay(intel_crtc, false);
42324232
intel_crtc_update_cursor(crtc, false);
4233-
intel_disable_planes(crtc);
4233+
intel_disable_sprite_planes(crtc);
42344234
intel_disable_primary_hw_plane(crtc->primary, crtc);
42354235

42364236
/*
@@ -12012,8 +12012,14 @@ intel_disable_plane(struct drm_plane *plane)
1201212012
0, 0, 0, 0, 0, 0, 0, 0);
1201312013
}
1201412014

12015-
/* Common destruction function for both primary and cursor planes */
12016-
static void intel_plane_destroy(struct drm_plane *plane)
12015+
/**
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+
*/
12022+
void intel_plane_destroy(struct drm_plane *plane)
1201712023
{
1201812024
struct intel_plane *intel_plane = to_intel_plane(plane);
1201912025
drm_plane_cleanup(plane);

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ int intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
10551055
uint32_t src_x, uint32_t src_y,
10561056
uint32_t src_w, uint32_t src_h);
10571057
int intel_disable_plane(struct drm_plane *plane);
1058+
void intel_plane_destroy(struct drm_plane *plane);
10581059

10591060
/* intel_dp_mst.c */
10601061
int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);

drivers/gpu/drm/i915/intel_sprite.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,14 +1306,6 @@ intel_commit_sprite_plane(struct drm_plane *plane,
13061306
}
13071307
}
13081308

1309-
static 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-
13171309
int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
13181310
struct drm_file *file_priv)
13191311
{
@@ -1413,10 +1405,10 @@ int intel_plane_restore(struct drm_plane *plane)
14131405
intel_plane->src_w, intel_plane->src_h);
14141406
}
14151407

1416-
static const struct drm_plane_funcs intel_plane_funcs = {
1408+
static const struct drm_plane_funcs intel_sprite_plane_funcs = {
14171409
.update_plane = intel_update_plane,
14181410
.disable_plane = intel_disable_plane,
1419-
.destroy = intel_destroy_plane,
1411+
.destroy = intel_plane_destroy,
14201412
.set_property = intel_plane_set_property,
14211413
};
14221414

@@ -1553,7 +1545,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
15531545
intel_plane->commit_plane = intel_commit_sprite_plane;
15541546
possible_crtcs = (1 << pipe);
15551547
ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs,
1556-
&intel_plane_funcs,
1548+
&intel_sprite_plane_funcs,
15571549
plane_formats, num_plane_formats,
15581550
DRM_PLANE_TYPE_OVERLAY);
15591551
if (ret) {

0 commit comments

Comments
 (0)