Commit c3489214 authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher

drm/amd/display: dce 8 - 12 mem_input refactor to new style

Signed-off-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent aa7397df
...@@ -26,8 +26,10 @@ ...@@ -26,8 +26,10 @@
#define __DCE_MEM_INPUT_H__ #define __DCE_MEM_INPUT_H__
#include "dc_hw_types.h" #include "dc_hw_types.h"
struct dce_watermarks; #include "mem_input.h"
struct mem_input;
#define TO_DCE_MEM_INPUT(mem_input)\
container_of(mem_input, struct dce_mem_input, base)
#define MI_DCE_BASE_REG_LIST(id)\ #define MI_DCE_BASE_REG_LIST(id)\
SRI(GRPH_ENABLE, DCP, id),\ SRI(GRPH_ENABLE, DCP, id),\
...@@ -40,6 +42,12 @@ struct mem_input; ...@@ -40,6 +42,12 @@ struct mem_input;
SRI(HW_ROTATION, DCP, id),\ SRI(HW_ROTATION, DCP, id),\
SRI(GRPH_SWAP_CNTL, DCP, id),\ SRI(GRPH_SWAP_CNTL, DCP, id),\
SRI(PRESCALE_GRPH_CONTROL, DCP, id),\ SRI(PRESCALE_GRPH_CONTROL, DCP, id),\
SRI(GRPH_UPDATE, DCP, id),\
SRI(GRPH_FLIP_CONTROL, DCP, id),\
SRI(GRPH_PRIMARY_SURFACE_ADDRESS, DCP, id),\
SRI(GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, DCP, id),\
SRI(GRPH_SECONDARY_SURFACE_ADDRESS, DCP, id),\
SRI(GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, DCP, id),\
SRI(DPG_PIPE_ARBITRATION_CONTROL1, DMIF_PG, id),\ SRI(DPG_PIPE_ARBITRATION_CONTROL1, DMIF_PG, id),\
SRI(DPG_WATERMARK_MASK_CONTROL, DMIF_PG, id),\ SRI(DPG_WATERMARK_MASK_CONTROL, DMIF_PG, id),\
SRI(DPG_PIPE_URGENCY_CONTROL, DMIF_PG, id),\ SRI(DPG_PIPE_URGENCY_CONTROL, DMIF_PG, id),\
...@@ -67,7 +75,11 @@ struct mem_input; ...@@ -67,7 +75,11 @@ struct mem_input;
MI_DCE_PTE_REG_LIST(id),\ MI_DCE_PTE_REG_LIST(id),\
SRI(GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT, DCP, id),\ SRI(GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT, DCP, id),\
SRI(DPG_PIPE_STUTTER_CONTROL2, DMIF_PG, id),\ SRI(DPG_PIPE_STUTTER_CONTROL2, DMIF_PG, id),\
SRI(DPG_PIPE_LOW_POWER_CONTROL, DMIF_PG, id) SRI(DPG_PIPE_LOW_POWER_CONTROL, DMIF_PG, id),\
SR(DCHUB_FB_LOCATION),\
SR(DCHUB_AGP_BASE),\
SR(DCHUB_AGP_BOT),\
SR(DCHUB_AGP_TOP)
struct dce_mem_input_registers { struct dce_mem_input_registers {
/* DCP */ /* DCP */
...@@ -84,6 +96,12 @@ struct dce_mem_input_registers { ...@@ -84,6 +96,12 @@ struct dce_mem_input_registers {
uint32_t GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT; uint32_t GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT;
uint32_t DVMM_PTE_CONTROL; uint32_t DVMM_PTE_CONTROL;
uint32_t DVMM_PTE_ARB_CONTROL; uint32_t DVMM_PTE_ARB_CONTROL;
uint32_t GRPH_UPDATE;
uint32_t GRPH_FLIP_CONTROL;
uint32_t GRPH_PRIMARY_SURFACE_ADDRESS;
uint32_t GRPH_PRIMARY_SURFACE_ADDRESS_HIGH;
uint32_t GRPH_SECONDARY_SURFACE_ADDRESS;
uint32_t GRPH_SECONDARY_SURFACE_ADDRESS_HIGH;
/* DMIF_PG */ /* DMIF_PG */
uint32_t DPG_PIPE_ARBITRATION_CONTROL1; uint32_t DPG_PIPE_ARBITRATION_CONTROL1;
uint32_t DPG_WATERMARK_MASK_CONTROL; uint32_t DPG_WATERMARK_MASK_CONTROL;
...@@ -96,6 +114,11 @@ struct dce_mem_input_registers { ...@@ -96,6 +114,11 @@ struct dce_mem_input_registers {
uint32_t DMIF_BUFFER_CONTROL; uint32_t DMIF_BUFFER_CONTROL;
/* MC_HUB */ /* MC_HUB */
uint32_t MC_HUB_RDREQ_DMIF_LIMIT; uint32_t MC_HUB_RDREQ_DMIF_LIMIT;
/*DCHUB*/
uint32_t DCHUB_FB_LOCATION;
uint32_t DCHUB_AGP_BASE;
uint32_t DCHUB_AGP_BOT;
uint32_t DCHUB_AGP_TOP;
}; };
/* Set_Filed_for_Block */ /* Set_Filed_for_Block */
...@@ -129,9 +152,16 @@ struct dce_mem_input_registers { ...@@ -129,9 +152,16 @@ struct dce_mem_input_registers {
SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_SELECT, mask_sh),\ SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_SELECT, mask_sh),\
SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_R_SIGN, mask_sh),\ SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_R_SIGN, mask_sh),\
SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_G_SIGN, mask_sh),\ SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_G_SIGN, mask_sh),\
SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_B_SIGN, mask_sh) SFB(blk, PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_B_SIGN, mask_sh),\
SFB(blk, GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, mask_sh),\
SFB(blk, GRPH_SECONDARY_SURFACE_ADDRESS, GRPH_SECONDARY_SURFACE_ADDRESS, mask_sh),\
SFB(blk, GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, mask_sh),\
SFB(blk, GRPH_PRIMARY_SURFACE_ADDRESS, GRPH_PRIMARY_SURFACE_ADDRESS, mask_sh),\
SFB(blk, GRPH_UPDATE, GRPH_SURFACE_UPDATE_PENDING, mask_sh),\
SFB(blk, GRPH_FLIP_CONTROL, GRPH_SURFACE_UPDATE_H_RETRACE_EN, mask_sh)
#define MI_DCP_DCE11_MASK_SH_LIST(mask_sh, blk)\ #define MI_DCP_DCE11_MASK_SH_LIST(mask_sh, blk)\
SFB(blk, GRPH_FLIP_CONTROL, GRPH_SURFACE_UPDATE_IMMEDIATE_EN, mask_sh),\
SFB(blk, GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT, GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT, mask_sh) SFB(blk, GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT, GRPH_PIPE_OUTSTANDING_REQUEST_LIMIT, mask_sh)
#define MI_DCP_PTE_MASK_SH_LIST(mask_sh, blk)\ #define MI_DCP_PTE_MASK_SH_LIST(mask_sh, blk)\
...@@ -189,13 +219,22 @@ struct dce_mem_input_registers { ...@@ -189,13 +219,22 @@ struct dce_mem_input_registers {
SFB(blk, DPG_PIPE_LOW_POWER_CONTROL, PSTATE_CHANGE_NOT_SELF_REFRESH_DURING_REQUEST, mask_sh),\ SFB(blk, DPG_PIPE_LOW_POWER_CONTROL, PSTATE_CHANGE_NOT_SELF_REFRESH_DURING_REQUEST, mask_sh),\
SFB(blk, DPG_PIPE_LOW_POWER_CONTROL, PSTATE_CHANGE_WATERMARK, mask_sh) SFB(blk, DPG_PIPE_LOW_POWER_CONTROL, PSTATE_CHANGE_WATERMARK, mask_sh)
#define MI_GFX9_DCHUB_MASK_SH_LIST(mask_sh)\
SF(DCHUB_FB_LOCATION, FB_TOP, mask_sh),\
SF(DCHUB_FB_LOCATION, FB_BASE, mask_sh),\
SF(DCHUB_AGP_BASE, AGP_BASE, mask_sh),\
SF(DCHUB_AGP_BOT, AGP_BOT, mask_sh),\
SF(DCHUB_AGP_TOP, AGP_TOP, mask_sh)
#define MI_DCE12_MASK_SH_LIST(mask_sh)\ #define MI_DCE12_MASK_SH_LIST(mask_sh)\
MI_DCP_MASK_SH_LIST(mask_sh, DCP0_),\ MI_DCP_MASK_SH_LIST(mask_sh, DCP0_),\
SF(DCP0_GRPH_SECONDARY_SURFACE_ADDRESS, GRPH_SECONDARY_DFQ_ENABLE, mask_sh),\
MI_DCP_DCE11_MASK_SH_LIST(mask_sh, DCP0_),\ MI_DCP_DCE11_MASK_SH_LIST(mask_sh, DCP0_),\
MI_DCP_PTE_MASK_SH_LIST(mask_sh, DCP0_),\ MI_DCP_PTE_MASK_SH_LIST(mask_sh, DCP0_),\
MI_DMIF_PG_MASK_SH_LIST(mask_sh, DMIF_PG0_),\ MI_DMIF_PG_MASK_SH_LIST(mask_sh, DMIF_PG0_),\
MI_DCE12_DMIF_PG_MASK_SH_LIST(mask_sh, DMIF_PG0_),\ MI_DCE12_DMIF_PG_MASK_SH_LIST(mask_sh, DMIF_PG0_),\
MI_GFX9_TILE_MASK_SH_LIST(mask_sh, DCP0_) MI_GFX9_TILE_MASK_SH_LIST(mask_sh, DCP0_),\
MI_GFX9_DCHUB_MASK_SH_LIST(mask_sh)
#define MI_REG_FIELD_LIST(type) \ #define MI_REG_FIELD_LIST(type) \
type GRPH_ENABLE; \ type GRPH_ENABLE; \
...@@ -232,6 +271,15 @@ struct dce_mem_input_registers { ...@@ -232,6 +271,15 @@ struct dce_mem_input_registers {
type GRPH_SE_ENABLE; \ type GRPH_SE_ENABLE; \
type GRPH_NUM_SHADER_ENGINES; \ type GRPH_NUM_SHADER_ENGINES; \
type GRPH_NUM_PIPES; \ type GRPH_NUM_PIPES; \
type GRPH_SECONDARY_SURFACE_ADDRESS_HIGH; \
type GRPH_SECONDARY_SURFACE_ADDRESS; \
type GRPH_SECONDARY_DFQ_ENABLE; \
type GRPH_PRIMARY_SURFACE_ADDRESS_HIGH; \
type GRPH_PRIMARY_SURFACE_ADDRESS; \
type GRPH_SURFACE_UPDATE_PENDING; \
type GRPH_SURFACE_UPDATE_IMMEDIATE_EN; \
type GRPH_SURFACE_UPDATE_H_RETRACE_EN; \
type GRPH_UPDATE_LOCK; \
type PIXEL_DURATION; \ type PIXEL_DURATION; \
type URGENCY_WATERMARK_MASK; \ type URGENCY_WATERMARK_MASK; \
type PSTATE_CHANGE_WATERMARK_MASK; \ type PSTATE_CHANGE_WATERMARK_MASK; \
...@@ -253,6 +301,11 @@ struct dce_mem_input_registers { ...@@ -253,6 +301,11 @@ struct dce_mem_input_registers {
type DMIF_BUFFERS_ALLOCATED; \ type DMIF_BUFFERS_ALLOCATED; \
type DMIF_BUFFERS_ALLOCATION_COMPLETED; \ type DMIF_BUFFERS_ALLOCATION_COMPLETED; \
type ENABLE; /* MC_HUB_RDREQ_DMIF_LIMIT */\ type ENABLE; /* MC_HUB_RDREQ_DMIF_LIMIT */\
type FB_BASE; \
type FB_TOP; \
type AGP_BASE; \
type AGP_TOP; \
type AGP_BOT; \
struct dce_mem_input_shift { struct dce_mem_input_shift {
MI_REG_FIELD_LIST(uint8_t) MI_REG_FIELD_LIST(uint8_t)
...@@ -266,32 +319,30 @@ struct dce_mem_input_wa { ...@@ -266,32 +319,30 @@ struct dce_mem_input_wa {
uint8_t single_head_rdreq_dmif_limit; uint8_t single_head_rdreq_dmif_limit;
}; };
void dce_mem_input_program_pte_vm(struct mem_input *mi, struct dce_mem_input {
enum surface_pixel_format format, struct mem_input base;
union dc_tiling_info *tiling_info,
enum dc_rotation_angle rotation); const struct dce_mem_input_registers *regs;
const struct dce_mem_input_shift *shifts;
void dce_mem_input_program_surface_config(struct mem_input *mi, const struct dce_mem_input_mask *masks;
enum surface_pixel_format format,
union dc_tiling_info *tiling_info, struct dce_mem_input_wa wa;
union plane_size *plane_size, };
enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc, void dce_mem_input_construct(
bool horizontal_mirror); struct dce_mem_input *dce_mi,
struct dc_context *ctx,
void dce_mem_input_allocate_dmif(struct mem_input *mi, int inst,
uint32_t h_total, const struct dce_mem_input_registers *regs,
uint32_t v_total, const struct dce_mem_input_shift *mi_shift,
uint32_t pix_clk_khz, const struct dce_mem_input_mask *mi_mask);
uint32_t total_stream_num);
void dce112_mem_input_construct(
void dce_mem_input_free_dmif(struct mem_input *mi, struct dce_mem_input *dce_mi,
uint32_t total_stream_num); struct dc_context *ctx,
int inst,
void dce_mem_input_program_display_marks(struct mem_input *mi, const struct dce_mem_input_registers *regs,
struct dce_watermarks nbp, const struct dce_mem_input_shift *mi_shift,
struct dce_watermarks stutter, const struct dce_mem_input_mask *mi_mask);
struct dce_watermarks urgent,
uint32_t total_dest_line_time_ns);
#endif /*__DCE_MEM_INPUT_H__*/ #endif /*__DCE_MEM_INPUT_H__*/
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
#include "irq/dce110/irq_service_dce110.h" #include "irq/dce110/irq_service_dce110.h"
#include "dce/dce_link_encoder.h" #include "dce/dce_link_encoder.h"
#include "dce/dce_stream_encoder.h" #include "dce/dce_stream_encoder.h"
#include "dce110/dce110_mem_input.h"
#include "dce110/dce110_mem_input_v.h" #include "dce/dce_mem_input.h"
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_transform.h" #include "dce/dce_transform.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
...@@ -123,51 +123,6 @@ static const struct dce110_timing_generator_offsets dce100_tg_offsets[] = { ...@@ -123,51 +123,6 @@ static const struct dce110_timing_generator_offsets dce100_tg_offsets[] = {
} }
}; };
static const struct dce110_mem_input_reg_offsets dce100_mi_reg_offsets[] = {
{
.dcp = (mmDCP0_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE0_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP1_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG1_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE1_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP2_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG2_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE2_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP3_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG3_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE3_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP4_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG4_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE4_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP5_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG5_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE5_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
}
};
/* set register offset */ /* set register offset */
#define SR(reg_name)\ #define SR(reg_name)\
.reg_name = mm ## reg_name .reg_name = mm ## reg_name
...@@ -510,28 +465,18 @@ static const struct dce_mem_input_mask mi_masks = { ...@@ -510,28 +465,18 @@ static const struct dce_mem_input_mask mi_masks = {
static struct mem_input *dce100_mem_input_create( static struct mem_input *dce100_mem_input_create(
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst)
const struct dce110_mem_input_reg_offsets *offset)
{ {
struct dce110_mem_input *mem_input110 = struct dce_mem_input *dce_mi = dm_alloc(sizeof(struct dce_mem_input));
dm_alloc(sizeof(struct dce110_mem_input));
if (!mem_input110) if (!dce_mi) {
BREAK_TO_DEBUGGER();
return NULL; return NULL;
if (dce110_mem_input_construct(mem_input110, ctx, inst, offset)) {
struct mem_input *mi = &mem_input110->base;
mi->regs = &mi_regs[inst];
mi->shifts = &mi_shifts;
mi->masks = &mi_masks;
mi->wa.single_head_rdreq_dmif_limit = 2;
return mi;
} }
BREAK_TO_DEBUGGER(); dce_mem_input_construct(dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks);
dm_free(mem_input110); dce_mi->wa.single_head_rdreq_dmif_limit = 2;
return NULL; return &dce_mi->base;
} }
static void dce100_transform_destroy(struct transform **xfm) static void dce100_transform_destroy(struct transform **xfm)
...@@ -671,7 +616,7 @@ static void destruct(struct dce110_resource_pool *pool) ...@@ -671,7 +616,7 @@ static void destruct(struct dce110_resource_pool *pool)
dce_ipp_destroy(&pool->base.ipps[i]); dce_ipp_destroy(&pool->base.ipps[i]);
if (pool->base.mis[i] != NULL) { if (pool->base.mis[i] != NULL) {
dm_free(TO_DCE110_MEM_INPUT(pool->base.mis[i])); dm_free(TO_DCE_MEM_INPUT(pool->base.mis[i]));
pool->base.mis[i] = NULL; pool->base.mis[i] = NULL;
} }
...@@ -986,8 +931,7 @@ static bool construct( ...@@ -986,8 +931,7 @@ static bool construct(
goto res_create_fail; goto res_create_fail;
} }
pool->base.mis[i] = dce100_mem_input_create(ctx, i, pool->base.mis[i] = dce100_mem_input_create(ctx, i);
&dce100_mi_reg_offsets[i]);
if (pool->base.mis[i] == NULL) { if (pool->base.mis[i] == NULL) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
dm_error( dm_error(
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
# It provides the control and status of HW CRTC block. # It provides the control and status of HW CRTC block.
DCE110 = dce110_timing_generator.o \ DCE110 = dce110_timing_generator.o \
dce110_compressor.o dce110_mem_input.o dce110_hw_sequencer.o \ dce110_compressor.o dce110_hw_sequencer.o dce110_resource.o \
dce110_resource.o \
dce110_opp_regamma_v.o dce110_opp_csc_v.o dce110_timing_generator_v.o \ dce110_opp_regamma_v.o dce110_opp_csc_v.o dce110_timing_generator_v.o \
dce110_mem_input_v.o dce110_opp_v.o dce110_transform_v.o dce110_mem_input_v.o dce110_opp_v.o dce110_transform_v.o
......
/* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DC_MEM_INPUT_DCE110_H__
#define __DC_MEM_INPUT_DCE110_H__
#include "mem_input.h"
#define TO_DCE110_MEM_INPUT(mi)\
container_of(mi, struct dce110_mem_input, base)
struct dce110_mem_input_reg_offsets {
uint32_t dcp;
uint32_t dmif;
uint32_t pipe;
};
struct dce110_mem_input {
struct mem_input base;
struct dce110_mem_input_reg_offsets offsets;
};
bool dce110_mem_input_construct(
struct dce110_mem_input *mem_input110,
struct dc_context *ctx,
uint32_t inst,
const struct dce110_mem_input_reg_offsets *offsets);
/*
* dce110_mem_input_program_display_marks
*
* This function will program nbp stutter and urgency watermarks to minimum
* allowable values
*/
void dce110_mem_input_program_display_marks(
struct mem_input *mem_input,
struct dce_watermarks nbp,
struct dce_watermarks stutter,
struct dce_watermarks urgent,
uint32_t total_dest_line_time_ns);
/*
* dce110_allocate_mem_input
*
* This function will allocate a dmif buffer and program required
* pixel duration for pipe
*/
void dce110_allocate_mem_input(
struct mem_input *mem_input,
uint32_t h_total,/* for current stream */
uint32_t v_total,/* for current stream */
uint32_t pix_clk_khz,/* for current stream */
uint32_t total_stream_num);
/*
* dce110_free_mem_input
*
* This function will deallocate a dmif buffer from pipe
*/
void dce110_free_mem_input(
struct mem_input *mem_input,
uint32_t total_stream_num);
/*
* dce110_mem_input_program_surface_flip_and_addr
*
* This function programs hsync/vsync mode and surface address
*/
bool dce110_mem_input_program_surface_flip_and_addr(
struct mem_input *mem_input,
const struct dc_plane_address *address,
bool flip_immediate);
/*
* dce110_mem_input_program_surface_config
*
* This function will program surface tiling, size, rotation and pixel format
* to corresponding dcp registers.
*/
bool dce110_mem_input_program_surface_config(
struct mem_input *mem_input,
enum surface_pixel_format format,
union dc_tiling_info *tiling_info,
union plane_size *plane_size,
enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc,
bool horizontal_mirror,
bool visible);
/*
* dce110_mem_input_is_flip_pending
*
* This function will wait until the surface update-pending bit is cleared.
* This is necessary when a flip immediate call is requested as we shouldn't
* return until the flip has actually occurred.
*/
bool dce110_mem_input_is_flip_pending(
struct mem_input *mem_input);
#endif
...@@ -26,70 +26,10 @@ ...@@ -26,70 +26,10 @@
#define __DC_MEM_INPUT_V_DCE110_H__ #define __DC_MEM_INPUT_V_DCE110_H__
#include "mem_input.h" #include "mem_input.h"
#include "dce110_mem_input.h" #include "dce/dce_mem_input.h"
bool dce110_mem_input_v_construct( void dce110_mem_input_v_construct(
struct dce110_mem_input *mem_input110, struct dce_mem_input *dce_mi,
struct dc_context *ctx); struct dc_context *ctx);
/*
* This function will program nbp stutter and urgency watermarks to minimum
* allowable values
*/
void dce110_mem_input_v_program_display_marks(
struct mem_input *mem_input,
struct dce_watermarks nbp,
struct dce_watermarks stutter,
struct dce_watermarks urgent,
uint32_t total_dest_line_time_ns);
/*
* This function will allocate a dmif buffer and program required
* pixel duration for pipe
*/
void dce110_allocate_mem_v_input(
struct mem_input *mem_input,
uint32_t h_total,/* for current stream */
uint32_t v_total,/* for current stream */
uint32_t pix_clk_khz,/* for current stream */
uint32_t total_stream_num);
/*
* This function will deallocate a dmif buffer from pipe
*/
void dce110_free_mem_v_input(
struct mem_input *mem_input,
uint32_t total_stream_num);
/*
* This function programs hsync/vsync mode and surface address
*/
bool dce110_mem_input_v_program_surface_flip_and_addr(
struct mem_input *mem_input,
const struct dc_plane_address *address,
bool flip_immediate);
/*
* dce110_mem_input_v_program_scatter_gather
*
* This function will program scatter gather registers.
*/
bool dce110_mem_input_v_program_pte_vm(
struct mem_input *mem_input,
enum surface_pixel_format format,
union dc_tiling_info *tiling_info,
enum dc_rotation_angle rotation);
/*
* This function will program surface tiling, size, rotation and pixel format
* to corresponding dcp registers.
*/
bool dce110_mem_input_v_program_surface_config(
struct mem_input *mem_input,
enum surface_pixel_format format,
union dc_tiling_info *tiling_info,
union plane_size *plane_size,
enum dc_rotation_angle rotation,
bool visible);
#endif #endif
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "dce110/dce110_timing_generator_v.h" #include "dce110/dce110_timing_generator_v.h"
#include "dce/dce_link_encoder.h" #include "dce/dce_link_encoder.h"
#include "dce/dce_stream_encoder.h" #include "dce/dce_stream_encoder.h"
#include "dce110/dce110_mem_input.h" #include "dce/dce_mem_input.h"
#include "dce110/dce110_mem_input_v.h" #include "dce110/dce110_mem_input_v.h"
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_transform.h" #include "dce/dce_transform.h"
...@@ -133,30 +133,6 @@ static const struct dce110_timing_generator_offsets dce110_tg_offsets[] = { ...@@ -133,30 +133,6 @@ static const struct dce110_timing_generator_offsets dce110_tg_offsets[] = {
} }
}; };
static const struct dce110_mem_input_reg_offsets dce110_mi_reg_offsets[] = {
{
.dcp = (mmDCP0_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE0_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP1_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG1_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE1_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP2_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG2_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE2_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
}
};
/* set register offset */ /* set register offset */
#define SR(reg_name)\ #define SR(reg_name)\
.reg_name = mm ## reg_name .reg_name = mm ## reg_name
...@@ -520,30 +496,21 @@ static const struct dce_mem_input_mask mi_masks = { ...@@ -520,30 +496,21 @@ static const struct dce_mem_input_mask mi_masks = {
.ENABLE = MC_HUB_RDREQ_DMIF_LIMIT__ENABLE_MASK .ENABLE = MC_HUB_RDREQ_DMIF_LIMIT__ENABLE_MASK
}; };
static struct mem_input *dce110_mem_input_create( static struct mem_input *dce110_mem_input_create(
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst)
const struct dce110_mem_input_reg_offsets *offset)
{ {
struct dce110_mem_input *mem_input110 = struct dce_mem_input *dce_mi = dm_alloc(sizeof(struct dce_mem_input));
dm_alloc(sizeof(struct dce110_mem_input));
if (!mem_input110) if (!dce_mi) {
BREAK_TO_DEBUGGER();
return NULL; return NULL;
if (dce110_mem_input_construct(mem_input110, ctx, inst, offset)) {
struct mem_input *mi = &mem_input110->base;
mi->regs = &mi_regs[inst];
mi->shifts = &mi_shifts;
mi->masks = &mi_masks;
mi->wa.single_head_rdreq_dmif_limit = 3;
return mi;
} }
BREAK_TO_DEBUGGER(); dce_mem_input_construct(dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks);
dm_free(mem_input110); dce_mi->wa.single_head_rdreq_dmif_limit = 3;
return NULL; return &dce_mi->base;
} }
static void dce110_transform_destroy(struct transform **xfm) static void dce110_transform_destroy(struct transform **xfm)
...@@ -698,7 +665,7 @@ static void destruct(struct dce110_resource_pool *pool) ...@@ -698,7 +665,7 @@ static void destruct(struct dce110_resource_pool *pool)
dce_ipp_destroy(&pool->base.ipps[i]); dce_ipp_destroy(&pool->base.ipps[i]);
if (pool->base.mis[i] != NULL) { if (pool->base.mis[i] != NULL) {
dm_free(TO_DCE110_MEM_INPUT(pool->base.mis[i])); dm_free(TO_DCE_MEM_INPUT(pool->base.mis[i]));
pool->base.mis[i] = NULL; pool->base.mis[i] = NULL;
} }
...@@ -1132,7 +1099,7 @@ static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool) ...@@ -1132,7 +1099,7 @@ static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool)
{ {
struct dce110_timing_generator *dce110_tgv = dm_alloc(sizeof (*dce110_tgv)); struct dce110_timing_generator *dce110_tgv = dm_alloc(sizeof (*dce110_tgv));
struct dce_transform *dce110_xfmv = dm_alloc(sizeof (*dce110_xfmv)); struct dce_transform *dce110_xfmv = dm_alloc(sizeof (*dce110_xfmv));
struct dce110_mem_input *dce110_miv = dm_alloc(sizeof (*dce110_miv)); struct dce_mem_input *dce110_miv = dm_alloc(sizeof (*dce110_miv));
struct dce110_opp *dce110_oppv = dm_alloc(sizeof (*dce110_oppv)); struct dce110_opp *dce110_oppv = dm_alloc(sizeof (*dce110_oppv));
if ((dce110_tgv == NULL) || if ((dce110_tgv == NULL) ||
...@@ -1345,8 +1312,7 @@ static bool construct( ...@@ -1345,8 +1312,7 @@ static bool construct(
goto res_create_fail; goto res_create_fail;
} }
pool->base.mis[i] = dce110_mem_input_create(ctx, i, pool->base.mis[i] = dce110_mem_input_create(ctx, i);
&dce110_mi_reg_offsets[i]);
if (pool->base.mis[i] == NULL) { if (pool->base.mis[i] == NULL) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
dm_error( dm_error(
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# It provides the control and status of HW CRTC block. # It provides the control and status of HW CRTC block.
DCE112 = dce112_compressor.o dce112_hw_sequencer.o \ DCE112 = dce112_compressor.o dce112_hw_sequencer.o \
dce112_resource.o dce112_mem_input.o dce112_resource.o
AMD_DAL_DCE112 = $(addprefix $(AMDDALPATH)/dc/dce112/,$(DCE112)) AMD_DAL_DCE112 = $(addprefix $(AMDDALPATH)/dc/dce112/,$(DCE112))
......
/*
* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include "dm_services.h"
#include "dce112_mem_input.h"
#include "dce/dce_11_2_d.h"
#include "dce/dce_11_2_sh_mask.h"
#define DCP_REG(reg) (reg + mem_input110->offsets.dcp)
#define DMIF_REG(reg) (reg + mem_input110->offsets.dmif)
#define PIPE_REG(reg) (reg + mem_input110->offsets.pipe)
/*****************************************/
/* Constructor, Destructor */
/*****************************************/
bool dce112_mem_input_construct(
struct dce110_mem_input *mem_input110,
struct dc_context *ctx,
uint32_t inst,
const struct dce110_mem_input_reg_offsets *offsets)
{
if (!dce110_mem_input_construct(mem_input110, ctx, inst, offsets))
return false;
mem_input110->base.funcs->mem_input_program_display_marks =
dce_mem_input_program_display_marks;
return true;
}
/* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DC_MEM_INPUT_DCE112_H__
#define __DC_MEM_INPUT_DCE112_H__
#include "mem_input.h"
#include "dce110/dce110_mem_input.h"
bool dce112_mem_input_construct(
struct dce110_mem_input *mem_input110,
struct dc_context *ctx,
uint32_t inst,
const struct dce110_mem_input_reg_offsets *offsets);
#endif
...@@ -32,9 +32,10 @@ ...@@ -32,9 +32,10 @@
#include "include/irq_service_interface.h" #include "include/irq_service_interface.h"
#include "dce110/dce110_resource.h" #include "dce110/dce110_resource.h"
#include "dce110/dce110_timing_generator.h" #include "dce110/dce110_timing_generator.h"
#include "dce112/dce112_mem_input.h"
#include "irq/dce110/irq_service_dce110.h" #include "irq/dce110/irq_service_dce110.h"
#include "dce/dce_mem_input.h"
#include "dce/dce_transform.h" #include "dce/dce_transform.h"
#include "dce/dce_link_encoder.h" #include "dce/dce_link_encoder.h"
#include "dce/dce_stream_encoder.h" #include "dce/dce_stream_encoder.h"
...@@ -132,51 +133,6 @@ static const struct dce110_timing_generator_offsets dce112_tg_offsets[] = { ...@@ -132,51 +133,6 @@ static const struct dce110_timing_generator_offsets dce112_tg_offsets[] = {
} }
}; };
static const struct dce110_mem_input_reg_offsets dce112_mi_reg_offsets[] = {
{
.dcp = (mmDCP0_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE0_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP1_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG1_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE1_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP2_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG2_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE2_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP3_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG3_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE3_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP4_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG4_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE4_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP5_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG5_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE5_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
}
};
/* set register offset */ /* set register offset */
#define SR(reg_name)\ #define SR(reg_name)\
.reg_name = mm ## reg_name .reg_name = mm ## reg_name
...@@ -541,27 +497,17 @@ static const struct dce_mem_input_mask mi_masks = { ...@@ -541,27 +497,17 @@ static const struct dce_mem_input_mask mi_masks = {
static struct mem_input *dce112_mem_input_create( static struct mem_input *dce112_mem_input_create(
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst)
const struct dce110_mem_input_reg_offsets *offset)
{ {
struct dce110_mem_input *mem_input110 = struct dce_mem_input *dce_mi = dm_alloc(sizeof(struct dce_mem_input));
dm_alloc(sizeof(struct dce110_mem_input));
if (!mem_input110) if (!dce_mi) {
BREAK_TO_DEBUGGER();
return NULL; return NULL;
if (dce112_mem_input_construct(mem_input110, ctx, inst, offset)) {
struct mem_input *mi = &mem_input110->base;
mi->regs = &mi_regs[inst];
mi->shifts = &mi_shifts;
mi->masks = &mi_masks;
return mi;
} }
BREAK_TO_DEBUGGER(); dce112_mem_input_construct(dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks);
dm_free(mem_input110); return &dce_mi->base;
return NULL;
} }
static void dce112_transform_destroy(struct transform **xfm) static void dce112_transform_destroy(struct transform **xfm)
...@@ -705,7 +651,7 @@ static void destruct(struct dce110_resource_pool *pool) ...@@ -705,7 +651,7 @@ static void destruct(struct dce110_resource_pool *pool)
dce_ipp_destroy(&pool->base.ipps[i]); dce_ipp_destroy(&pool->base.ipps[i]);
if (pool->base.mis[i] != NULL) { if (pool->base.mis[i] != NULL) {
dm_free(TO_DCE110_MEM_INPUT(pool->base.mis[i])); dm_free(TO_DCE_MEM_INPUT(pool->base.mis[i]));
pool->base.mis[i] = NULL; pool->base.mis[i] = NULL;
} }
...@@ -1347,10 +1293,7 @@ static bool construct( ...@@ -1347,10 +1293,7 @@ static bool construct(
goto res_create_fail; goto res_create_fail;
} }
pool->base.mis[i] = dce112_mem_input_create( pool->base.mis[i] = dce112_mem_input_create(ctx, i);
ctx,
i,
&dce112_mi_reg_offsets[i]);
if (pool->base.mis[i] == NULL) { if (pool->base.mis[i] == NULL) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
dm_error( dm_error(
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
DCE120 = dce120_resource.o dce120_timing_generator.o \ DCE120 = dce120_resource.o dce120_timing_generator.o \
dce120_mem_input.o dce120_hw_sequencer.o dce120_hw_sequencer.o
AMD_DAL_DCE120 = $(addprefix $(AMDDALPATH)/dc/dce120/,$(DCE120)) AMD_DAL_DCE120 = $(addprefix $(AMDDALPATH)/dc/dce120/,$(DCE120))
......
/* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DC_MEM_INPUT_DCE120_H__
#define __DC_MEM_INPUT_DCE120_H__
#include "mem_input.h"
#include "dce110/dce110_mem_input.h"
bool dce120_mem_input_construct(
struct dce110_mem_input *mem_input110,
struct dc_context *ctx,
uint32_t inst,
const struct dce110_mem_input_reg_offsets *offsets);
#endif
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_clocks.h" #include "dce/dce_clocks.h"
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce110/dce110_mem_input.h" #include "dce/dce_mem_input.h"
#include "dce120/dce120_mem_input.h"
#include "dce110/dce110_hw_sequencer.h" #include "dce110/dce110_hw_sequencer.h"
#include "dce120/dce120_hw_sequencer.h" #include "dce120/dce120_hw_sequencer.h"
...@@ -376,51 +375,6 @@ struct output_pixel_processor *dce120_opp_create( ...@@ -376,51 +375,6 @@ struct output_pixel_processor *dce120_opp_create(
return NULL; return NULL;
} }
static const struct dce110_mem_input_reg_offsets dce120_mi_reg_offsets[] = {
{
.dcp = (mmDCP0_GRPH_CONTROL - mmDCP0_GRPH_CONTROL),
.dmif = (mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL
- mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE0_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP1_GRPH_CONTROL - mmDCP0_GRPH_CONTROL),
.dmif = (mmDMIF_PG1_DPG_WATERMARK_MASK_CONTROL
- mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE1_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP2_GRPH_CONTROL - mmDCP0_GRPH_CONTROL),
.dmif = (mmDMIF_PG2_DPG_WATERMARK_MASK_CONTROL
- mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE2_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP3_GRPH_CONTROL - mmDCP0_GRPH_CONTROL),
.dmif = (mmDMIF_PG3_DPG_WATERMARK_MASK_CONTROL
- mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE3_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP4_GRPH_CONTROL - mmDCP0_GRPH_CONTROL),
.dmif = (mmDMIF_PG4_DPG_WATERMARK_MASK_CONTROL
- mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE4_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP5_GRPH_CONTROL - mmDCP0_GRPH_CONTROL),
.dmif = (mmDMIF_PG5_DPG_WATERMARK_MASK_CONTROL
- mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE5_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
}
};
static const struct bios_registers bios_regs = { static const struct bios_registers bios_regs = {
.BIOS_SCRATCH_6 = mmBIOS_SCRATCH_6 + NBIO_BASE(mmBIOS_SCRATCH_6_BASE_IDX) .BIOS_SCRATCH_6 = mmBIOS_SCRATCH_6 + NBIO_BASE(mmBIOS_SCRATCH_6_BASE_IDX)
}; };
...@@ -518,7 +472,7 @@ static void destruct(struct dce110_resource_pool *pool) ...@@ -518,7 +472,7 @@ static void destruct(struct dce110_resource_pool *pool)
dce_ipp_destroy(&pool->base.ipps[i]); dce_ipp_destroy(&pool->base.ipps[i]);
if (pool->base.mis[i] != NULL) { if (pool->base.mis[i] != NULL) {
dm_free(TO_DCE110_MEM_INPUT(pool->base.mis[i])); dm_free(TO_DCE_MEM_INPUT(pool->base.mis[i]));
pool->base.mis[i] = NULL; pool->base.mis[i] = NULL;
} }
...@@ -708,27 +662,17 @@ static const struct dce_mem_input_mask mi_masks = { ...@@ -708,27 +662,17 @@ static const struct dce_mem_input_mask mi_masks = {
static struct mem_input *dce120_mem_input_create( static struct mem_input *dce120_mem_input_create(
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst)
const struct dce110_mem_input_reg_offsets *offset)
{ {
struct dce110_mem_input *mem_input110 = struct dce_mem_input *dce_mi = dm_alloc(sizeof(struct dce_mem_input));
dm_alloc(sizeof(struct dce110_mem_input));
if (!mem_input110) if (!dce_mi) {
BREAK_TO_DEBUGGER();
return NULL; return NULL;
if (dce120_mem_input_construct(mem_input110, ctx, inst, offset)) {
struct mem_input *mi = &mem_input110->base;
mi->regs = &mi_regs[inst];
mi->shifts = &mi_shifts;
mi->masks = &mi_masks;
return mi;
} }
BREAK_TO_DEBUGGER(); dce112_mem_input_construct(dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks);
dm_free(mem_input110); return &dce_mi->base;
return NULL;
} }
static struct transform *dce120_transform_create( static struct transform *dce120_transform_create(
...@@ -1007,8 +951,7 @@ static bool construct( ...@@ -1007,8 +951,7 @@ static bool construct(
goto controller_create_fail; goto controller_create_fail;
} }
pool->base.mis[i] = dce120_mem_input_create(ctx, pool->base.mis[i] = dce120_mem_input_create(ctx, i);
i, &dce120_mi_reg_offsets[i]);
if (pool->base.mis[i] == NULL) { if (pool->base.mis[i] == NULL) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
# Makefile for the 'controller' sub-component of DAL. # Makefile for the 'controller' sub-component of DAL.
# It provides the control and status of HW CRTC block. # It provides the control and status of HW CRTC block.
DCE80 = dce80_timing_generator.o \ DCE80 = dce80_timing_generator.o dce80_compressor.o dce80_hw_sequencer.o \
dce80_compressor.o dce80_mem_input.o dce80_hw_sequencer.o \
dce80_resource.o dce80_resource.o
AMD_DAL_DCE80 = $(addprefix $(AMDDALPATH)/dc/dce80/,$(DCE80)) AMD_DAL_DCE80 = $(addprefix $(AMDDALPATH)/dc/dce80/,$(DCE80))
......
/*
* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include "dm_services.h"
#include "dce/dce_8_0_d.h"
#include "dce/dce_8_0_sh_mask.h"
/* TODO: this needs to be looked at, used by Stella's workaround*/
#include "gmc/gmc_7_1_d.h"
#include "gmc/gmc_7_1_sh_mask.h"
#include "include/logger_interface.h"
#include "inc/dce_calcs.h"
#include "../dce110/dce110_mem_input.h"
#include "dce80_mem_input.h"
#define MAX_WATERMARK 0xFFFF
#define SAFE_NBP_MARK 0x7FFF
#define DCP_REG(reg) (reg + mem_input80->offsets.dcp)
#define DMIF_REG(reg) (reg + mem_input80->offsets.dmif)
#define PIPE_REG(reg) (reg + mem_input80->offsets.pipe)
static struct mem_input_funcs dce80_mem_input_funcs = {
.mem_input_program_display_marks =
dce110_mem_input_program_display_marks,
.allocate_mem_input = dce_mem_input_allocate_dmif,
.free_mem_input = dce_mem_input_free_dmif,
.mem_input_program_surface_flip_and_addr =
dce110_mem_input_program_surface_flip_and_addr,
.mem_input_program_surface_config =
dce_mem_input_program_surface_config,
.mem_input_is_flip_pending =
dce110_mem_input_is_flip_pending,
.mem_input_update_dchub = NULL
};
/*****************************************/
/* Constructor, Destructor */
/*****************************************/
bool dce80_mem_input_construct(
struct dce110_mem_input *mem_input80,
struct dc_context *ctx,
uint32_t inst,
const struct dce110_mem_input_reg_offsets *offsets)
{
/* supported stutter method
* STUTTER_MODE_ENHANCED
* STUTTER_MODE_QUAD_DMIF_BUFFER
*/
mem_input80->base.funcs = &dce80_mem_input_funcs;
mem_input80->base.ctx = ctx;
mem_input80->base.inst = inst;
mem_input80->offsets = *offsets;
return true;
}
/* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DC_MEM_INPUT_DCE80_H__
#define __DC_MEM_INPUT_DCE80_H__
#include "mem_input.h"
bool dce80_mem_input_construct(
struct dce110_mem_input *mem_input80,
struct dc_context *ctx,
uint32_t inst,
const struct dce110_mem_input_reg_offsets *offsets);
#endif
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
#include "include/irq_service_interface.h" #include "include/irq_service_interface.h"
#include "irq/dce80/irq_service_dce80.h" #include "irq/dce80/irq_service_dce80.h"
#include "dce110/dce110_timing_generator.h" #include "dce110/dce110_timing_generator.h"
#include "dce110/dce110_mem_input.h"
#include "dce110/dce110_resource.h" #include "dce110/dce110_resource.h"
#include "dce80/dce80_timing_generator.h" #include "dce80/dce80_timing_generator.h"
#include "dce/dce_mem_input.h"
#include "dce/dce_link_encoder.h" #include "dce/dce_link_encoder.h"
#include "dce/dce_stream_encoder.h" #include "dce/dce_stream_encoder.h"
#include "dce80/dce80_mem_input.h" #include "dce/dce_mem_input.h"
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_transform.h" #include "dce/dce_transform.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
...@@ -141,51 +141,6 @@ static const struct dce110_timing_generator_offsets dce80_tg_offsets[] = { ...@@ -141,51 +141,6 @@ static const struct dce110_timing_generator_offsets dce80_tg_offsets[] = {
} }
}; };
static const struct dce110_mem_input_reg_offsets dce80_mi_reg_offsets[] = {
{
.dcp = (mmGRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG0_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE0_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP1_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG1_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE1_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP2_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG2_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE2_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP3_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG3_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE3_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP4_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG4_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE4_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
},
{
.dcp = (mmDCP5_GRPH_CONTROL - mmGRPH_CONTROL),
.dmif = (mmDMIF_PG5_DPG_WATERMARK_MASK_CONTROL
- mmDPG_WATERMARK_MASK_CONTROL),
.pipe = (mmPIPE5_DMIF_BUFFER_CONTROL
- mmPIPE0_DMIF_BUFFER_CONTROL),
}
};
/* set register offset */ /* set register offset */
#define SR(reg_name)\ #define SR(reg_name)\
.reg_name = mm ## reg_name .reg_name = mm ## reg_name
...@@ -541,28 +496,18 @@ static const struct dce_mem_input_mask mi_masks = { ...@@ -541,28 +496,18 @@ static const struct dce_mem_input_mask mi_masks = {
static struct mem_input *dce80_mem_input_create( static struct mem_input *dce80_mem_input_create(
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst)
const struct dce110_mem_input_reg_offsets *offsets)
{ {
struct dce110_mem_input *mem_input80 = struct dce_mem_input *dce_mi = dm_alloc(sizeof(struct dce_mem_input));
dm_alloc(sizeof(struct dce110_mem_input));
if (!mem_input80) if (!dce_mi) {
BREAK_TO_DEBUGGER();
return NULL; return NULL;
if (dce80_mem_input_construct(mem_input80, ctx, inst, offsets)) {
struct mem_input *mi = &mem_input80->base;
mi->regs = &mi_regs[inst];
mi->shifts = &mi_shifts;
mi->masks = &mi_masks;
mi->wa.single_head_rdreq_dmif_limit = 2;
return mi;
} }
BREAK_TO_DEBUGGER(); dce_mem_input_construct(dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks);
dm_free(mem_input80); dce_mi->wa.single_head_rdreq_dmif_limit = 2;
return NULL; return &dce_mi->base;
} }
static void dce80_transform_destroy(struct transform **xfm) static void dce80_transform_destroy(struct transform **xfm)
...@@ -684,7 +629,7 @@ static void destruct(struct dce110_resource_pool *pool) ...@@ -684,7 +629,7 @@ static void destruct(struct dce110_resource_pool *pool)
dce_ipp_destroy(&pool->base.ipps[i]); dce_ipp_destroy(&pool->base.ipps[i]);
if (pool->base.mis[i] != NULL) { if (pool->base.mis[i] != NULL) {
dm_free(TO_DCE110_MEM_INPUT(pool->base.mis[i])); dm_free(TO_DCE_MEM_INPUT(pool->base.mis[i]));
pool->base.mis[i] = NULL; pool->base.mis[i] = NULL;
} }
...@@ -1000,8 +945,7 @@ static bool construct( ...@@ -1000,8 +945,7 @@ static bool construct(
goto res_create_fail; goto res_create_fail;
} }
pool->base.mis[i] = dce80_mem_input_create(ctx, i, pool->base.mis[i] = dce80_mem_input_create(ctx, i);
&dce80_mi_reg_offsets[i]);
if (pool->base.mis[i] == NULL) { if (pool->base.mis[i] == NULL) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
dm_error("DC: failed to create memory input!\n"); dm_error("DC: failed to create memory input!\n");
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "dc.h" #include "dc.h"
#include "include/grph_object_id.h" #include "include/grph_object_id.h"
#include "dce/dce_mem_input.h" /* temporary */
#if defined(CONFIG_DRM_AMD_DC_DCN1_0) #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
#include "dml/display_mode_structs.h" #include "dml/display_mode_structs.h"
...@@ -51,7 +49,6 @@ struct dcn_watermark_set { ...@@ -51,7 +49,6 @@ struct dcn_watermark_set {
struct dcn_watermarks c; struct dcn_watermarks c;
struct dcn_watermarks d; struct dcn_watermarks d;
}; };
#endif #endif
struct dce_watermarks { struct dce_watermarks {
...@@ -74,11 +71,6 @@ struct mem_input { ...@@ -74,11 +71,6 @@ struct mem_input {
struct dc_plane_address current_address; struct dc_plane_address current_address;
uint32_t inst; uint32_t inst;
struct stutter_modes stutter_mode; struct stutter_modes stutter_mode;
const struct dce_mem_input_registers *regs;
const struct dce_mem_input_shift *shifts;
const struct dce_mem_input_mask *masks;
struct dce_mem_input_wa wa;
}; };
struct mem_input_funcs { struct mem_input_funcs {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment