struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
if (dm_state->context) {
- dc_release_validate_context(dm_state->context);
+ dc_release_state(dm_state->context);
dm_state->context = NULL;
}
}
if (dm_state->context)
- WARN_ON(!dc_commit_context(dm->dc, dm_state->context));
+ WARN_ON(!dc_commit_state(dm->dc, dm_state->context));
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct dm_atomic_state {
struct drm_atomic_state base;
- struct validate_context *context;
+ struct dc_state *context;
};
#define to_dm_atomic_state(x) container_of(x, struct dm_atomic_state, base)
static void dcn_dml_wm_override(
const struct dcn_bw_internal_vars *v,
struct display_mode_lib *dml,
- struct validate_context *context,
+ struct dc_state *context,
const struct resource_pool *pool)
{
int i, in_idx, active_count;
}
static void calc_wm_sets_and_perf_params(
- struct validate_context *context,
+ struct dc_state *context,
struct dcn_bw_internal_vars *v)
{
/* Calculate set A last to keep internal var state consistent for required config */
bool dcn_validate_bandwidth(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
const struct resource_pool *pool = dc->res_pool;
struct dcn_bw_internal_vars *v = &context->dcn_bw_vars;
bool ret = false;
for (i = 0; i < MAX_PIPES; i++) {
- struct pipe_ctx *pipe = &dc->current_context->res_ctx.pipe_ctx[i];
+ struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i];
if (pipe->stream == stream && pipe->stream_res.stream_enc) {
dc->hwss.set_drr(&pipe, 1, vmin, vmax);
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
if (pipe->stream == stream && pipe->stream_res.stream_enc) {
dc->hwss.get_position(&pipe, 1, &position);
struct pipe_ctx *pipes;
for (i = 0; i < MAX_PIPES; i++) {
- if (dc->current_context->res_ctx.pipe_ctx[i].stream == stream) {
- pipes = &dc->current_context->res_ctx.pipe_ctx[i];
+ if (dc->current_state->res_ctx.pipe_ctx[i].stream == stream) {
+ pipes = &dc->current_state->res_ctx.pipe_ctx[i];
dc->hwss.program_gamut_remap(pipes);
ret = true;
}
struct pipe_ctx *pipes;
for (i = 0; i < MAX_PIPES; i++) {
- if (dc->current_context->res_ctx.pipe_ctx[i].stream
+ if (dc->current_state->res_ctx.pipe_ctx[i].stream
== stream) {
- pipes = &dc->current_context->res_ctx.pipe_ctx[i];
+ pipes = &dc->current_state->res_ctx.pipe_ctx[i];
dc->hwss.program_csc_matrix(pipes,
stream->output_color_space,
stream->csc_color_matrix.matrix);
struct dc_stream_state *stream = streams[i];
for (j = 0; j < MAX_PIPES; j++) {
- if (dc->current_context->res_ctx.pipe_ctx[j].stream
+ if (dc->current_state->res_ctx.pipe_ctx[j].stream
== stream) {
pipes_affected[num_pipes_affected++] =
- &dc->current_context->res_ctx.pipe_ctx[j];
+ &dc->current_state->res_ctx.pipe_ctx[j];
}
}
}
{
struct bit_depth_reduction_params params;
struct dc_link *link = stream->status.link;
- struct pipe_ctx *pipes = link->dc->current_context->res_ctx.pipe_ctx;
+ struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx;
memset(¶ms, 0, sizeof(params));
if (!stream)
static void destruct(struct dc *dc)
{
- dc_release_validate_context(dc->current_context);
- dc->current_context = NULL;
+ dc_release_state(dc->current_state);
+ dc->current_state = NULL;
destroy_links(dc);
goto fail;
}
- dc->current_context = dc_create_state();
+ dc->current_state = dc_create_state();
- if (!dc->current_context) {
+ if (!dc->current_state) {
dm_error("%s: failed to create validate ctx\n", __func__);
goto fail;
}
struct dc_stream_state *stream)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
- struct validate_context *context;
+ struct dc_state *context;
if (!dc_validate_stream(dc, stream))
return false;
- context = dm_alloc(sizeof(struct validate_context));
+ context = dm_alloc(sizeof(struct dc_state));
if (context == NULL)
goto context_alloc_fail;
result = dc->res_pool->funcs->validate_guaranteed(
dc, stream, context);
- dc_release_validate_context(context);
+ dc_release_state(context);
context_alloc_fail:
if (result != DC_OK) {
static void program_timing_sync(
struct dc *dc,
- struct validate_context *ctx)
+ struct dc_state *ctx)
{
int i, j;
int group_index = 0;
static bool context_changed(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
uint8_t i;
- if (context->stream_count != dc->current_context->stream_count)
+ if (context->stream_count != dc->current_state->stream_count)
return true;
- for (i = 0; i < dc->current_context->stream_count; i++) {
- if (dc->current_context->streams[i] != context->streams[i])
+ for (i = 0; i < dc->current_state->stream_count; i++) {
+ if (dc->current_state->streams[i] != context->streams[i])
return true;
}
bool dc_enable_stereo(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *streams[],
uint8_t stream_count)
{
if (context != NULL)
pipe = &context->res_ctx.pipe_ctx[i];
else
- pipe = &dc->current_context->res_ctx.pipe_ctx[i];
+ pipe = &dc->current_state->res_ctx.pipe_ctx[i];
for (j = 0 ; pipe && j < stream_count; j++) {
if (streams[j] && streams[j] == pipe->stream &&
dc->hwss.setup_stereo)
* Applies given context to HW and copy it into current context.
* It's up to the user to release the src context afterwards.
*/
-static bool dc_commit_context_no_check(struct dc *dc, struct validate_context *context)
+static bool dc_commit_state_no_check(struct dc *dc, struct dc_state *context)
{
struct dc_bios *dcb = dc->ctx->dc_bios;
enum dc_status result = DC_ERROR_UNEXPECTED;
dc_enable_stereo(dc, context, dc_streams, context->stream_count);
- dc_release_validate_context(dc->current_context);
+ dc_release_state(dc->current_state);
- dc->current_context = context;
+ dc->current_state = context;
- dc_retain_validate_context(dc->current_context);
+ dc_retain_state(dc->current_state);
dc->hwss.optimize_shared_resources(dc);
return (result == DC_OK);
}
-bool dc_commit_context(struct dc *dc, struct validate_context *context)
+bool dc_commit_state(struct dc *dc, struct dc_state *context)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
int i;
LOG_DC);
}
- result = dc_commit_context_no_check(dc, context);
+ result = dc_commit_state_no_check(dc, context);
return (result == DC_OK);
}
bool dc_post_update_surfaces_to_stream(struct dc *dc)
{
int i;
- struct validate_context *context = dc->current_context;
+ struct dc_state *context = dc->current_state;
post_surface_trace(dc);
return true;
}
-struct validate_context *dc_create_state(void)
+struct dc_state *dc_create_state(void)
{
- struct validate_context *context = dm_alloc(sizeof(struct validate_context));
+ struct dc_state *context = dm_alloc(sizeof(struct dc_state));
if (!context)
return NULL;
return context;
}
-void dc_retain_validate_context(struct validate_context *context)
+void dc_retain_state(struct dc_state *context)
{
ASSERT(atomic_read(&context->ref_count) > 0);
atomic_inc(&context->ref_count);
}
-void dc_release_validate_context(struct validate_context *context)
+void dc_release_state(struct dc_state *context)
{
ASSERT(atomic_read(&context->ref_count) > 0);
atomic_dec(&context->ref_count);
}
static bool is_surface_in_context(
- const struct validate_context *context,
+ const struct dc_state *context,
const struct dc_plane_state *plane_state)
{
int j;
const struct dc_surface_update *u,
int surface_index)
{
- const struct validate_context *context = dc->current_context;
+ const struct dc_state *context = dc->current_state;
enum surface_update_type type = UPDATE_TYPE_FAST;
enum surface_update_type overall_type = UPDATE_TYPE_FAST;
}
static struct dc_stream_status *stream_get_status(
- struct validate_context *ctx,
+ struct dc_state *ctx,
struct dc_stream_state *stream)
{
uint8_t i;
struct dc_stream_state *stream,
struct dc_stream_update *stream_update)
{
- struct validate_context *context;
+ struct dc_state *context;
int i, j;
enum surface_update_type update_type;
const struct dc_stream_status *stream_status;
ASSERT(0);
}
#endif
- context = dc->current_context;
+ context = dc->current_state;
/* update current stream with the new updates */
if (stream_update) {
goto context_alloc_fail;
dc_resource_validate_ctx_copy_construct(
- dc->current_context, context);
+ dc->current_state, context);
/*remove old surfaces from context */
if (!dc_rem_all_planes_for_stream(dc, stream, context)) {
/* Full fe update*/
for (j = 0; j < dc->res_pool->pipe_count; j++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
- struct pipe_ctx *cur_pipe_ctx = &dc->current_context->res_ctx.pipe_ctx[j];
+ struct pipe_ctx *cur_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[j];
bool is_new_pipe_surface = cur_pipe_ctx->plane_state != pipe_ctx->plane_state;
struct dc_cursor_position position = { 0 };
}
}
- if (dc->current_context != context) {
+ if (dc->current_state != context) {
/* Since memory free requires elevated IRQL, an interrupt
* request is generated by mem free. If this happens
* then free the old context.
*/
- struct validate_context *old = dc->current_context;
+ struct dc_state *old = dc->current_state;
- dc->current_context = context;
- dc_release_validate_context(old);
+ dc->current_state = context;
+ dc_release_state(old);
}
return;
fail:
- dc_release_validate_context(context);
+ dc_release_state(context);
context_alloc_fail:
DC_ERROR("Failed to allocate new validate context!\n");
uint8_t dc_get_current_stream_count(struct dc *dc)
{
- return dc->current_context->stream_count;
+ return dc->current_state->stream_count;
}
struct dc_stream_state *dc_get_stream_at_index(struct dc *dc, uint8_t i)
{
- if (i < dc->current_context->stream_count)
- return dc->current_context->streams[i];
+ if (i < dc->current_state->stream_count)
+ return dc->current_state->streams[i];
return NULL;
}
*/
/* Preserve refcount */
- ref_count = dc->current_context->ref_count;
- dc_resource_validate_ctx_destruct(dc->current_context);
- memset(dc->current_context, 0,
- sizeof(*dc->current_context));
- dc->current_context->ref_count = ref_count;
+ ref_count = dc->current_state->ref_count;
+ dc_resource_validate_ctx_destruct(dc->current_state);
+ memset(dc->current_state, 0,
+ sizeof(*dc->current_state));
+ dc->current_state->ref_count = ref_count;
break;
}
void context_clock_trace(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
struct dc *core_dc = dc;
if (dc_is_embedded_signal(link->connector_signal)) {
if (stream != NULL) {
for (i = 0; i < MAX_PIPES; i++) {
- if (core_dc->current_context->res_ctx.
+ if (core_dc->current_state->res_ctx.
pipe_ctx[i].stream
== stream)
/* DMCU -1 for all controller id values,
* therefore +1 here
*/
controller_id =
- core_dc->current_context->
+ core_dc->current_state->
res_ctx.pipe_ctx[i].stream_res.tg->inst +
1;
}
psr_context->engineId = link->link_enc->preferred_engine;
for (i = 0; i < MAX_PIPES; i++) {
- if (core_dc->current_context->res_ctx.pipe_ctx[i].stream
+ if (core_dc->current_state->res_ctx.pipe_ctx[i].stream
== stream) {
/* dmcu -1 for all controller id values,
* therefore +1 here
*/
psr_context->controllerId =
- core_dc->current_context->res_ctx.
+ core_dc->current_state->res_ctx.
pipe_ctx[i].stream_res.tg->inst + 1;
break;
}
const unsigned char *p_custom_pattern,
unsigned int cust_pattern_size)
{
- struct pipe_ctx *pipes = link->dc->current_context->res_ctx.pipe_ctx;
+ struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx;
struct pipe_ctx *pipe_ctx = &pipes[0];
unsigned int lane;
unsigned int i;
struct link_encoder *link_enc = link->link_enc;
struct pipe_ctx *pipes =
- link->dc->current_context->res_ctx.pipe_ctx;
+ link->dc->current_state->res_ctx.pipe_ctx;
struct clock_source *dp_cs =
link->dc->res_pool->dp_clock_source;
unsigned int i;
bool skip_video_pattern)
{
struct pipe_ctx *pipes =
- &link->dc->current_context->res_ctx.pipe_ctx[0];
+ &link->dc->current_state->res_ctx.pipe_ctx[0];
unsigned int i;
for (i = 0; i < MAX_PIPES; i++) {
enum dc_status resource_build_scaling_params_for_context(
const struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
* that has no surface attached yet
*/
static struct pipe_ctx *acquire_free_pipe_for_stream(
- struct validate_context *context,
+ struct dc_state *context,
const struct resource_pool *pool,
struct dc_stream_state *stream)
{
const struct dc *dc,
struct dc_stream_state *stream,
struct dc_plane_state *plane_state,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
struct resource_pool *pool = dc->res_pool;
const struct dc *dc,
struct dc_stream_state *stream,
struct dc_plane_state *plane_state,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
struct dc_stream_status *stream_status = NULL;
bool dc_rem_all_planes_for_stream(
const struct dc *dc,
struct dc_stream_state *stream,
- struct validate_context *context)
+ struct dc_state *context)
{
int i, old_plane_count;
struct dc_stream_status *stream_status = NULL;
struct dc_stream_state *stream,
const struct dc_validation_set set[],
int set_count,
- struct validate_context *context)
+ struct dc_state *context)
{
int i, j;
struct dc_stream_state *stream,
struct dc_plane_state * const *plane_states,
int plane_count,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dc_validation_set set;
int i;
}
bool resource_is_stream_unchanged(
- struct validate_context *old_context, struct dc_stream_state *stream)
+ struct dc_state *old_context, struct dc_stream_state *stream)
{
int i;
bool dc_add_stream_to_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *stream)
{
struct dc_context *dc_ctx = dc->ctx;
bool dc_remove_stream_from_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *stream)
{
int i;
static struct dc_stream_state *find_pll_sharable_stream(
struct dc_stream_state *stream_needs_pll,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
enum dc_status resource_map_pool_resources(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
const struct resource_pool *pool = dc->res_pool;
/* first stream in the context is used to populate the rest */
void validate_guaranteed_copy_streams(
- struct validate_context *context,
+ struct dc_state *context,
int max_streams)
{
int i;
void dc_resource_validate_ctx_copy_construct_current(
const struct dc *dc,
- struct validate_context *dst_ctx)
+ struct dc_state *dst_ctx)
{
- dc_resource_validate_ctx_copy_construct(dc->current_context, dst_ctx);
+ dc_resource_validate_ctx_copy_construct(dc->current_state, dst_ctx);
}
bool dc_validate_global_state(
struct dc *dc,
- struct validate_context *new_ctx)
+ struct dc_state *new_ctx)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
int i, j;
/*TODO: stereo 3D support and extend pixel encoding colorimetry*/
}
-void dc_resource_validate_ctx_destruct(struct validate_context *context)
+void dc_resource_validate_ctx_destruct(struct dc_state *context)
{
int i, j;
* by the src_ctx
*/
void dc_resource_validate_ctx_copy_construct(
- const struct validate_context *src_ctx,
- struct validate_context *dst_ctx)
+ const struct dc_state *src_ctx,
+ struct dc_state *dst_ctx)
{
int i, j;
atomic_t ref_count = dst_ctx->ref_count;
enum dc_status resource_map_clock_resources(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
/* acquire new resources */
uint8_t i;
struct dc *dc = stream->ctx->dc;
- for (i = 0; i < dc->current_context->stream_count; i++) {
- if (stream == dc->current_context->streams[i]) {
- return &dc->current_context->stream_status[i];
- }
+ for (i = 0; i < dc->current_state->stream_count; i++) {
+ if (stream == dc->current_state->streams[i])
+ return &dc->current_state->stream_status[i];
}
return NULL;
}
core_dc = stream->ctx->dc;
- res_ctx = &core_dc->current_context->res_ctx;
+ res_ctx = &core_dc->current_state->res_ctx;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
}
core_dc = stream->ctx->dc;
- res_ctx = &core_dc->current_context->res_ctx;
+ res_ctx = &core_dc->current_state->res_ctx;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
uint8_t i;
struct dc *core_dc = stream->ctx->dc;
struct resource_context *res_ctx =
- &core_dc->current_context->res_ctx;
+ &core_dc->current_state->res_ctx;
for (i = 0; i < MAX_PIPES; i++) {
struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
bool ret = false;
struct dc *core_dc = stream->ctx->dc;
struct resource_context *res_ctx =
- &core_dc->current_context->res_ctx;
+ &core_dc->current_state->res_ctx;
for (i = 0; i < MAX_PIPES; i++) {
struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
plane_status = &plane_state->status;
core_dc = plane_state->ctx->dc;
- if (core_dc->current_context == NULL)
+ if (core_dc->current_state == NULL)
return NULL;
for (i = 0; i < core_dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx =
- &core_dc->current_context->res_ctx.pipe_ctx[i];
+ &core_dc->current_state->res_ctx.pipe_ctx[i];
if (pipe_ctx->plane_state != plane_state)
continue;
/* Forward declaration*/
struct dc;
struct dc_plane_state;
-struct validate_context;
+struct dc_state;
struct dc_cap_funcs {
bool (*get_dcc_compression_cap)(const struct dc *dc,
bool disable_psr;
bool force_abm_enable;
};
-struct validate_context;
+struct dc_state;
struct resource_pool;
struct dce_hwseq;
struct dc {
uint8_t link_count;
struct dc_link *links[MAX_PIPES * 2];
- struct validate_context *current_context;
+ struct dc_state *current_state;
struct resource_pool *res_pool;
/* Display Engine Clock levels */
bool dc_add_stream_to_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *stream);
bool dc_remove_stream_from_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *stream);
const struct dc *dc,
struct dc_stream_state *stream,
struct dc_plane_state *plane_state,
- struct validate_context *context);
+ struct dc_state *context);
bool dc_remove_plane_from_context(
const struct dc *dc,
struct dc_stream_state *stream,
struct dc_plane_state *plane_state,
- struct validate_context *context);
+ struct dc_state *context);
bool dc_rem_all_planes_for_stream(
const struct dc *dc,
struct dc_stream_state *stream,
- struct validate_context *context);
+ struct dc_state *context);
bool dc_add_all_planes_for_stream(
const struct dc *dc,
struct dc_stream_state *stream,
struct dc_plane_state * const *plane_states,
int plane_count,
- struct validate_context *context);
+ struct dc_state *context);
/*
* Structure to store surface/stream associations for validation
bool dc_validate_global_state(
struct dc *dc,
- struct validate_context *new_ctx);
+ struct dc_state *new_ctx);
/*
* This function takes a stream and checks if it is guaranteed to be supported.
*/
void dc_resource_validate_ctx_copy_construct(
- const struct validate_context *src_ctx,
- struct validate_context *dst_ctx);
+ const struct dc_state *src_ctx,
+ struct dc_state *dst_ctx);
void dc_resource_validate_ctx_copy_construct_current(
const struct dc *dc,
- struct validate_context *dst_ctx);
+ struct dc_state *dst_ctx);
-void dc_resource_validate_ctx_destruct(struct validate_context *context);
+void dc_resource_validate_ctx_destruct(struct dc_state *context);
/*
* TODO update to make it about validation sets
* Phy, Encoder, Timing Generator are programmed and enabled.
* New streams are enabled with blank stream; no memory read.
*/
-bool dc_commit_context(struct dc *dc, struct validate_context *context);
+bool dc_commit_state(struct dc *dc, struct dc_state *context);
/*
* Set up streams and links associated to drive sinks
*/
bool dc_enable_stereo(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *streams[],
uint8_t stream_count);
const struct dc_stream_status *stream_status);
-struct validate_context *dc_create_state(void);
-void dc_retain_validate_context(struct validate_context *context);
-void dc_release_validate_context(struct validate_context *context);
+struct dc_state *dc_create_state(void);
+void dc_retain_state(struct dc_state *context);
+void dc_release_state(struct dc_state *context);
/*******************************************************************************
* Link Interfaces
{
uint32_t inst = pix_clk_params->controller_id - CONTROLLER_ID_D0;
struct dc *dc_core = cs->ctx->dc;
- struct validate_context *context = dc_core->current_context;
+ struct dc_state *context = dc_core->current_state;
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[inst];
/* This function need separate to different DCE version, before separate, just use pixel clock */
{
uint32_t inst = pix_clk_params->controller_id - CONTROLLER_ID_D0;
struct dc *dc_core = cs->ctx->dc;
- struct validate_context *context = dc_core->current_context;
+ struct dc_state *context = dc_core->current_state;
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[inst];
/* This function need separate to different DCE version, before separate, just use pixel clock */
static void dce100_pplib_apply_display_requirements(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
void dce100_set_bandwidth(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
bool decrease_allowed)
{
- if (decrease_allowed || context->bw.dce.dispclk_khz > dc->current_context->bw.dce.dispclk_khz) {
+ if (decrease_allowed || context->bw.dce.dispclk_khz > dc->current_state->bw.dce.dispclk_khz) {
dc->res_pool->display_clock->funcs->set_clock(
dc->res_pool->display_clock,
context->bw.dce.dispclk_khz * 115 / 100);
- dc->current_context->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz;
+ dc->current_state->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz;
}
dce100_pplib_apply_display_requirements(dc, context);
}
#include "core_types.h"
struct dc;
-struct validate_context;
+struct dc_state;
bool dce100_hw_sequencer_construct(struct dc *dc);
void dce100_set_bandwidth(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
bool decrease_allowed);
#endif /* __DC_HWSS_DCE100_H__ */
static enum dc_status build_mapped_resource(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
enum dc_status status = DC_OK;
bool dce100_validate_bandwidth(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
/* TODO implement when needed but for now hardcode max value*/
context->bw.dce.dispclk_khz = 681000;
}
static bool dce100_validate_surface_sets(
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
enum dc_status dce100_validate_global(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
if (!dce100_validate_surface_sets(context))
return DC_FAIL_SURFACE_VALIDATE;
enum dc_status dce100_validate_guaranteed(
struct dc *dc,
struct dc_stream_state *dc_stream,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
static enum dc_status dce110_prog_pixclk_crtc_otg(
struct pipe_ctx *pipe_ctx,
- struct validate_context *context,
+ struct dc_state *context,
struct dc *dc)
{
struct dc_stream_state *stream = pipe_ctx->stream;
- struct pipe_ctx *pipe_ctx_old = &dc->current_context->res_ctx.
+ struct pipe_ctx *pipe_ctx_old = &dc->current_state->res_ctx.
pipe_ctx[pipe_ctx->pipe_idx];
struct tg_color black_color = {0};
static enum dc_status apply_single_controller_ctx_to_hw(
struct pipe_ctx *pipe_ctx,
- struct validate_context *context,
+ struct dc_state *context,
struct dc *dc)
{
struct dc_stream_state *stream = pipe_ctx->stream;
- struct pipe_ctx *pipe_ctx_old = &dc->current_context->res_ctx.
+ struct pipe_ctx *pipe_ctx_old = &dc->current_state->res_ctx.
pipe_ctx[pipe_ctx->pipe_idx];
/* */
void dce110_set_displaymarks(
const struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
uint8_t i, num_pipes;
unsigned int underlay_idx = dc->res_pool->underlay_pipe_index;
*/
static uint32_t get_max_pixel_clock_for_all_paths(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
bool pre_mode_set)
{
uint32_t max_pix_clk = 0;
*/
static void apply_min_clocks(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
enum dm_pp_clocks_state *clocks_state,
bool pre_mode_set)
{
* Check if FBC can be enabled
*/
static enum dc_status validate_fbc(struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
struct pipe_ctx *pipe_ctx =
&context->res_ctx.pipe_ctx[0];
* Enable FBC
*/
static enum dc_status enable_fbc(struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status status = validate_fbc(dc, context);
static enum dc_status apply_ctx_to_hw_fpga(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status status = DC_ERROR_UNEXPECTED;
int i;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL)
static void dce110_reset_hw_ctx_wrap(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
/* look up the targets that have been removed since last commit */
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
/* Note: We need to disable output if clock sources change,
}
pipe_ctx_old->stream_res.tg->funcs->disable_crtc(pipe_ctx_old->stream_res.tg);
pipe_ctx_old->plane_res.mi->funcs->free_mem_input(
- pipe_ctx_old->plane_res.mi, dc->current_context->stream_count);
+ pipe_ctx_old->plane_res.mi, dc->current_state->stream_count);
resource_unreference_clock_source(
- &dc->current_context->res_ctx, dc->res_pool,
+ &dc->current_state->res_ctx, dc->res_pool,
&pipe_ctx_old->clock_source);
dc->hwss.power_down_front_end(dc, pipe_ctx_old->pipe_idx);
enum dc_status dce110_apply_ctx_to_hw(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dc_bios *dcb = dc->ctx->dc_bios;
enum dc_status status;
/* below is for real asic only */
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL || pipe_ctx->top_pipe)
#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
if (dc->ctx->dce_version >= DCN_VERSION_1_0) {
if (context->bw.dcn.calc_clk.fclk_khz
- > dc->current_context->bw.dcn.cur_clk.fclk_khz) {
+ > dc->current_state->bw.dcn.cur_clk.fclk_khz) {
struct dm_pp_clock_for_voltage_req clock;
clock.clk_type = DM_PP_CLOCK_TYPE_FCLK;
clock.clocks_in_khz = context->bw.dcn.calc_clk.fclk_khz;
dm_pp_apply_clock_for_voltage_request(dc->ctx, &clock);
- dc->current_context->bw.dcn.cur_clk.fclk_khz = clock.clocks_in_khz;
+ dc->current_state->bw.dcn.cur_clk.fclk_khz = clock.clocks_in_khz;
context->bw.dcn.cur_clk.fclk_khz = clock.clocks_in_khz;
}
if (context->bw.dcn.calc_clk.dcfclk_khz
- > dc->current_context->bw.dcn.cur_clk.dcfclk_khz) {
+ > dc->current_state->bw.dcn.cur_clk.dcfclk_khz) {
struct dm_pp_clock_for_voltage_req clock;
clock.clk_type = DM_PP_CLOCK_TYPE_DCFCLK;
clock.clocks_in_khz = context->bw.dcn.calc_clk.dcfclk_khz;
dm_pp_apply_clock_for_voltage_request(dc->ctx, &clock);
- dc->current_context->bw.dcn.cur_clk.dcfclk_khz = clock.clocks_in_khz;
+ dc->current_state->bw.dcn.cur_clk.dcfclk_khz = clock.clocks_in_khz;
context->bw.dcn.cur_clk.dcfclk_khz = clock.clocks_in_khz;
}
if (context->bw.dcn.calc_clk.dispclk_khz
- > dc->current_context->bw.dcn.cur_clk.dispclk_khz) {
+ > dc->current_state->bw.dcn.cur_clk.dispclk_khz) {
dc->res_pool->display_clock->funcs->set_clock(
dc->res_pool->display_clock,
context->bw.dcn.calc_clk.dispclk_khz);
- dc->current_context->bw.dcn.cur_clk.dispclk_khz =
+ dc->current_state->bw.dcn.cur_clk.dispclk_khz =
context->bw.dcn.calc_clk.dispclk_khz;
context->bw.dcn.cur_clk.dispclk_khz =
context->bw.dcn.calc_clk.dispclk_khz;
} else
#endif
if (context->bw.dce.dispclk_khz
- > dc->current_context->bw.dce.dispclk_khz) {
+ > dc->current_state->bw.dce.dispclk_khz) {
dc->res_pool->display_clock->funcs->set_clock(
dc->res_pool->display_clock,
context->bw.dce.dispclk_khz * 115 / 100);
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL)
}
void dce110_fill_display_configs(
- const struct validate_context *context,
+ const struct dc_state *context,
struct dm_pp_display_configuration *pp_display_cfg)
{
int j;
pp_display_cfg->display_count = num_cfgs;
}
-uint32_t dce110_get_min_vblank_time_us(const struct validate_context *context)
+uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context)
{
uint8_t j;
uint32_t min_vertical_blank_time = -1;
static void pplib_apply_display_requirements(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
static void dce110_set_bandwidth(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
bool decrease_allowed)
{
dce110_set_displaymarks(dc, context);
- if (decrease_allowed || context->bw.dce.dispclk_khz > dc->current_context->bw.dce.dispclk_khz) {
+ if (decrease_allowed || context->bw.dce.dispclk_khz > dc->current_state->bw.dce.dispclk_khz) {
dc->res_pool->display_clock->funcs->set_clock(
dc->res_pool->display_clock,
context->bw.dce.dispclk_khz * 115 / 100);
- dc->current_context->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz;
+ dc->current_state->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz;
}
pplib_apply_display_requirements(dc, context);
memset(&tbl_entry, 0, sizeof(tbl_entry));
- if (dc->current_context)
- old_pipe = &dc->current_context->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
+ if (dc->current_state)
+ old_pipe = &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
memset(&adjust, 0, sizeof(adjust));
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
struct dc *dc,
const struct dc_stream_state *stream,
int num_planes,
- struct validate_context *context)
+ struct dc_state *context)
{
int i, be_idx;
static void dce110_power_down_fe(struct dc *dc, int fe_idx)
{
/* Do not power down fe when stream is active on dce*/
- if (dc->current_context->res_ctx.pipe_ctx[fe_idx].stream)
+ if (dc->current_state->res_ctx.pipe_ctx[fe_idx].stream)
return;
dc->hwss.enable_display_power_gating(
#define GAMMA_HW_POINTS_NUM 256
struct dc;
-struct validate_context;
+struct dc_state;
struct dm_pp_display_configuration;
bool dce110_hw_sequencer_construct(struct dc *dc);
enum dc_status dce110_apply_ctx_to_hw(
struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
-void dce110_set_display_clock(struct validate_context *context);
+void dce110_set_display_clock(struct dc_state *context);
void dce110_set_displaymarks(
const struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
void dce110_enable_stream(struct pipe_ctx *pipe_ctx);
void dce110_update_pending_status(struct pipe_ctx *pipe_ctx);
void dce110_fill_display_configs(
- const struct validate_context *context,
+ const struct dc_state *context,
struct dm_pp_display_configuration *pp_display_cfg);
-uint32_t dce110_get_min_vblank_time_us(const struct validate_context *context);
+uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context);
void dp_receiver_power_ctrl(struct dc_link *link, bool on);
#endif /* __DC_HWSS_DCE110_H__ */
static enum dc_status build_mapped_resource(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
enum dc_status status = DC_OK;
static bool dce110_validate_bandwidth(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
bool result = false;
context->streams[0]->timing.v_addressable,
context->streams[0]->timing.pix_clk_khz);
- if (memcmp(&dc->current_context->bw.dce,
+ if (memcmp(&dc->current_state->bw.dce,
&context->bw.dce, sizeof(context->bw.dce))) {
struct log_entry log_entry;
dm_logger_open(
}
static bool dce110_validate_surface_sets(
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
enum dc_status dce110_validate_global(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
if (!dce110_validate_surface_sets(context))
return DC_FAIL_SURFACE_VALIDATE;
static enum dc_status dce110_validate_guaranteed(
struct dc *dc,
struct dc_stream_state *dc_stream,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
}
static struct pipe_ctx *dce110_acquire_underlay(
- struct validate_context *context,
+ struct dc_state *context,
const struct resource_pool *pool,
struct dc_stream_state *stream)
{
pipe_ctx->stream = stream;
- if (!dc->current_context->res_ctx.pipe_ctx[underlay_idx].stream) {
+ if (!dc->current_state->res_ctx.pipe_ctx[underlay_idx].stream) {
struct tg_color black_color = {0};
struct dc_bios *dcb = dc->ctx->dc_bios;
static enum dc_status build_mapped_resource(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
enum dc_status status = DC_OK;
bool dce112_validate_bandwidth(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
bool result = false;
"%s: Bandwidth validation failed!",
__func__);
- if (memcmp(&dc->current_context->bw.dce,
+ if (memcmp(&dc->current_state->bw.dce,
&context->bw.dce, sizeof(context->bw.dce))) {
struct log_entry log_entry;
dm_logger_open(
enum dc_status resource_map_phy_clock_resources(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
}
static bool dce112_validate_surface_sets(
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
enum dc_status dce112_add_stream_to_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *dc_stream)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
enum dc_status dce112_validate_guaranteed(
struct dc *dc,
struct dc_stream_state *stream,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
enum dc_status dce112_validate_global(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
if (!dce112_validate_surface_sets(context))
return DC_FAIL_SURFACE_VALIDATE;
struct dc *dc,
const struct dc_validation_set set[],
int set_count,
- struct validate_context *context,
- struct validate_context *old_context);
+ struct dc_state *context,
+ struct dc_state *old_context);
enum dc_status dce112_validate_guaranteed(
struct dc *dc,
struct dc_stream_state *dc_stream,
- struct validate_context *context);
+ struct dc_state *context);
bool dce112_validate_bandwidth(
struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
enum dc_status dce112_add_stream_to_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *dc_stream);
static enum dc_status build_mapped_resource(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
enum dc_status status = DC_OK;
bool dce80_validate_bandwidth(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
/* TODO implement when needed but for now hardcode max value*/
context->bw.dce.dispclk_khz = 681000;
}
static bool dce80_validate_surface_sets(
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
enum dc_status dce80_validate_global(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
if (!dce80_validate_surface_sets(context))
return DC_FAIL_SURFACE_VALIDATE;
enum dc_status dce80_validate_guaranteed(
struct dc *dc,
struct dc_stream_state *dc_stream,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
static void ready_shared_resources(struct dc *dc)
{
- if (dc->current_context->stream_count == 0 &&
+ if (dc->current_state->stream_count == 0 &&
!dc->debug.disable_stutter)
undo_DEGVIDCN10_253_wa(dc);
}
static void optimize_shared_resources(struct dc *dc)
{
- if (dc->current_context->stream_count == 0 &&
+ if (dc->current_state->stream_count == 0 &&
!dc->debug.disable_stutter)
apply_DEGVIDCN10_253_wa(dc);
}
static enum dc_status dcn10_prog_pixclk_crtc_otg(
struct pipe_ctx *pipe_ctx,
- struct validate_context *context,
+ struct dc_state *context,
struct dc *dc)
{
struct dc_stream_state *stream = pipe_ctx->stream;
static void reset_back_end_for_pipe(
struct dc *dc,
struct pipe_ctx *pipe_ctx,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
&pipe_ctx->clock_source);
for (i = 0; i < dc->res_pool->pipe_count; i++)
- if (&dc->current_context->res_ctx.pipe_ctx[i] == pipe_ctx)
+ if (&dc->current_state->res_ctx.pipe_ctx[i] == pipe_ctx)
break;
if (i == dc->res_pool->pipe_count)
static void reset_hw_ctx_wrap(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
int i;
/* Reset Front End*/
/* Lock*/
for (i = 0; i < dc->res_pool->pipe_count; i++) {
- struct pipe_ctx *cur_pipe_ctx = &dc->current_context->res_ctx.pipe_ctx[i];
+ struct pipe_ctx *cur_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
struct timing_generator *tg = cur_pipe_ctx->stream_res.tg;
if (cur_pipe_ctx->stream)
/* Disconnect*/
for (i = dc->res_pool->pipe_count - 1; i >= 0 ; i--) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (!pipe_ctx->stream ||
}
/* Unlock*/
for (i = dc->res_pool->pipe_count - 1; i >= 0; i--) {
- struct pipe_ctx *cur_pipe_ctx = &dc->current_context->res_ctx.pipe_ctx[i];
+ struct pipe_ctx *cur_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
struct timing_generator *tg = cur_pipe_ctx->stream_res.tg;
if (cur_pipe_ctx->stream)
/* Disable and Powerdown*/
for (i = dc->res_pool->pipe_count - 1; i >= 0 ; i--) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
/*if (!pipe_ctx_old->stream)
/* Reset Back End*/
for (i = dc->res_pool->pipe_count - 1; i >= 0 ; i--) {
struct pipe_ctx *pipe_ctx_old =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (!pipe_ctx_old->stream)
if (!pipe_ctx->stream ||
pipe_need_reprogram(pipe_ctx_old, pipe_ctx))
- reset_back_end_for_pipe(dc, pipe_ctx_old, dc->current_context);
+ reset_back_end_for_pipe(dc, pipe_ctx_old, dc->current_state);
}
}
static void dcn10_power_on_fe(
struct dc *dc,
struct pipe_ctx *pipe_ctx,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
struct dce_hwseq *hws = dc->hwseq;
static void update_dchubp_dpp(
struct dc *dc,
struct pipe_ctx *pipe_ctx,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dce_hwseq *hws = dc->hwseq;
struct mem_input *mi = pipe_ctx->plane_res.mi;
pipe_ctx->pipe_idx,
pipe_ctx->stream_res.pix_clk_params.requested_pix_clk,
context->bw.dcn.calc_clk.dppclk_div);
- dc->current_context->bw.dcn.cur_clk.dppclk_div =
+ dc->current_state->bw.dcn.cur_clk.dppclk_div =
context->bw.dcn.calc_clk.dppclk_div;
context->bw.dcn.cur_clk.dppclk_div = context->bw.dcn.calc_clk.dppclk_div;
static void program_all_pipe_in_tree(
struct dc *dc,
struct pipe_ctx *pipe_ctx,
- struct validate_context *context)
+ struct dc_state *context)
{
unsigned int ref_clk_mhz = dc->res_pool->ref_clock_inKhz/1000;
static void dcn10_pplib_apply_display_requirements(
struct dc *dc,
- struct validate_context *context)
+ struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
struct dc *dc,
const struct dc_stream_state *stream,
int num_planes,
- struct validate_context *context)
+ struct dc_state *context)
{
int i, be_idx;
if (num_planes == 0) {
for (i = dc->res_pool->pipe_count - 1; i >= 0 ; i--) {
struct pipe_ctx *old_pipe_ctx =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
if (old_pipe_ctx->stream_res.tg && old_pipe_ctx->stream_res.tg->inst == be_idx) {
old_pipe_ctx->stream_res.tg->funcs->set_blank(old_pipe_ctx->stream_res.tg, true);
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
struct pipe_ctx *old_pipe_ctx =
- &dc->current_context->res_ctx.pipe_ctx[i];
+ &dc->current_state->res_ctx.pipe_ctx[i];
if (!pipe_ctx->plane_state && !old_pipe_ctx->plane_state)
continue;
static void dcn10_set_bandwidth(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
bool decrease_allowed)
{
struct pp_smu_display_requirement_rv *smu_req_cur =
return;
if (decrease_allowed || context->bw.dcn.calc_clk.dispclk_khz
- > dc->current_context->bw.dcn.cur_clk.dispclk_khz) {
+ > dc->current_state->bw.dcn.cur_clk.dispclk_khz) {
dc->res_pool->display_clock->funcs->set_clock(
dc->res_pool->display_clock,
context->bw.dcn.calc_clk.dispclk_khz);
- dc->current_context->bw.dcn.cur_clk.dispclk_khz =
+ dc->current_state->bw.dcn.cur_clk.dispclk_khz =
context->bw.dcn.calc_clk.dispclk_khz;
}
if (decrease_allowed || context->bw.dcn.calc_clk.dcfclk_khz
- > dc->current_context->bw.dcn.cur_clk.dcfclk_khz) {
+ > dc->current_state->bw.dcn.cur_clk.dcfclk_khz) {
smu_req.hard_min_dcefclk_khz =
context->bw.dcn.calc_clk.dcfclk_khz;
}
if (decrease_allowed || context->bw.dcn.calc_clk.fclk_khz
- > dc->current_context->bw.dcn.cur_clk.fclk_khz) {
+ > dc->current_state->bw.dcn.cur_clk.fclk_khz) {
smu_req.hard_min_fclk_khz = context->bw.dcn.calc_clk.fclk_khz;
}
if (decrease_allowed || context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz
- > dc->current_context->bw.dcn.cur_clk.dcfclk_deep_sleep_khz) {
- dc->current_context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz =
+ > dc->current_state->bw.dcn.cur_clk.dcfclk_deep_sleep_khz) {
+ dc->current_state->bw.dcn.calc_clk.dcfclk_deep_sleep_khz =
context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz;
context->bw.dcn.cur_clk.dcfclk_deep_sleep_khz =
context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz;
/* Decrease in freq is increase in period so opposite comparison for dram_ccm */
if (decrease_allowed || context->bw.dcn.calc_clk.dram_ccm_us
- < dc->current_context->bw.dcn.cur_clk.dram_ccm_us) {
- dc->current_context->bw.dcn.calc_clk.dram_ccm_us =
+ < dc->current_state->bw.dcn.cur_clk.dram_ccm_us) {
+ dc->current_state->bw.dcn.calc_clk.dram_ccm_us =
context->bw.dcn.calc_clk.dram_ccm_us;
context->bw.dcn.cur_clk.dram_ccm_us =
context->bw.dcn.calc_clk.dram_ccm_us;
}
if (decrease_allowed || context->bw.dcn.calc_clk.min_active_dram_ccm_us
- < dc->current_context->bw.dcn.cur_clk.min_active_dram_ccm_us) {
- dc->current_context->bw.dcn.calc_clk.min_active_dram_ccm_us =
+ < dc->current_state->bw.dcn.cur_clk.min_active_dram_ccm_us) {
+ dc->current_state->bw.dcn.calc_clk.min_active_dram_ccm_us =
context->bw.dcn.calc_clk.min_active_dram_ccm_us;
context->bw.dcn.cur_clk.min_active_dram_ccm_us =
context->bw.dcn.calc_clk.min_active_dram_ccm_us;
void dcn10_hw_sequencer_construct(struct dc *dc);
extern void fill_display_configs(
- const struct validate_context *context,
+ const struct dc_state *context,
struct dm_pp_display_configuration *pp_display_cfg);
#endif /* __DC_HWSS_DCN10_H__ */
static enum dc_status build_mapped_resource(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream)
{
enum dc_status status = DC_OK;
enum dc_status dcn10_add_stream_to_ctx(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *dc_stream)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
enum dc_status dcn10_validate_guaranteed(
struct dc *dc,
struct dc_stream_state *dc_stream,
- struct validate_context *context)
+ struct dc_state *context)
{
enum dc_status result = DC_ERROR_UNEXPECTED;
}
static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer(
- struct validate_context *context,
+ struct dc_state *context,
const struct resource_pool *pool,
struct dc_stream_state *stream)
{
#include "transform.h"
struct resource_pool;
-struct validate_context;
+struct dc_state;
struct resource_context;
struct resource_funcs {
enum dc_status (*validate_guaranteed)(
struct dc *dc,
struct dc_stream_state *stream,
- struct validate_context *context);
+ struct dc_state *context);
bool (*validate_bandwidth)(
struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
enum dc_status (*validate_global)(
struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
struct pipe_ctx *(*acquire_idle_pipe_for_layer)(
- struct validate_context *context,
+ struct dc_state *context,
const struct resource_pool *pool,
struct dc_stream_state *stream);
enum dc_status (*add_stream_to_ctx)(
struct dc *dc,
- struct validate_context *new_ctx,
+ struct dc_state *new_ctx,
struct dc_stream_state *dc_stream);
};
struct dce_bw_output dce;
};
-struct validate_context {
+struct dc_state {
struct dc_stream_state *streams[MAX_PIPES];
struct dc_stream_status stream_status[MAX_PIPES];
uint8_t stream_count;
struct pipe_ctx;
struct dc;
-struct validate_context;
+struct dc_state;
struct dce_bw_output;
enum bw_calcs_version {
#include "../dml/display_mode_lib.h"
struct dc;
-struct validate_context;
+struct dc_state;
/*******************************************************************************
* DCN data structures.
bool dcn_validate_bandwidth(
struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
unsigned int dcn_find_dcfclk_suits_all(
const struct dc *dc,
};
struct pipe_ctx;
-struct validate_context;
+struct dc_state;
struct dchub_init_data;
struct dc_static_screen_events;
struct resource_pool;
void (*init_hw)(struct dc *dc);
enum dc_status (*apply_ctx_to_hw)(
- struct dc *dc, struct validate_context *context);
+ struct dc *dc, struct dc_state *context);
void (*reset_hw_ctx_wrap)(
- struct dc *dc, struct validate_context *context);
+ struct dc *dc, struct dc_state *context);
void (*apply_ctx_for_surface)(
struct dc *dc,
const struct dc_stream_state *stream,
int num_planes,
- struct validate_context *context);
+ struct dc_state *context);
void (*set_plane_config)(
const struct dc *dc,
void (*power_on_front_end)(struct dc *dc,
struct pipe_ctx *pipe,
- struct validate_context *context);
+ struct dc_state *context);
void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
void (*set_bandwidth)(
struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
bool decrease_allowed);
void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
enum dc_status (*prog_pixclk_crtc_otg)(
struct pipe_ctx *pipe_ctx,
- struct validate_context *context,
+ struct dc_state *context,
struct dc *dc);
void (*setup_stereo)(
enum dc_status resource_map_pool_resources(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream);
bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx);
enum dc_status resource_build_scaling_params_for_context(
const struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
void resource_build_info_frame(struct pipe_ctx *pipe_ctx);
struct dc_plane_state *const *plane_state,
int surface_count,
struct dc_stream_state *dc_stream,
- struct validate_context *context,
+ struct dc_state *context,
const struct resource_pool *pool);
struct pipe_ctx *find_idle_secondary_pipe(
const struct resource_pool *pool);
bool resource_is_stream_unchanged(
- struct validate_context *old_context, struct dc_stream_state *stream);
+ struct dc_state *old_context, struct dc_stream_state *stream);
bool resource_validate_attach_surfaces(
const struct dc_validation_set set[],
int set_count,
- const struct validate_context *old_context,
- struct validate_context *context,
+ const struct dc_state *old_context,
+ struct dc_state *context,
const struct resource_pool *pool);
void validate_guaranteed_copy_streams(
- struct validate_context *context,
+ struct dc_state *context,
int max_streams);
void resource_validate_ctx_update_pointer_after_copy(
- const struct validate_context *src_ctx,
- struct validate_context *dst_ctx);
+ const struct dc_state *src_ctx,
+ struct dc_state *dst_ctx);
enum dc_status resource_map_clock_resources(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream);
enum dc_status resource_map_phy_clock_resources(
const struct dc *dc,
- struct validate_context *context,
+ struct dc_state *context,
struct dc_stream_state *stream);
bool pipe_need_reprogram(
uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
struct timing_generator *tg =
- core_dc->current_context->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
+ core_dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
if (enable) {
if (!tg->funcs->arm_vert_intr(tg, 2)) {
struct dc_link;
struct dc_surface_update;
struct resource_context;
-struct validate_context;
+struct dc_state;
/*
*
void context_clock_trace(
struct dc *dc,
- struct validate_context *context);
+ struct dc_state *context);
/* Any function which is empty or have incomplete implementation should be
* marked by this macro.