Add infrastructure for handling underlay planes
Subsystems (3)
cover Add infrastructure for handling underlay planes
I would like to use this letter to explain what this patche does. (Note its tested on Carrizo & Stoney)
* Firstly it decouples the per-plane per-crtc design, as a result, now with the unit test called as 'modetest' we can see 3 planes and 2 crtc's compared to what it was 2 planes for 2 crtc's w/o this patch.
* I have introduced new variable of max_surfaces to the public caps structure that can be used for all asic's in future as well. Basic understanding being:
max_streams == crtc link_count == connector max_surfaces == plane
* The drm device initialization loops now for number of surfaces instead of stream.
* Have taken care that it won't break other asic's
* Am able to reach __setplane_internal() in drm_plane.c which does the final update to plane, had to put a sanity patch there as we do not have update_plane() and disable_plane() implemented --> also testifies, that now we are able to handle planes with this patch.
* The YUV formats supported right now are default, will refine it going further.
Shirish S (1):
drm/amd/display: decouple per-crtc-plane model
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 8 +++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 67 ++++++++++++++----- .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 77 +++++++++++++++------- .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.h | 5 +- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/dce100/dce100_resource.c | 2 + .../drm/amd/display/dc/dce110/dce110_resource.c | 2 + .../drm/amd/display/dc/dce112/dce112_resource.c | 2 + .../drm/amd/display/dc/dce120/dce120_resource.c | 2 + .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 2 + 10 files changed, 127 insertions(+), 41 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1489737093-30620-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org
PATCH 1/1 drm/amd/display: decouple per-crtc-plane model
Current design has per-crtc-plane model.
As a result, for asic's that support underlay, are unable to expose it to user space for modesetting.
To enable this, the drm driver intialisation now runs for number of surfaces instead of stream/crtc.
This patch plumbs surface capabilities to drm framework so that it can be effectively used by user space.
Tests: (On Chromium OS)
* 'modetest -p' now shows additional plane
with YUV capabilities in case of CZ and ST.
* 'plane_test' reaches __setplane_internal and fails there as update_plane function is not implemented.
* Checked multimonitor display works fine
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 8 +++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 67 ++++++++++++++----- .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 77 +++++++++++++++------- .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.h | 5 +- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/dce100/dce100_resource.c | 2 + .../drm/amd/display/dc/dce110/dce110_resource.c | 2 + .../drm/amd/display/dc/dce112/dce112_resource.c | 2 + .../drm/amd/display/dc/dce120/dce120_resource.c | 2 + .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 2 + 10 files changed, 127 insertions(+), 41 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +8 -0
@@ -59,6 +59,7 @@ struct amdgpu_hpd;#define AMDGPU_MAX_HPD_PINS 6#define AMDGPU_MAX_CRTCS 6 +#define AMDGPU_MAX_PLANES 6#define AMDGPU_MAX_AFMT_BLOCKS 9enum amdgpu_rmx_type {
@@ -338,6 +339,7 @@ struct amdgpu_mode_info {struct card_info *atom_card_info;bool mode_config_initialized;struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS ]; +struct amdgpu_plane *planes[AMDGPU_MAX_PLANES ];struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS ];/* DVI-I properties */ struct drm_property *coherent_mode_property;
@@ -371,6 +373,7 @@ struct amdgpu_mode_info {int num_dig;/* number of dig blocks */ int disp_priority;const struct amdgpu_display_funcs *funcs; +enum drm_plane_type *plane_type; };#define AMDGPU_MAX_BL_LEVEL 0xFF
@@ -452,6 +455,11 @@ struct amdgpu_crtc {struct drm_pending_vblank_event *event; }; +struct amdgpu_plane { +struct drm_plane base; +enum drm_plane_type plane_type; +}; +struct amdgpu_encoder_atom_dig {bool linkb;/* atom dig */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +51 -16
141 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c +53 -24
106 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.h +4 -1
@@ -34,8 +34,11 @@ struct dc_validation_set;struct dc_surface ;/*TODO Jodan Hersen use the one in amdgpu_dm*/ +int amdgpu_dm_plane_init (struct amdgpu_display_manager *dm, +struct amdgpu_plane *aplane, +unsigned long possible_crtcs);int amdgpu_dm_crtc_init (struct amdgpu_display_manager *dm, -struct amdgpu_crtc *amdgpu_crtc, +struct drm_plane *plane,uint32_t link_index); int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, struct amdgpu_connector *amdgpu_connector,
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -45,6 +45,7 @@ struct dc_caps {uint32_t max_links;uint32_t max_audios;uint32_t max_slave_planes; +uint32_t max_surfaces;uint32_t max_downscale_ratio;uint32_t i2c_speed_in_khz;
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +2 -0
@@ -1035,6 +1035,8 @@ static bool construct( } } + dc->public.caps.max_surfaces = pool->base.pipe_count; +if (!resource_construct (num_virtual_links, dc, &pool->base, &res_create_funcs)) goto res_create_fail;
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +2 -0
@@ -1419,6 +1419,8 @@ static bool construct(if (!dce110_hw_sequencer_construct (dc)) goto res_create_fail; + dc->public.caps.max_surfaces = pool->base.pipe_count; +bw_calcs_init (&dc->bw_dceip, &dc->bw_vbios, dc->ctx->asic_id);bw_calcs_data_update_from_pplib (dc);
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +2 -0
@@ -1409,6 +1409,8 @@ static bool construct( &res_create_funcs)) goto res_create_fail; + dc->public.caps.max_surfaces = pool->base.pipe_count; +/* Create hardware sequencer */ if (!dce112_hw_sequencer_construct (dc)) goto res_create_fail;
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +2 -0
@@ -1060,6 +1060,8 @@ static bool construct(if (!dce120_hw_sequencer_create (dc)) goto controller_create_fail; + dc->public.caps.max_surfaces = pool->base.pipe_count; +bw_calcs_init (&dc->bw_dceip, &dc->bw_vbios, dc->ctx->asic_id);bw_calcs_data_update_from_pplib (dc);
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +2 -0
@@ -1043,6 +1043,8 @@ static bool construct( } } + dc->public.caps.max_surfaces = pool->base.pipe_count; +if (!resource_construct (num_virtual_links, dc, &pool->base, &res_create_funcs)) goto res_create_fail;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 13 lines · Shirish S
I would like to use this letter to explain what this patche does. (Note its tested on Carrizo & Stoney)
* Firstly it decouples the per-plane per-crtc design, as a result, now with the unit test called as 'modetest' we can see 3 planes and 2 crtc's compared to what it was 2 planes for 2 crtc's w/o this patch.
* I have introduced new variable ofmax_surfacesto the public caps structure that can be used for all asic's in future as well. Basic understanding being:max_streams == crtc link_count == connector max_surfaces == plane
Quoted 10 lines
* The drm device initialization loops now for number of surfaces instead of stream.
* Have taken care that it won't break other asic's
* Am able to reach__setplane_internal()indrm_plane.cwhich does the final update to plane, had to put a sanity patch there as we do not haveupdate_plane()anddisable_plane()implemented --> also testifies, that now we are able to handle planes with this patch.
* The YUV formats supported right now are default, will refine it going further.
Sounds nice.
BTW, are you aware of the KMS tests in the intel-gpu-tools tree
(https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/)? There should be much more comprehensive tests for this functionality there compared to modetest.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): c6ee5135-31d4-7d81-802b-e6dd7b6d04a9-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 26 lines · Michel Dänzer
Quoted 13 lines · Shirish S
I would like to use this letter to explain what this patche does. (Note its tested on Carrizo & Stoney)
* Firstly it decouples the per-plane per-crtc design, as a result, now with the unit test called as 'modetest' we can see 3 planes and 2 crtc's compared to what it was 2 planes for 2 crtc's w/o this patch.
* I have introduced new variable ofmax_surfacesto the public caps structure that can be used for all asic's in future as well. Basic understanding being:max_streams == crtc link_count == connector max_surfaces == planeQuoted 10 lines
* The drm device initialization loops now for number of surfaces instead of stream.
* Have taken care that it won't break other asic's
* Am able to reach__setplane_internal()indrm_plane.cwhich does the final update to plane, had to put a sanity patch there as we do not haveupdate_plane()anddisable_plane()implemented --> also testifies, that now we are able to handle planes with this patch.
* The YUV formats supported right now are default, will refine it going further.
Quoted 6 lines
Sounds nice.
BTW, are you aware of the KMS tests in the intel-gpu-tools tree
(https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/)? There should be much more comprehensive tests for this functionality there compared to modetest.
Yes, there are several auto tests as well i would like to be tested, but there are more patches to follow, as this is just the basic infrastructure to plumb
hardware capabilities to user space via drm-framework, plumbing back to hardware is WIP.
Quoted 5 lines
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx