/* * Copyright 2020 Mauro Rossi <issor.oruam@gmail.com> * * 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 *
*/
/******************************************************************************* * Front End programming
******************************************************************************/
/******************************************************************************* * In order to turn on surface we will program * CRTC * * DCE6 has no bottom_pipe and no Blender HW * We need to set 'blank_target' to false in order to turn on the display * * |-----------|------------|---------| * |curr pipe | set_blank | | * |Surface |blank_target| CRCT | * |visibility | argument | | * |-----------|------------|---------| * | off | true | blank | * | on | false | unblank | * |-----------|------------|---------| *
******************************************************************************/ staticvoid dce60_program_surface_visibility(conststruct dc *dc, struct pipe_ctx *pipe_ctx)
{ bool blank_target = false;
/* DCE6 has no bottom_pipe and no Blender HW */
if (!pipe_ctx->plane_state->visible)
blank_target = true;
/* DCE6 skip dce_set_blender_mode() but then proceed to 'unblank' CRTC */
pipe_ctx->stream_res.tg->funcs->set_blank(pipe_ctx->stream_res.tg, blank_target);
switch (pipe_ctx->plane_res.scl_data.format) { case PIXEL_FORMAT_ARGB8888: /* set boarder color to red */
color->color_r_cr = color_value; break;
case PIXEL_FORMAT_ARGB2101010: /* set boarder color to blue */
color->color_b_cb = color_value; break; case PIXEL_FORMAT_420BPP8: /* set boarder color to green */
color->color_g_y = color_value; break; case PIXEL_FORMAT_420BPP10: /* set boarder color to yellow */
color->color_g_y = color_value;
color->color_r_cr = color_value; break; case PIXEL_FORMAT_FP16: /* set boarder color to white */
color->color_r_cr = color_value;
color->color_b_cb = color_value;
color->color_g_y = color_value; break; default: break;
}
}
staticvoid dce60_program_scaler(conststruct dc *dc, conststruct pipe_ctx *pipe_ctx)
{ struct tg_color color = {0};
if (pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color) { /* * The way 420 is packed, 2 channels carry Y component, 1 channel * alternate between Cb and Cr, so both channels need the pixel * value for Y
*/ if (pipe_ctx->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420)
color.color_r_cr = color.color_g_y;
if (dc->config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm(
pipe_ctx->plane_res.mi,
plane_state->format,
&plane_state->tiling_info,
plane_state->rotation);
/* Moved programming gamma from dc to hwss */ if (pipe_ctx->plane_state->update_flags.bits.full_update ||
pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
pipe_ctx->plane_state->update_flags.bits.gamma_change)
hws->funcs.set_input_transfer_func(dc, pipe_ctx, pipe_ctx->plane_state);
if (pipe_ctx->plane_state->update_flags.bits.full_update)
hws->funcs.set_output_transfer_func(dc, pipe_ctx, pipe_ctx->stream);
staticvoid dce60_apply_ctx_for_surface( struct dc *dc, conststruct dc_stream_state *stream, int num_planes, struct dc_state *context)
{ int i;
if (num_planes == 0) return;
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
for (i = 0; i < dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream != stream) continue;
/* Need to allocate mem before program front end for Fiji */
pipe_ctx->plane_res.mi->funcs->allocate_mem_input(
pipe_ctx->plane_res.mi,
pipe_ctx->stream->timing.h_total,
pipe_ctx->stream->timing.v_total,
pipe_ctx->stream->timing.pix_clk_100hz / 10,
context->stream_count);
dce60_program_front_end_for_pipe(dc, pipe_ctx);
dc->hwss.update_plane_addr(dc, pipe_ctx);
dce60_program_surface_visibility(dc, pipe_ctx);
}
if (dc->fbc_compressor)
dce60_enable_fbc(dc, context);
}
void dce60_hw_sequencer_construct(struct dc *dc)
{
dce110_hw_sequencer_construct(dc);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.