Commit c9614aeb authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher
Browse files

drm/amd/display: Rename dc_surface to dc_plane_state



find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/struct dc_surface/struct dc_plane_state/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/struct dc_plane_state_update/struct dc_surface_update/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/struct dc_plane_state_status/struct dc_surface_status/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/struct dc_plane_state_dcc_cap/struct dc_surface_dcc_cap/g'

Signed-off-by: default avatarHarry Wentland <harry.wentland@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 43193c79
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1819,7 +1819,7 @@ static int dm_crtc_cursor_move(struct drm_crtc *crtc,

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;
@@ -1894,7 +1894,7 @@ static int get_fb_info(

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;
@@ -2048,7 +2048,7 @@ static int fill_plane_attributes_from_fb(

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;
@@ -2072,7 +2072,7 @@ static void fill_gamma_from_crtc_state(

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)
@@ -3059,7 +3059,7 @@ static int dm_plane_helper_prepare_fb(

	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);
@@ -3160,7 +3160,7 @@ int dm_plane_atomic_check(struct drm_plane *plane,
	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;
@@ -3926,7 +3926,7 @@ static void amdgpu_dm_commit_surfaces(struct drm_atomic_state *state,
	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;
@@ -4377,7 +4377,7 @@ static uint32_t add_val_sets_surface(
	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;

@@ -4699,7 +4699,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,

			pflip_needed = !state->allow_modeset;
			if (!pflip_needed) {
				struct dc_surface *surface;
				struct dc_plane_state *surface;

				surface = dc_create_surface(dc);

+2 −2
Original line number Diff line number Diff line
@@ -189,14 +189,14 @@ struct amdgpu_connector *amdgpu_dm_find_first_crct_matching_connector(
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 {
+9 −9
Original line number Diff line number Diff line
@@ -645,7 +645,7 @@ static bool is_validation_required(
			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];
@@ -684,7 +684,7 @@ static bool validate_surfaces(

	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;
@@ -978,7 +978,7 @@ static bool dc_commit_context_no_check(struct dc *dc, struct validate_context *c
		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);
@@ -1136,7 +1136,7 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)

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)
{
@@ -1220,7 +1220,7 @@ void dc_release_validate_context(struct validate_context *context)

static bool is_surface_in_context(
		const struct validate_context *context,
		const struct dc_surface *surface)
		const struct dc_plane_state *surface)
{
	int j;

@@ -1470,7 +1470,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,
		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;
@@ -1496,7 +1496,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,

	/* 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;
@@ -1599,7 +1599,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,

	/* 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];
@@ -1649,7 +1649,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,

	/* 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(
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@

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;
@@ -46,7 +46,7 @@ void pre_surface_trace(
	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);

+11 −11
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ static void rect_swap_helper(struct rect *rect)

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;
@@ -529,7 +529,7 @@ static void calculate_viewport(struct pipe_ctx *pipe_ctx)

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;
@@ -607,7 +607,7 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skip

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;
@@ -814,7 +814,7 @@ static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx, struct view *r

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;
@@ -1028,7 +1028,7 @@ static int acquire_first_split_pipe(
#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,
@@ -1075,7 +1075,7 @@ bool resource_attach_surfaces_to_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);

@@ -1351,7 +1351,7 @@ bool resource_is_stream_unchanged(
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;
@@ -2055,7 +2055,7 @@ static void set_spd_info_packet(

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;
@@ -2534,13 +2534,13 @@ bool dc_validate_stream(const struct dc *dc, struct dc_stream *stream)
	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;
}
Loading