diff options
author | Harry Wentland <harry.wentland@amd.com> | 2018-10-05 11:58:34 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-06 14:02:24 -0500 |
commit | f180b4bccc89332cad420a192797bc5dfb1ab5ee (patch) | |
tree | 291098d411cd57bb4cb38d86d26cad9bd837783d /drivers | |
parent | c2af2a4264f8b6151837dd58623a6cb786348e44 (diff) |
drm/amdgpu: Drop amdgpu_plane
It's unnecessarily duplicating drm_plane_type.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 38 |
2 files changed, 20 insertions, 26 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index b9e9e8b02fb7..11723d8fffbd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | |||
@@ -57,7 +57,6 @@ struct amdgpu_hpd; | |||
57 | #define to_amdgpu_connector(x) container_of(x, struct amdgpu_connector, base) | 57 | #define to_amdgpu_connector(x) container_of(x, struct amdgpu_connector, base) |
58 | #define to_amdgpu_encoder(x) container_of(x, struct amdgpu_encoder, base) | 58 | #define to_amdgpu_encoder(x) container_of(x, struct amdgpu_encoder, base) |
59 | #define to_amdgpu_framebuffer(x) container_of(x, struct amdgpu_framebuffer, base) | 59 | #define to_amdgpu_framebuffer(x) container_of(x, struct amdgpu_framebuffer, base) |
60 | #define to_amdgpu_plane(x) container_of(x, struct amdgpu_plane, base) | ||
61 | 60 | ||
62 | #define to_dm_plane_state(x) container_of(x, struct dm_plane_state, base); | 61 | #define to_dm_plane_state(x) container_of(x, struct dm_plane_state, base); |
63 | 62 | ||
@@ -325,7 +324,7 @@ struct amdgpu_mode_info { | |||
325 | struct card_info *atom_card_info; | 324 | struct card_info *atom_card_info; |
326 | bool mode_config_initialized; | 325 | bool mode_config_initialized; |
327 | struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS]; | 326 | struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS]; |
328 | struct amdgpu_plane *planes[AMDGPU_MAX_PLANES]; | 327 | struct drm_plane *planes[AMDGPU_MAX_PLANES]; |
329 | struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS]; | 328 | struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS]; |
330 | /* DVI-I properties */ | 329 | /* DVI-I properties */ |
331 | struct drm_property *coherent_mode_property; | 330 | struct drm_property *coherent_mode_property; |
@@ -434,11 +433,6 @@ struct amdgpu_crtc { | |||
434 | struct drm_pending_vblank_event *event; | 433 | struct drm_pending_vblank_event *event; |
435 | }; | 434 | }; |
436 | 435 | ||
437 | struct amdgpu_plane { | ||
438 | struct drm_plane base; | ||
439 | enum drm_plane_type plane_type; | ||
440 | }; | ||
441 | |||
442 | struct amdgpu_encoder_atom_dig { | 436 | struct amdgpu_encoder_atom_dig { |
443 | bool linkb; | 437 | bool linkb; |
444 | /* atom dig */ | 438 | /* atom dig */ |
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 7505a33e00e1..9e6596725ed4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
@@ -105,7 +105,7 @@ static void | |||
105 | amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector); | 105 | amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector); |
106 | 106 | ||
107 | static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, | 107 | static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, |
108 | struct amdgpu_plane *aplane, | 108 | struct drm_plane *plane, |
109 | unsigned long possible_crtcs); | 109 | unsigned long possible_crtcs); |
110 | static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, | 110 | static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, |
111 | struct drm_plane *plane, | 111 | struct drm_plane *plane, |
@@ -1641,18 +1641,18 @@ static int initialize_plane(struct amdgpu_display_manager *dm, | |||
1641 | struct amdgpu_mode_info *mode_info, | 1641 | struct amdgpu_mode_info *mode_info, |
1642 | int plane_id) | 1642 | int plane_id) |
1643 | { | 1643 | { |
1644 | struct amdgpu_plane *plane; | 1644 | struct drm_plane *plane; |
1645 | unsigned long possible_crtcs; | 1645 | unsigned long possible_crtcs; |
1646 | int ret = 0; | 1646 | int ret = 0; |
1647 | 1647 | ||
1648 | plane = kzalloc(sizeof(struct amdgpu_plane), GFP_KERNEL); | 1648 | plane = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); |
1649 | mode_info->planes[plane_id] = plane; | 1649 | mode_info->planes[plane_id] = plane; |
1650 | 1650 | ||
1651 | if (!plane) { | 1651 | if (!plane) { |
1652 | DRM_ERROR("KMS: Failed to allocate plane\n"); | 1652 | DRM_ERROR("KMS: Failed to allocate plane\n"); |
1653 | return -ENOMEM; | 1653 | return -ENOMEM; |
1654 | } | 1654 | } |
1655 | plane->base.type = mode_info->plane_type[plane_id]; | 1655 | plane->type = mode_info->plane_type[plane_id]; |
1656 | 1656 | ||
1657 | /* | 1657 | /* |
1658 | * HACK: IGT tests expect that each plane can only have | 1658 | * HACK: IGT tests expect that each plane can only have |
@@ -1743,7 +1743,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) | |||
1743 | } | 1743 | } |
1744 | 1744 | ||
1745 | for (i = 0; i < dm->dc->caps.max_streams; i++) | 1745 | for (i = 0; i < dm->dc->caps.max_streams; i++) |
1746 | if (amdgpu_dm_crtc_init(dm, &mode_info->planes[i]->base, i)) { | 1746 | if (amdgpu_dm_crtc_init(dm, mode_info->planes[i], i)) { |
1747 | DRM_ERROR("KMS: Failed to initialize crtc\n"); | 1747 | DRM_ERROR("KMS: Failed to initialize crtc\n"); |
1748 | goto fail; | 1748 | goto fail; |
1749 | } | 1749 | } |
@@ -3526,49 +3526,49 @@ static const u32 cursor_formats[] = { | |||
3526 | }; | 3526 | }; |
3527 | 3527 | ||
3528 | static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, | 3528 | static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, |
3529 | struct amdgpu_plane *aplane, | 3529 | struct drm_plane *plane, |
3530 | unsigned long possible_crtcs) | 3530 | unsigned long possible_crtcs) |
3531 | { | 3531 | { |
3532 | int res = -EPERM; | 3532 | int res = -EPERM; |
3533 | 3533 | ||
3534 | switch (aplane->base.type) { | 3534 | switch (plane->type) { |
3535 | case DRM_PLANE_TYPE_PRIMARY: | 3535 | case DRM_PLANE_TYPE_PRIMARY: |
3536 | res = drm_universal_plane_init( | 3536 | res = drm_universal_plane_init( |
3537 | dm->adev->ddev, | 3537 | dm->adev->ddev, |
3538 | &aplane->base, | 3538 | plane, |
3539 | possible_crtcs, | 3539 | possible_crtcs, |
3540 | &dm_plane_funcs, | 3540 | &dm_plane_funcs, |
3541 | rgb_formats, | 3541 | rgb_formats, |
3542 | ARRAY_SIZE(rgb_formats), | 3542 | ARRAY_SIZE(rgb_formats), |
3543 | NULL, aplane->base.type, NULL); | 3543 | NULL, plane->type, NULL); |
3544 | break; | 3544 | break; |
3545 | case DRM_PLANE_TYPE_OVERLAY: | 3545 | case DRM_PLANE_TYPE_OVERLAY: |
3546 | res = drm_universal_plane_init( | 3546 | res = drm_universal_plane_init( |
3547 | dm->adev->ddev, | 3547 | dm->adev->ddev, |
3548 | &aplane->base, | 3548 | plane, |
3549 | possible_crtcs, | 3549 | possible_crtcs, |
3550 | &dm_plane_funcs, | 3550 | &dm_plane_funcs, |
3551 | yuv_formats, | 3551 | yuv_formats, |
3552 | ARRAY_SIZE(yuv_formats), | 3552 | ARRAY_SIZE(yuv_formats), |
3553 | NULL, aplane->base.type, NULL); | 3553 | NULL, plane->type, NULL); |
3554 | break; | 3554 | break; |
3555 | case DRM_PLANE_TYPE_CURSOR: | 3555 | case DRM_PLANE_TYPE_CURSOR: |
3556 | res = drm_universal_plane_init( | 3556 | res = drm_universal_plane_init( |
3557 | dm->adev->ddev, | 3557 | dm->adev->ddev, |
3558 | &aplane->base, | 3558 | plane, |
3559 | possible_crtcs, | 3559 | possible_crtcs, |
3560 | &dm_plane_funcs, | 3560 | &dm_plane_funcs, |
3561 | cursor_formats, | 3561 | cursor_formats, |
3562 | ARRAY_SIZE(cursor_formats), | 3562 | ARRAY_SIZE(cursor_formats), |
3563 | NULL, aplane->base.type, NULL); | 3563 | NULL, plane->type, NULL); |
3564 | break; | 3564 | break; |
3565 | } | 3565 | } |
3566 | 3566 | ||
3567 | drm_plane_helper_add(&aplane->base, &dm_plane_helper_funcs); | 3567 | drm_plane_helper_add(plane, &dm_plane_helper_funcs); |
3568 | 3568 | ||
3569 | /* Create (reset) the plane state */ | 3569 | /* Create (reset) the plane state */ |
3570 | if (aplane->base.funcs->reset) | 3570 | if (plane->funcs->reset) |
3571 | aplane->base.funcs->reset(&aplane->base); | 3571 | plane->funcs->reset(plane); |
3572 | 3572 | ||
3573 | 3573 | ||
3574 | return res; | 3574 | return res; |
@@ -3579,7 +3579,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, | |||
3579 | uint32_t crtc_index) | 3579 | uint32_t crtc_index) |
3580 | { | 3580 | { |
3581 | struct amdgpu_crtc *acrtc = NULL; | 3581 | struct amdgpu_crtc *acrtc = NULL; |
3582 | struct amdgpu_plane *cursor_plane; | 3582 | struct drm_plane *cursor_plane; |
3583 | 3583 | ||
3584 | int res = -ENOMEM; | 3584 | int res = -ENOMEM; |
3585 | 3585 | ||
@@ -3587,7 +3587,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, | |||
3587 | if (!cursor_plane) | 3587 | if (!cursor_plane) |
3588 | goto fail; | 3588 | goto fail; |
3589 | 3589 | ||
3590 | cursor_plane->base.type = DRM_PLANE_TYPE_CURSOR; | 3590 | cursor_plane->type = DRM_PLANE_TYPE_CURSOR; |
3591 | res = amdgpu_dm_plane_init(dm, cursor_plane, 0); | 3591 | res = amdgpu_dm_plane_init(dm, cursor_plane, 0); |
3592 | 3592 | ||
3593 | acrtc = kzalloc(sizeof(struct amdgpu_crtc), GFP_KERNEL); | 3593 | acrtc = kzalloc(sizeof(struct amdgpu_crtc), GFP_KERNEL); |
@@ -3598,7 +3598,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, | |||
3598 | dm->ddev, | 3598 | dm->ddev, |
3599 | &acrtc->base, | 3599 | &acrtc->base, |
3600 | plane, | 3600 | plane, |
3601 | &cursor_plane->base, | 3601 | cursor_plane, |
3602 | &amdgpu_dm_crtc_funcs, NULL); | 3602 | &amdgpu_dm_crtc_funcs, NULL); |
3603 | 3603 | ||
3604 | if (res) | 3604 | if (res) |