static bool fill_rects_from_plane_state(
const struct drm_plane_state *state,
- struct dc_surface *surface)
+ struct dc_plane_state *surface)
{
surface->src_rect.x = state->src_x >> 16;
surface->src_rect.y = state->src_y >> 16;
static int fill_plane_attributes_from_fb(
struct amdgpu_device *adev,
- struct dc_surface *surface,
+ struct dc_plane_state *surface,
const struct amdgpu_framebuffer *amdgpu_fb, bool addReq)
{
uint64_t tiling_flags;
static void fill_gamma_from_crtc_state(
const struct drm_crtc_state *crtc_state,
- struct dc_surface *dc_surface)
+ struct dc_plane_state *dc_surface)
{
int i;
struct dc_gamma *gamma;
static int fill_plane_attributes(
struct amdgpu_device *adev,
- struct dc_surface *surface,
+ struct dc_plane_state *surface,
struct drm_plane_state *plane_state,
struct drm_crtc_state *crtc_state,
bool addrReq)
if (dm_plane_state_new->surface &&
dm_plane_state_old->surface != dm_plane_state_new->surface) {
- struct dc_surface *surface = dm_plane_state_new->surface;
+ struct dc_plane_state *surface = dm_plane_state_new->surface;
if (surface->format < SURFACE_PIXEL_FORMAT_VIDEO_BEGIN) {
surface->address.grph.addr.low_part = lower_32_bits(afb->address);
if (!dm_plane_state->surface)
return true;
- if (dc_validate_surface(dc, dm_plane_state->surface))
+ if (dc_validate_plane(dc, dm_plane_state->surface))
return 0;
return -EINVAL;
struct drm_plane *plane;
struct drm_plane_state *old_plane_state;
struct dc_stream *dc_stream_attach;
- struct dc_surface *dc_surfaces_constructed[MAX_SURFACES];
+ struct dc_plane_state *dc_surfaces_constructed[MAX_SURFACES];
struct amdgpu_crtc *acrtc_attach = to_amdgpu_crtc(pcrtc);
struct dm_crtc_state *acrtc_state = to_dm_crtc_state(pcrtc->state);
int planes_count = 0;
struct dc_validation_set *val_sets,
uint32_t set_count,
const struct dc_stream *stream,
- struct dc_surface *surface)
+ struct dc_plane_state *surface)
{
uint32_t i = 0, j = 0;
pflip_needed = !state->allow_modeset;
if (!pflip_needed) {
- struct dc_surface *surface;
+ struct dc_plane_state *surface;
surface = dc_create_surface(dc);
struct amdgpu_framebuffer;
struct amdgpu_display_manager;
struct dc_validation_set;
-struct dc_surface;
+struct dc_plane_state;
/* TODO rename to dc_stream_state */
struct dc_stream;
struct dm_plane_state {
struct drm_plane_state base;
- struct dc_surface *surface;
+ struct dc_plane_state *surface;
};
struct dm_crtc_state {
return true;
for (j = 0; j < set[i].surface_count; j++) {
- struct dc_surface temp_surf;
+ struct dc_plane_state temp_surf;
memset(&temp_surf, 0, sizeof(temp_surf));
temp_surf = *context->stream_status[i].surfaces[j];
for (i = 0; i < set_count; i++)
for (j = 0; j < set[i].surface_count; j++)
- if (!dc_validate_surface(dc, set[i].surfaces[j]))
+ if (!dc_validate_plane(dc, set[i].surfaces[j]))
return false;
return true;
const struct dc_sink *sink = context->streams[i]->sink;
for (j = 0; j < context->stream_status[i].surface_count; j++) {
- const struct dc_surface *surface =
+ const struct dc_plane_state *surface =
context->stream_status[i].surfaces[j];
core_dc->hwss.apply_ctx_for_surface(core_dc, surface, context);
bool dc_commit_surfaces_to_stream(
struct dc *dc,
- struct dc_surface **new_surfaces,
+ struct dc_plane_state **new_surfaces,
uint8_t new_surface_count,
struct dc_stream *dc_stream)
{
static bool is_surface_in_context(
const struct validate_context *context,
- const struct dc_surface *surface)
+ const struct dc_plane_state *surface)
{
int j;
update_surface_trace(dc, srf_updates, surface_count);
if (update_type >= UPDATE_TYPE_FULL) {
- struct dc_surface *new_surfaces[MAX_SURFACES] = {0};
+ struct dc_plane_state *new_surfaces[MAX_SURFACES] = {0};
for (i = 0; i < surface_count; i++)
new_surfaces[i] = srf_updates[i].surface;
/* save update parameters into surface */
for (i = 0; i < surface_count; i++) {
- struct dc_surface *surface = srf_updates[i].surface;
+ struct dc_plane_state *surface = srf_updates[i].surface;
if (srf_updates[i].flip_addr) {
surface->address = srf_updates[i].flip_addr->address;
/* Lock pipes for provided surfaces, or all active if full update*/
for (i = 0; i < surface_count; i++) {
- struct dc_surface *surface = srf_updates[i].surface;
+ struct dc_plane_state *surface = srf_updates[i].surface;
for (j = 0; j < core_dc->res_pool->pipe_count; j++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
/* Perform requested Updates */
for (i = 0; i < surface_count; i++) {
- struct dc_surface *surface = srf_updates[i].surface;
+ struct dc_plane_state *surface = srf_updates[i].surface;
if (update_type == UPDATE_TYPE_MED)
core_dc->hwss.apply_ctx_for_surface(
void pre_surface_trace(
const struct dc *dc,
- const struct dc_surface *const *surfaces,
+ const struct dc_plane_state *const *surfaces,
int surface_count)
{
int i;
struct dal_logger *logger = core_dc->ctx->logger;
for (i = 0; i < surface_count; i++) {
- const struct dc_surface *surface = surfaces[i];
+ const struct dc_plane_state *surface = surfaces[i];
SURFACE_TRACE("Surface %d:\n", i);
static void calculate_viewport(struct pipe_ctx *pipe_ctx)
{
- const struct dc_surface *surface = pipe_ctx->surface;
+ const struct dc_plane_state *surface = pipe_ctx->surface;
const struct dc_stream *stream = pipe_ctx->stream;
struct scaler_data *data = &pipe_ctx->scl_data;
struct rect surf_src = surface->src_rect;
static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skip)
{
- const struct dc_surface *surface = pipe_ctx->surface;
+ const struct dc_plane_state *surface = pipe_ctx->surface;
const struct dc_stream *stream = pipe_ctx->stream;
struct rect surf_src = surface->src_rect;
struct rect surf_clip = surface->clip_rect;
static void calculate_scaling_ratios(struct pipe_ctx *pipe_ctx)
{
- const struct dc_surface *surface = pipe_ctx->surface;
+ const struct dc_plane_state *surface = pipe_ctx->surface;
const struct dc_stream *stream = pipe_ctx->stream;
struct rect surf_src = surface->src_rect;
const int in_w = stream->src.width;
bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
{
- const struct dc_surface *surface = pipe_ctx->surface;
+ const struct dc_plane_state *surface = pipe_ctx->surface;
struct dc_crtc_timing *timing = &pipe_ctx->stream->timing;
struct view recout_skip = { 0 };
bool res = false;
#endif
bool resource_attach_surfaces_to_context(
- struct dc_surface * const *surfaces,
+ struct dc_plane_state * const *surfaces,
int surface_count,
struct dc_stream *stream,
struct validate_context *context,
tail_pipe = NULL;
for (i = 0; i < surface_count; i++) {
- struct dc_surface *surface = surfaces[i];
+ struct dc_plane_state *surface = surfaces[i];
struct pipe_ctx *free_pipe = acquire_free_pipe_for_stream(
context, pool, stream);
static void copy_pipe_ctx(
const struct pipe_ctx *from_pipe_ctx, struct pipe_ctx *to_pipe_ctx)
{
- struct dc_surface *surface = to_pipe_ctx->surface;
+ struct dc_plane_state *surface = to_pipe_ctx->surface;
struct dc_stream *stream = to_pipe_ctx->stream;
*to_pipe_ctx = *from_pipe_ctx;
static void set_hdr_static_info_packet(
struct encoder_info_packet *info_packet,
- struct dc_surface *surface,
+ struct dc_plane_state *surface,
struct dc_stream *stream)
{
uint16_t i = 0;
return res == DC_OK;
}
-bool dc_validate_surface(const struct dc *dc, const struct dc_surface *surface)
+bool dc_validate_plane(const struct dc *dc, const struct dc_plane_state *plane_state)
{
struct core_dc *core_dc = DC_TO_CORE(dc);
/* TODO For now validates pixel format only */
- if (core_dc->res_pool->funcs->validate_surface)
- return core_dc->res_pool->funcs->validate_surface(surface) == DC_OK;
+ if (core_dc->res_pool->funcs->validate_plane)
+ return core_dc->res_pool->funcs->validate_plane(plane_state) == DC_OK;
return true;
}
/*******************************************************************************
* Private functions
******************************************************************************/
-static bool construct(struct dc_context *ctx, struct dc_surface *surface)
+static bool construct(struct dc_context *ctx, struct dc_plane_state *surface)
{
surface->ctx = ctx;
memset(&surface->hdr_static_ctx,
return true;
}
-static void destruct(struct dc_surface *surface)
+static void destruct(struct dc_plane_state *surface)
{
if (surface->gamma_correction != NULL) {
dc_gamma_release(&surface->gamma_correction);
/*******************************************************************************
* Public functions
******************************************************************************/
-void enable_surface_flip_reporting(struct dc_surface *surface,
+void enable_surface_flip_reporting(struct dc_plane_state *surface,
uint32_t controller_id)
{
surface->irq_source = controller_id + DC_IRQ_SOURCE_PFLIP1 - 1;
/*register_flip_interrupt(surface);*/
}
-struct dc_surface *dc_create_surface(const struct dc *dc)
+struct dc_plane_state *dc_create_surface(const struct dc *dc)
{
struct core_dc *core_dc = DC_TO_CORE(dc);
- struct dc_surface *surface = dm_alloc(sizeof(*surface));
+ struct dc_plane_state *surface = dm_alloc(sizeof(*surface));
if (NULL == surface)
goto alloc_fail;
}
const struct dc_surface_status *dc_surface_get_status(
- const struct dc_surface *dc_surface)
+ const struct dc_plane_state *dc_surface)
{
const struct dc_surface_status *surface_status;
struct core_dc *core_dc;
return surface_status;
}
-void dc_surface_retain(struct dc_surface *surface)
+void dc_surface_retain(struct dc_plane_state *surface)
{
ASSERT(surface->ref_count > 0);
++surface->ref_count;
}
-void dc_surface_release(struct dc_surface *surface)
+void dc_surface_release(struct dc_plane_state *surface)
{
ASSERT(surface->ref_count > 0);
--surface->ref_count;
/* Forward declaration*/
struct dc;
-struct dc_surface;
+struct dc_plane_state;
struct validate_context;
struct dc_cap_funcs {
bool is_right_eye;
};
-struct dc_surface {
+struct dc_plane_state {
struct dc_plane_address address;
struct scaling_taps scaling_quality;
};
struct dc_surface_update {
- struct dc_surface *surface;
+ struct dc_plane_state *surface;
/* isr safe update parameters. null means no updates */
struct dc_flip_addrs *flip_addr;
/*
* Create a new surface with default parameters;
*/
-struct dc_surface *dc_create_surface(const struct dc *dc);
+struct dc_plane_state *dc_create_surface(const struct dc *dc);
const struct dc_surface_status *dc_surface_get_status(
- const struct dc_surface *dc_surface);
+ const struct dc_plane_state *dc_surface);
-void dc_surface_retain(struct dc_surface *dc_surface);
-void dc_surface_release(struct dc_surface *dc_surface);
+void dc_surface_retain(struct dc_plane_state *dc_surface);
+void dc_surface_release(struct dc_plane_state *dc_surface);
void dc_gamma_retain(struct dc_gamma *dc_gamma);
void dc_gamma_release(struct dc_gamma **dc_gamma);
bool dc_commit_surfaces_to_stream(
struct dc *dc,
- struct dc_surface **dc_surfaces,
+ struct dc_plane_state **dc_surfaces,
uint8_t surface_count,
struct dc_stream *stream);
struct dc_stream_status {
int primary_otg_inst;
int surface_count;
- struct dc_surface *surfaces[MAX_SURFACE_NUM];
+ struct dc_plane_state *surfaces[MAX_SURFACE_NUM];
/*
* link this stream passes through
*/
struct dc_validation_set {
struct dc_stream *stream;
- struct dc_surface *surfaces[MAX_SURFACES];
+ struct dc_plane_state *surfaces[MAX_SURFACES];
uint8_t surface_count;
};
bool dc_validate_stream(const struct dc *dc, struct dc_stream *stream);
-bool dc_validate_surface(const struct dc *dc, const struct dc_surface *surface);
+bool dc_validate_plane(const struct dc *dc, const struct dc_plane_state *plane_state);
/*
* This function takes a set of resources and checks that they are cofunctional.
*
/* XFM */
-/* used in struct dc_surface */
+/* used in struct dc_plane_state */
struct scaling_taps {
uint32_t v_taps;
uint32_t h_taps;
#include "grph_object_defs.h"
/* forward declarations */
-struct dc_surface;
+struct dc_plane_state;
struct dc_stream;
struct dc_link;
struct dc_sink;
}
/* Only use LUT for 8 bit formats */
-bool dce_use_lut(const struct dc_surface *surface)
+bool dce_use_lut(const struct dc_plane_state *surface)
{
switch (surface->format) {
case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
struct clock_source *clk_src,
unsigned int tg_inst);
-bool dce_use_lut(const struct dc_surface *surface);
+bool dce_use_lut(const struct dc_plane_state *surface);
#endif /*__DCE_HWSEQ_H__*/
*pool = NULL;
}
-enum dc_status dce100_validate_surface(const struct dc_surface *surface)
+enum dc_status dce100_validate_plane(const struct dc_plane_state *plane_state)
{
- if (surface->format < SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
+ if (plane_state->format < SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
return DC_OK;
return DC_FAIL_SURFACE_VALIDATE;
.validate_with_context = dce100_validate_with_context,
.validate_guaranteed = dce100_validate_guaranteed,
.validate_bandwidth = dce100_validate_bandwidth,
- .validate_surface = dce100_validate_surface,
+ .validate_plane = dce100_validate_plane,
};
static bool construct(
uint8_t num_virtual_links,
struct core_dc *dc);
-enum dc_status dce100_validate_surface(const struct dc_surface *surface);
+enum dc_status dce100_validate_plane(const struct dc_plane_state *plane_state);
#endif /* DCE100_RESOURCE_H_ */
}
static void build_prescale_params(struct ipp_prescale_params *prescale_params,
- const struct dc_surface *surface)
+ const struct dc_plane_state *surface)
{
prescale_params->mode = IPP_PRESCALE_MODE_FIXED_UNSIGNED;
static bool dce110_set_input_transfer_func(
struct pipe_ctx *pipe_ctx,
- const struct dc_surface *surface)
+ const struct dc_plane_state *surface)
{
struct input_pixel_processor *ipp = pipe_ctx->ipp;
const struct dc_transfer_func *tf = NULL;
struct resource_context *res_ctx)
{
struct mem_input *mi = pipe_ctx->mi;
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
struct xfm_grph_csc_adjustment adjust;
struct out_csc_color_matrix tbl_entry;
unsigned int i;
static void update_plane_addr(const struct core_dc *dc,
struct pipe_ctx *pipe_ctx)
{
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
if (surface == NULL)
return;
void dce110_update_pending_status(struct pipe_ctx *pipe_ctx)
{
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
if (surface == NULL)
return;
{
struct mem_input *mi = pipe_ctx->mi;
struct pipe_ctx *old_pipe = NULL;
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
struct xfm_grph_csc_adjustment adjust;
struct out_csc_color_matrix tbl_entry;
unsigned int i;
static void dce110_apply_ctx_for_surface(
struct core_dc *dc,
- const struct dc_surface *surface,
+ const struct dc_plane_state *surface,
struct validate_context *context)
{
int i;
.validate_with_context = dce112_validate_with_context,
.validate_guaranteed = dce112_validate_guaranteed,
.validate_bandwidth = dce112_validate_bandwidth,
- .validate_surface = dce100_validate_surface
+ .validate_plane = dce100_validate_plane
};
static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
.validate_with_context = dce112_validate_with_context,
.validate_guaranteed = dce112_validate_guaranteed,
.validate_bandwidth = dce112_validate_bandwidth,
- .validate_surface = dce100_validate_surface
+ .validate_plane = dce100_validate_plane
};
static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
.validate_with_context = dce80_validate_with_context,
.validate_guaranteed = dce80_validate_guaranteed,
.validate_bandwidth = dce80_validate_bandwidth,
- .validate_surface = dce100_validate_surface
+ .validate_plane = dce100_validate_plane
};
static bool construct(
static bool patch_address_for_sbs_tb_stereo(
struct pipe_ctx *pipe_ctx, PHYSICAL_ADDRESS_LOC *addr)
{
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
bool sec_split = pipe_ctx->top_pipe &&
pipe_ctx->top_pipe->surface == pipe_ctx->surface;
if (sec_split && surface->address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
{
bool addr_patched = false;
PHYSICAL_ADDRESS_LOC addr;
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
if (surface == NULL)
return;
}
static bool dcn10_set_input_transfer_func(
- struct pipe_ctx *pipe_ctx, const struct dc_surface *surface)
+ struct pipe_ctx *pipe_ctx, const struct dc_plane_state *surface)
{
struct input_pixel_processor *ipp = pipe_ctx->ipp;
const struct dc_transfer_func *tf = NULL;
struct pipe_ctx *pipe_ctx,
struct validate_context *context)
{
- struct dc_surface *dc_surface = pipe_ctx->surface;
+ struct dc_plane_state *dc_surface = pipe_ctx->surface;
struct dce_hwseq *hws = dc->hwseq;
power_on_plane(dc->hwseq,
struct dce_hwseq *hws = dc->hwseq;
struct mem_input *mi = pipe_ctx->mi;
struct input_pixel_processor *ipp = pipe_ctx->ipp;
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
union plane_size size = surface->plane_size;
struct default_adjustment ocsc = {0};
struct mpcc_cfg mpcc_cfg = {0};
static void dcn10_apply_ctx_for_surface(
struct core_dc *dc,
- const struct dc_surface *surface,
+ const struct dc_plane_state *surface,
struct validate_context *context)
{
int i, be_idx;
void dcn10_update_pending_status(struct pipe_ctx *pipe_ctx)
{
- struct dc_surface *surface = pipe_ctx->surface;
+ struct dc_plane_state *surface = pipe_ctx->surface;
struct timing_generator *tg = pipe_ctx->tg;
if (surface->ctx->dc->debug.sanity_checks) {
#define MAX_CLOCK_SOURCES 7
-void enable_surface_flip_reporting(struct dc_surface *dc_surface,
+void enable_surface_flip_reporting(struct dc_plane_state *dc_surface,
uint32_t controller_id);
#include "grph_object_id.h"
const struct resource_pool *pool,
struct dc_stream *stream);
- enum dc_status (*validate_surface)(const struct dc_surface *surface);
+ enum dc_status (*validate_plane)(const struct dc_plane_state *plane_state);
};
struct audio_support{
};
struct pipe_ctx {
- struct dc_surface *surface;
+ struct dc_plane_state *surface;
struct dc_stream *stream;
struct mem_input *mi;
void (*apply_ctx_for_surface)(
struct core_dc *dc,
- const struct dc_surface *surface,
+ const struct dc_plane_state *surface,
struct validate_context *context);
void (*set_plane_config)(
bool (*set_input_transfer_func)(
struct pipe_ctx *pipe_ctx,
- const struct dc_surface *surface);
+ const struct dc_plane_state *surface);
bool (*set_output_transfer_func)(
struct pipe_ctx *pipe_ctx,
struct dc_stream *stream);
bool resource_attach_surfaces_to_context(
- struct dc_surface *const *surfaces,
+ struct dc_plane_state *const *surfaces,
int surface_count,
struct dc_stream *dc_stream,
struct validate_context *context,
void pre_surface_trace(
const struct dc *dc,
- const struct dc_surface *const *surfaces,
+ const struct dc_plane_state *const *surfaces,
int surface_count);
void update_surface_trace(