return ret;
}
-static bool set_gamut_remap(struct dc *dc,
- const struct dc_stream **stream, int num_streams)
+static bool set_gamut_remap(struct dc *dc, const struct dc_stream *stream)
{
struct core_dc *core_dc = DC_TO_CORE(dc);
- struct core_stream *core_stream = DC_STREAM_TO_CORE(stream[0]);
+ struct core_stream *core_stream = DC_STREAM_TO_CORE(stream);
int i = 0;
bool ret = false;
struct pipe_ctx *pipes;
overall_type = type;
if (u->in_transfer_func ||
- u->out_transfer_func ||
u->hdr_static_metadata) {
if (overall_type < UPDATE_TYPE_MED)
overall_type = UPDATE_TYPE_MED;
/* update current stream with the new updates */
if (stream_update) {
- stream->public.src = stream_update->src;
- stream->public.dst = stream_update->dst;
+ if ((stream_update->src.height != 0) &&
+ (stream_update->src.width != 0))
+ stream->public.src = stream_update->src;
+
+ if ((stream_update->dst.height != 0) &&
+ (stream_update->dst.width != 0))
+ stream->public.dst = stream_update->dst;
+
+ if (stream_update->out_transfer_func &&
+ stream_update->out_transfer_func !=
+ dc_stream->out_transfer_func) {
+ if (stream_update->out_transfer_func->type !=
+ TF_TYPE_UNKNOWN) {
+ if (dc_stream->out_transfer_func != NULL)
+ dc_transfer_func_release
+ (dc_stream->out_transfer_func);
+ dc_transfer_func_retain(stream_update->
+ out_transfer_func);
+ stream->public.out_transfer_func =
+ stream_update->out_transfer_func;
+ }
+ }
}
/* save update parameters into surface */
srf_updates[i].in_transfer_func;
}
- if (srf_updates[i].out_transfer_func &&
- srf_updates[i].out_transfer_func != dc_stream->out_transfer_func) {
- if (dc_stream->out_transfer_func != NULL)
- dc_transfer_func_release(dc_stream->out_transfer_func);
- dc_transfer_func_retain(srf_updates[i].out_transfer_func);
- stream->public.out_transfer_func = srf_updates[i].out_transfer_func;
- }
if (srf_updates[i].hdr_static_metadata)
surface->public.hdr_static_ctx =
*(srf_updates[i].hdr_static_metadata);
pipe_ctx, pipe_ctx->surface);
if (is_new_pipe_surface ||
- srf_updates[i].out_transfer_func)
+ (stream_update != NULL &&
+ stream_update->out_transfer_func !=
+ NULL)) {
core_dc->hwss.set_output_transfer_func(
- pipe_ctx,
- pipe_ctx->surface,
- pipe_ctx->stream);
+ pipe_ctx, pipe_ctx->stream);
+ }
if (srf_updates[i].hdr_static_metadata) {
resource_build_info_frame(pipe_ctx);
const struct rect *dst);
bool (*set_gamut_remap)(struct dc *dc,
- const struct dc_stream **stream, int num_streams);
+ const struct dc_stream *stream);
void (*set_static_screen_events)(struct dc *dc,
const struct dc_stream **stream,
enum dc_transfer_func_type {
TF_TYPE_PREDEFINED,
TF_TYPE_DISTRIBUTED_POINTS,
- TF_TYPE_BYPASS
+ TF_TYPE_BYPASS,
+ TF_TYPE_UNKNOWN
};
struct dc_transfer_func_distributed_points {
*/
/* gamma TO BE REMOVED */
struct dc_gamma *gamma;
- struct dc_hdr_static_metadata *hdr_static_metadata;
struct dc_transfer_func *in_transfer_func;
- struct dc_transfer_func *out_transfer_func;
-
-
+ struct dc_hdr_static_metadata *hdr_static_metadata;
};
/*
* This structure is filled in by dc_surface_get_status and contains
};
struct dc_stream_update {
-
struct rect src;
-
struct rect dst;
-
+ struct dc_transfer_func *out_transfer_func;
};