summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/inc
diff options
context:
space:
mode:
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>2019-05-22 18:05:41 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-22 09:34:14 -0500
commitbda9afdacf8942c313a47cc95582737345a91c5e (patch)
tree93c6ddff82040a2b1baba38e14026d800da59767 /drivers/gpu/drm/amd/display/dc/inc
parenta6465d1f3b8f863bd4ffd4048d10de3558b378d5 (diff)
drm/amd/display: move vmid determination logic to a module
Currently vmid is decided internally inside dc. With the introduction of new asics we are required to coordinate vmid use with external components. This change converts vmid logic to a DAL module allowing vmid to be passed in as a parameter to DC. Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Charlene Liu <Charlene.Liu@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/inc')
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h16
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h3
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/vmid.h1
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h17
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/vm_helper.h16
5 files changed, 23 insertions, 30 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
index d56fd7d87bbc..959f5b654611 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
@@ -87,6 +87,7 @@ struct dcn_hubbub_virt_addr_config {
uint64_t page_table_end_addr;
enum dcn_hubbub_page_table_block_size page_table_block_size;
enum dcn_hubbub_page_table_depth page_table_depth;
+ uint64_t page_table_base_addr;
};
struct hubbub_addr_config {
@@ -105,18 +106,13 @@ struct hubbub_funcs {
struct dchub_init_data *dh_data);
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
- void (*init_dchub)(
+ int (*init_dchub_sys_ctx)(
struct hubbub *hubbub,
- struct hubbub_addr_config *config);
- void (*setup_vmid_ptb)(
+ struct dcn_hubbub_phys_addr_config *pa_config);
+ void (*init_vm_ctx)(
struct hubbub *hubbub,
- uint64_t ptb,
- uint8_t vmid);
-
- void (*set_ptb)(
- struct hubbub *hubbub,
- uint8_t vmid,
- uint64_t base_addr);
+ struct dcn_hubbub_virt_addr_config *va_config,
+ int vmid);
#endif
bool (*get_dcc_compression_cap)(struct hubbub *hubbub,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
index 342477822dc0..51bff8717cc9 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
@@ -83,8 +83,7 @@ struct hubp_funcs {
bool (*hubp_program_surface_flip_and_addr)(
struct hubp *hubp,
const struct dc_plane_address *address,
- bool flip_immediate,
- uint8_t vmid);
+ bool flip_immediate);
void (*hubp_program_pte_vm)(
struct hubp *hubp,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/vmid.h b/drivers/gpu/drm/amd/display/dc/inc/hw/vmid.h
index 037beb0a2a27..76de0e4284e0 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/vmid.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/vmid.h
@@ -44,6 +44,7 @@ struct dcn_vmid_page_table_config {
uint64_t page_table_end_addr;
enum dcn_hubbub_page_table_depth depth;
enum dcn_hubbub_page_table_block_size block_size;
+ uint64_t page_table_base_addr;
};
#endif /* DAL_DC_INC_HW_VMID_H_ */
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
index 13b113d0fe19..4ffe42c27c3e 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
@@ -75,7 +75,8 @@ struct resource_pool;
struct resource_context;
struct stream_resource;
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
-struct dc_addr_space_config;
+struct dc_phy_addr_space_config;
+struct dc_virtual_addr_space_config;
#endif
struct hw_sequencer_funcs {
@@ -132,11 +133,15 @@ struct hw_sequencer_funcs {
struct dchub_init_data *dh_data);
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
- void (*init_dchub)(
- struct dce_hwseq *hws,
- struct dc *dc,
- struct dc_addr_space_config *dh_data);
-
+ int (*init_sys_ctx)(
+ struct dce_hwseq *hws,
+ struct dc *dc,
+ struct dc_phy_addr_space_config *pa_config);
+ void (*init_vm_ctx)(
+ struct dce_hwseq *hws,
+ struct dc *dc,
+ struct dc_virtual_addr_space_config *va_config,
+ int vmid);
#endif
void (*update_mpcc)(
struct dc *dc,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/vm_helper.h b/drivers/gpu/drm/amd/display/dc/inc/vm_helper.h
index 193407f76a80..8bfcef0a3675 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/vm_helper.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/vm_helper.h
@@ -28,29 +28,21 @@
#include "dc_types.h"
-#define MAX_VMID 16
#define MAX_HUBP 6
struct vmid_usage {
- uint16_t vmid_usage[2];
+ int vmid_usage[2];
};
struct vm_helper {
unsigned int num_vmid;
- unsigned int num_hubp;
- unsigned int num_vmids_available;
- uint64_t ptb_assigned_to_vmid[MAX_VMID];
struct vmid_usage hubp_vmid_usage[MAX_HUBP];
};
-uint8_t get_vmid_for_ptb(
- struct vm_helper *vm_helper,
- int64_t ptb,
- uint8_t pipe_idx);
+void vm_helper_mark_vmid_used(struct vm_helper *vm_helper, unsigned int pos, uint8_t hubp_idx);
-void init_vm_helper(
+void vm_helper_init(
struct vm_helper *vm_helper,
- unsigned int num_vmid,
- unsigned int num_hubp);
+ unsigned int num_vmid);
#endif /* DC_INC_VM_HELPER_H_ */