linux/drivers/gpu/drm/amd/display/dc/core/dc_stream.c

/*
 * Copyright 2012-15 Advanced Micro Devices, Inc.
 *
 * 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
 *
 */

#include "dm_services.h"
#include "basics/dc_common.h"
#include "dc.h"
#include "core_types.h"
#include "resource.h"
#include "ipp.h"
#include "timing_generator.h"
#include "dc_dmub_srv.h"
#include "dc_state_priv.h"
#include "dc_stream_priv.h"

#define DC_LOGGER
#ifndef MIN
#define MIN
#define MAX
#endif

/*******************************************************************************
 * Private functions
 ******************************************************************************/
void update_stream_signal(struct dc_stream_state *stream, struct dc_sink *sink)
{}

bool dc_stream_construct(struct dc_stream_state *stream,
	struct dc_sink *dc_sink_data)
{}

void dc_stream_destruct(struct dc_stream_state *stream)
{}

void dc_stream_assign_stream_id(struct dc_stream_state *stream)
{}

void dc_stream_retain(struct dc_stream_state *stream)
{}

static void dc_stream_free(struct kref *kref)
{}

void dc_stream_release(struct dc_stream_state *stream)
{}

struct dc_stream_state *dc_create_stream_for_sink(
		struct dc_sink *sink)
{}

struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream)
{}

/**
 * dc_stream_get_status() - Get current stream status of the given stream state
 * @stream: The stream to get the stream status for.
 *
 * The given stream is expected to exist in dc->current_state. Otherwise, NULL
 * will be returned.
 */
struct dc_stream_status *dc_stream_get_status(
	struct dc_stream_state *stream)
{}

void program_cursor_attributes(
	struct dc *dc,
	struct dc_stream_state *stream)
{}

/*
 * dc_stream_set_cursor_attributes() - Update cursor attributes and set cursor surface address
 */
bool dc_stream_set_cursor_attributes(
	struct dc_stream_state *stream,
	const struct dc_cursor_attributes *attributes)
{}

bool dc_stream_program_cursor_attributes(
	struct dc_stream_state *stream,
	const struct dc_cursor_attributes *attributes)
{}

void program_cursor_position(
	struct dc *dc,
	struct dc_stream_state *stream)
{}

bool dc_stream_set_cursor_position(
	struct dc_stream_state *stream,
	const struct dc_cursor_position *position)
{}

bool dc_stream_program_cursor_position(
	struct dc_stream_state *stream,
	const struct dc_cursor_position *position)
{}

bool dc_stream_add_writeback(struct dc *dc,
		struct dc_stream_state *stream,
		struct dc_writeback_info *wb_info)
{}

bool dc_stream_fc_disable_writeback(struct dc *dc,
		struct dc_stream_state *stream,
		uint32_t dwb_pipe_inst)
{}

bool dc_stream_remove_writeback(struct dc *dc,
		struct dc_stream_state *stream,
		uint32_t dwb_pipe_inst)
{}

bool dc_stream_warmup_writeback(struct dc *dc,
		int num_dwb,
		struct dc_writeback_info *wb_info)
{}
uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
{}

bool dc_stream_send_dp_sdp(const struct dc_stream_state *stream,
		const uint8_t *custom_sdp_message,
		unsigned int sdp_message_size)
{}

bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
				  uint32_t *v_blank_start,
				  uint32_t *v_blank_end,
				  uint32_t *h_position,
				  uint32_t *v_position)
{}

bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
{}

bool dc_stream_set_dynamic_metadata(struct dc *dc,
		struct dc_stream_state *stream,
		struct dc_dmdata_attributes *attr)
{}

enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc,
		struct dc_state *state,
		struct dc_stream_state *stream)
{}

struct pipe_ctx *dc_stream_get_pipe_ctx(struct dc_stream_state *stream)
{}

void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream)
{}

/*
 * Finds the greatest index in refresh_rate_hz that contains a value <= refresh
 */
static int dc_stream_get_nearest_smallest_index(struct dc_stream_state *stream, int refresh)
{}

/*
 * Finds a corresponding brightness for a given refresh rate between 2 given indices, where index1 < index2
 */
static int dc_stream_get_brightness_millinits_linear_interpolation (struct dc_stream_state *stream,
								     int index1,
								     int index2,
								     int refresh_hz)
{}

/*
 * Finds a corresponding refresh rate for a given brightness between 2 given indices, where index1 < index2
 */
static int dc_stream_get_refresh_hz_linear_interpolation (struct dc_stream_state *stream,
							   int index1,
							   int index2,
							   int brightness_millinits)
{}

/*
 * Finds the current brightness in millinits given a refresh rate
 */
static int dc_stream_get_brightness_millinits_from_refresh (struct dc_stream_state *stream, int refresh_hz)
{}

/*
 * Finds the lowest/highest refresh rate (depending on search_for_max_increase)
 * that can be achieved from starting_refresh_hz while staying
 * within flicker criteria
 */
static int dc_stream_calculate_flickerless_refresh_rate(struct dc_stream_state *stream,
							 int current_brightness,
							 int starting_refresh_hz,
							 bool is_gaming,
							 bool search_for_max_increase)
{}

/*
 * Gets the max delta luminance within a specified refresh range
 */
static int dc_stream_get_max_delta_lumin_millinits(struct dc_stream_state *stream, int hz1, int hz2, bool isGaming)
{}

/*
 * Determines the max flickerless instant vtotal delta for a stream.
 * Determines vtotal increase/decrease based on the bool "increase"
 */
static unsigned int dc_stream_get_max_flickerless_instant_vtotal_delta(struct dc_stream_state *stream, bool is_gaming, bool increase)
{}

/*
 * Finds the highest refresh rate that can be achieved
 * from starting_refresh_hz while staying within flicker criteria
 */
int dc_stream_calculate_max_flickerless_refresh_rate(struct dc_stream_state *stream, int starting_refresh_hz, bool is_gaming)
{}

/*
 * Finds the lowest refresh rate that can be achieved
 * from starting_refresh_hz while staying within flicker criteria
 */
int dc_stream_calculate_min_flickerless_refresh_rate(struct dc_stream_state *stream, int starting_refresh_hz, bool is_gaming)
{}

/*
 * Determines if there will be a flicker when moving between 2 refresh rates
 */
bool dc_stream_is_refresh_rate_range_flickerless(struct dc_stream_state *stream, int hz1, int hz2, bool is_gaming)
{}

/*
 * Determines the max instant vtotal delta increase that can be applied without
 * flickering for a given stream
 */
unsigned int dc_stream_get_max_flickerless_instant_vtotal_decrease(struct dc_stream_state *stream,
									  bool is_gaming)
{}

/*
 * Determines the max instant vtotal delta decrease that can be applied without
 * flickering for a given stream
 */
unsigned int dc_stream_get_max_flickerless_instant_vtotal_increase(struct dc_stream_state *stream,
									  bool is_gaming)
{}