Release 4.15 drivers/gpu/drm/amd/display/dc/core/dc_surface.c
  
  
  
/*
 * Copyright 2015 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
 *
 */
/* DC interface (public) */
#include "dm_services.h"
#include "dc.h"
/* DC core (private) */
#include "core_types.h"
#include "transform.h"
#include "dpp.h"
/*******************************************************************************
 * Private functions
 ******************************************************************************/
static void construct(struct dc_context *ctx, struct dc_plane_state *plane_state)
{
	plane_state->ctx = ctx;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 21 | 95.45% | 3 | 75.00% | 
| Dave Airlie | 1 | 4.55% | 1 | 25.00% | 
| Total | 22 | 100.00% | 4 | 100.00% | 
static void destruct(struct dc_plane_state *plane_state)
{
	if (plane_state->gamma_correction != NULL) {
		dc_gamma_release(&plane_state->gamma_correction);
	}
	if (plane_state->in_transfer_func != NULL) {
		dc_transfer_func_release(
				plane_state->in_transfer_func);
		plane_state->in_transfer_func = NULL;
	}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Amy Zhang | 15 | 28.85% | 1 | 14.29% | 
| Harry Wentland | 14 | 26.92% | 3 | 42.86% | 
| Anthony Koo | 13 | 25.00% | 1 | 14.29% | 
| Yongqiang Sun | 10 | 19.23% | 2 | 28.57% | 
| Total | 52 | 100.00% | 7 | 100.00% | 
/*******************************************************************************
 * Public functions
 ******************************************************************************/
void enable_surface_flip_reporting(struct dc_plane_state *plane_state,
		uint32_t controller_id)
{
	plane_state->irq_source = controller_id + DC_IRQ_SOURCE_PFLIP1 - 1;
	/*register_flip_interrupt(surface);*/
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 24 | 100.00% | 3 | 100.00% | 
| Total | 24 | 100.00% | 3 | 100.00% | 
struct dc_plane_state *dc_create_plane_state(struct dc *dc)
{
	struct dc *core_dc = dc;
	struct dc_plane_state *plane_state = kzalloc(sizeof(*plane_state),
						     GFP_KERNEL);
	if (NULL == plane_state)
		return NULL;
	kref_init(&plane_state->refcount);
	construct(core_dc->ctx, plane_state);
	return plane_state;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 51 | 79.69% | 4 | 57.14% | 
| Dave Airlie | 12 | 18.75% | 2 | 28.57% | 
| Bhawanpreet Lakha | 1 | 1.56% | 1 | 14.29% | 
| Total | 64 | 100.00% | 7 | 100.00% | 
const struct dc_plane_status *dc_plane_get_status(
		const struct dc_plane_state *plane_state)
{
	const struct dc_plane_status *plane_status;
	struct dc  *core_dc;
	int i;
	if (!plane_state ||
		!plane_state->ctx ||
		!plane_state->ctx->dc) {
		ASSERT(0);
		return NULL; /* remove this if above assert never hit */
	}
	plane_status = &plane_state->status;
	core_dc = plane_state->ctx->dc;
	if (core_dc->current_state == NULL)
		return NULL;
	for (i = 0; i < core_dc->res_pool->pipe_count; i++) {
		struct pipe_ctx *pipe_ctx =
				&core_dc->current_state->res_ctx.pipe_ctx[i];
		if (pipe_ctx->plane_state != plane_state)
			continue;
		core_dc->hwss.update_pending_status(pipe_ctx);
	}
	return plane_status;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 119 | 85.61% | 4 | 50.00% | 
| Tony Cheng | 17 | 12.23% | 2 | 25.00% | 
| Jerry (Fangzhi) Zuo | 2 | 1.44% | 1 | 12.50% | 
| Bhawanpreet Lakha | 1 | 0.72% | 1 | 12.50% | 
| Total | 139 | 100.00% | 8 | 100.00% | 
void dc_plane_state_retain(struct dc_plane_state *plane_state)
{
	kref_get(&plane_state->refcount);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 13 | 72.22% | 3 | 60.00% | 
| Jerry (Fangzhi) Zuo | 3 | 16.67% | 1 | 20.00% | 
| Dave Airlie | 2 | 11.11% | 1 | 20.00% | 
| Total | 18 | 100.00% | 5 | 100.00% | 
static void dc_plane_state_free(struct kref *kref)
{
	struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount);
	destruct(plane_state);
	kfree(plane_state);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Dave Airlie | 21 | 58.33% | 1 | 20.00% | 
| Harry Wentland | 9 | 25.00% | 2 | 40.00% | 
| Andrey Grodzovsky | 3 | 8.33% | 1 | 20.00% | 
| Jerry (Fangzhi) Zuo | 3 | 8.33% | 1 | 20.00% | 
| Total | 36 | 100.00% | 5 | 100.00% | 
void dc_plane_state_release(struct dc_plane_state *plane_state)
{
	kref_put(&plane_state->refcount, dc_plane_state_free);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Dave Airlie | 13 | 65.00% | 1 | 33.33% | 
| Harry Wentland | 7 | 35.00% | 2 | 66.67% | 
| Total | 20 | 100.00% | 3 | 100.00% | 
void dc_gamma_retain(struct dc_gamma *gamma)
{
	kref_get(&gamma->refcount);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 9 | 50.00% | 2 | 40.00% | 
| Andrey Grodzovsky | 4 | 22.22% | 1 | 20.00% | 
| Dave Airlie | 3 | 16.67% | 1 | 20.00% | 
| Jerry (Fangzhi) Zuo | 2 | 11.11% | 1 | 20.00% | 
| Total | 18 | 100.00% | 5 | 100.00% | 
static void dc_gamma_free(struct kref *kref)
{
	struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount);
	kfree(gamma);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Dave Airlie | 26 | 83.87% | 1 | 33.33% | 
| Harry Wentland | 3 | 9.68% | 1 | 33.33% | 
| Jerry (Fangzhi) Zuo | 2 | 6.45% | 1 | 33.33% | 
| Total | 31 | 100.00% | 3 | 100.00% | 
void dc_gamma_release(struct dc_gamma **gamma)
{
	kref_put(&(*gamma)->refcount, dc_gamma_free);
	*gamma = NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 18 | 62.07% | 2 | 40.00% | 
| Yongqiang Sun | 5 | 17.24% | 1 | 20.00% | 
| Dave Airlie | 4 | 13.79% | 1 | 20.00% | 
| Jerry (Fangzhi) Zuo | 2 | 6.90% | 1 | 20.00% | 
| Total | 29 | 100.00% | 5 | 100.00% | 
struct dc_gamma *dc_create_gamma(void)
{
	struct dc_gamma *gamma = kzalloc(sizeof(*gamma), GFP_KERNEL);
	if (gamma == NULL)
		goto alloc_fail;
	kref_init(&gamma->refcount);
	return gamma;
alloc_fail:
	return NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 37 | 74.00% | 3 | 42.86% | 
| Dave Airlie | 5 | 10.00% | 2 | 28.57% | 
| Anthony Koo | 5 | 10.00% | 1 | 14.29% | 
| Jerry (Fangzhi) Zuo | 3 | 6.00% | 1 | 14.29% | 
| Total | 50 | 100.00% | 7 | 100.00% | 
void dc_transfer_func_retain(struct dc_transfer_func *tf)
{
	kref_get(&tf->refcount);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Anthony Koo | 8 | 44.44% | 1 | 20.00% | 
| Andrey Grodzovsky | 4 | 22.22% | 1 | 20.00% | 
| Dave Airlie | 3 | 16.67% | 1 | 20.00% | 
| Jerry (Fangzhi) Zuo | 2 | 11.11% | 1 | 20.00% | 
| Leo (Sunpeng) Li | 1 | 5.56% | 1 | 20.00% | 
| Total | 18 | 100.00% | 5 | 100.00% | 
static void dc_transfer_func_free(struct kref *kref)
{
	struct dc_transfer_func *tf = container_of(kref, struct dc_transfer_func, refcount);
	kfree(tf);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Dave Airlie | 26 | 83.87% | 1 | 33.33% | 
| Anthony Koo | 3 | 9.68% | 1 | 33.33% | 
| Jerry (Fangzhi) Zuo | 2 | 6.45% | 1 | 33.33% | 
| Total | 31 | 100.00% | 3 | 100.00% | 
void dc_transfer_func_release(struct dc_transfer_func *tf)
{
	kref_put(&tf->refcount, dc_transfer_func_free);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Anthony Koo | 13 | 65.00% | 1 | 25.00% | 
| Dave Airlie | 4 | 20.00% | 1 | 25.00% | 
| Jerry (Fangzhi) Zuo | 2 | 10.00% | 1 | 25.00% | 
| Leo (Sunpeng) Li | 1 | 5.00% | 1 | 25.00% | 
| Total | 20 | 100.00% | 4 | 100.00% | 
struct dc_transfer_func *dc_create_transfer_func(void)
{
	struct dc_transfer_func *tf = kzalloc(sizeof(*tf), GFP_KERNEL);
	if (tf == NULL)
		goto alloc_fail;
	kref_init(&tf->refcount);
	return tf;
alloc_fail:
	return NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Anthony Koo | 31 | 62.00% | 1 | 14.29% | 
| Harry Wentland | 10 | 20.00% | 2 | 28.57% | 
| Dave Airlie | 5 | 10.00% | 2 | 28.57% | 
| Jerry (Fangzhi) Zuo | 3 | 6.00% | 1 | 14.29% | 
| Leo (Sunpeng) Li | 1 | 2.00% | 1 | 14.29% | 
| Total | 50 | 100.00% | 7 | 100.00% | 
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Harry Wentland | 351 | 54.67% | 6 | 26.09% | 
| Dave Airlie | 125 | 19.47% | 5 | 21.74% | 
| Anthony Koo | 73 | 11.37% | 1 | 4.35% | 
| Jerry (Fangzhi) Zuo | 26 | 4.05% | 2 | 8.70% | 
| Tony Cheng | 17 | 2.65% | 2 | 8.70% | 
| Amy Zhang | 15 | 2.34% | 1 | 4.35% | 
| Yongqiang Sun | 15 | 2.34% | 2 | 8.70% | 
| Andrey Grodzovsky | 11 | 1.71% | 1 | 4.35% | 
| Yue Hin Lau | 3 | 0.47% | 1 | 4.35% | 
| Bhawanpreet Lakha | 3 | 0.47% | 1 | 4.35% | 
| Leo (Sunpeng) Li | 3 | 0.47% | 1 | 4.35% | 
| Total | 642 | 100.00% | 23 | 100.00% | 
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.