Contributors: 23
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Harry Wentland |
532 |
48.10% |
7 |
15.56% |
Dillon Varone |
127 |
11.48% |
4 |
8.89% |
Dave Airlie |
119 |
10.76% |
5 |
11.11% |
Anthony Koo |
90 |
8.14% |
4 |
8.89% |
Alex Deucher |
67 |
6.06% |
2 |
4.44% |
Jerry (Fangzhi) Zuo |
31 |
2.80% |
2 |
4.44% |
Tony Cheng |
21 |
1.90% |
2 |
4.44% |
Tomasz Siemek |
18 |
1.63% |
1 |
2.22% |
Wesley Chalmers |
13 |
1.18% |
1 |
2.22% |
Vitaly Prosyak |
12 |
1.08% |
2 |
4.44% |
Andrey Grodzovsky |
12 |
1.08% |
1 |
2.22% |
Sung Joon Kim |
12 |
1.08% |
2 |
4.44% |
rodrigosiqueira |
10 |
0.90% |
2 |
4.44% |
Alvin lee |
10 |
0.90% |
1 |
2.22% |
Michel Dänzer |
8 |
0.72% |
1 |
2.22% |
Yongqiang Sun |
5 |
0.45% |
1 |
2.22% |
Nicholas Kazlauskas |
5 |
0.45% |
1 |
2.22% |
Leo (Sunpeng) Li |
3 |
0.27% |
1 |
2.22% |
Colin Ian King |
3 |
0.27% |
1 |
2.22% |
Bhawanpreet Lakha |
3 |
0.27% |
1 |
2.22% |
Yue Hin Lau |
3 |
0.27% |
1 |
2.22% |
Krunoslav Kovac |
1 |
0.09% |
1 |
2.22% |
Lee Jones |
1 |
0.09% |
1 |
2.22% |
Total |
1106 |
|
45 |
|
/*
* 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"
#include "dc_plane_priv.h"
/*******************************************************************************
* Private functions
******************************************************************************/
void dc_plane_construct(struct dc_context *ctx, struct dc_plane_state *plane_state)
{
plane_state->ctx = ctx;
plane_state->gamma_correction.is_identity = true;
plane_state->in_transfer_func.type = TF_TYPE_BYPASS;
plane_state->in_shaper_func.type = TF_TYPE_BYPASS;
plane_state->lut3d_func.state.raw = 0;
plane_state->blend_tf.type = TF_TYPE_BYPASS;
plane_state->pre_multiplied_alpha = true;
}
void dc_plane_destruct(struct dc_plane_state *plane_state)
{
// no more pointers to free within dc_plane_state
}
/* dc_state is passed in separately since it may differ from the current dc state accessible from plane_state e.g.
* if the driver is doing an update from an old context to a new one and the caller wants the pipe mask for the new
* context rather than the existing one
*/
uint8_t dc_plane_get_pipe_mask(struct dc_state *dc_state, const struct dc_plane_state *plane_state)
{
uint8_t pipe_mask = 0;
int i;
for (i = 0; i < plane_state->ctx->dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx = &dc_state->res_ctx.pipe_ctx[i];
if (pipe_ctx->plane_state == plane_state && pipe_ctx->plane_res.hubp)
pipe_mask |= 1 << pipe_ctx->plane_res.hubp->inst;
}
return pipe_mask;
}
/*******************************************************************************
* Public functions
******************************************************************************/
struct dc_plane_state *dc_create_plane_state(const struct dc *dc)
{
struct dc_plane_state *plane_state = kvzalloc(sizeof(*plane_state),
GFP_KERNEL);
if (NULL == plane_state)
return NULL;
kref_init(&plane_state->refcount);
dc_plane_construct(dc->ctx, plane_state);
return plane_state;
}
/*
*****************************************************************************
* Function: dc_plane_get_status
*
* @brief
* Looks up the pipe context of plane_state and updates the pending status
* of the pipe context. Then returns plane_state->status
*
* @param [in] plane_state: pointer to the plane_state to get the status of
*****************************************************************************
*/
const struct dc_plane_status *dc_plane_get_status(
const struct dc_plane_state *plane_state,
union dc_plane_status_update_flags flags)
{
const struct dc_plane_status *plane_status;
struct dc *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;
dc = plane_state->ctx->dc;
if (dc->current_state == NULL)
return NULL;
/* Find the current plane state and set its pending bit to false */
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx =
&dc->current_state->res_ctx.pipe_ctx[i];
if (pipe_ctx->plane_state != plane_state)
continue;
if (pipe_ctx->plane_state && flags.bits.address)
pipe_ctx->plane_state->status.is_flip_pending = false;
break;
}
dc_exit_ips_for_hw_access(dc);
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx =
&dc->current_state->res_ctx.pipe_ctx[i];
if (pipe_ctx->plane_state != plane_state)
continue;
if (flags.bits.address)
dc->hwss.update_pending_status(pipe_ctx);
}
return plane_status;
}
void dc_plane_state_retain(struct dc_plane_state *plane_state)
{
kref_get(&plane_state->refcount);
}
static void dc_plane_state_free(struct kref *kref)
{
struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount);
dc_plane_destruct(plane_state);
kvfree(plane_state);
}
void dc_plane_state_release(struct dc_plane_state *plane_state)
{
kref_put(&plane_state->refcount, dc_plane_state_free);
}
void dc_gamma_retain(struct dc_gamma *gamma)
{
kref_get(&gamma->refcount);
}
static void dc_gamma_free(struct kref *kref)
{
struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount);
kvfree(gamma);
}
void dc_gamma_release(struct dc_gamma **gamma)
{
kref_put(&(*gamma)->refcount, dc_gamma_free);
*gamma = NULL;
}
struct dc_gamma *dc_create_gamma(void)
{
struct dc_gamma *gamma = kvzalloc(sizeof(*gamma), GFP_KERNEL);
if (gamma == NULL)
goto alloc_fail;
kref_init(&gamma->refcount);
return gamma;
alloc_fail:
return NULL;
}
void dc_transfer_func_retain(struct dc_transfer_func *tf)
{
kref_get(&tf->refcount);
}
static void dc_transfer_func_free(struct kref *kref)
{
struct dc_transfer_func *tf = container_of(kref, struct dc_transfer_func, refcount);
kvfree(tf);
}
void dc_transfer_func_release(struct dc_transfer_func *tf)
{
kref_put(&tf->refcount, dc_transfer_func_free);
}
struct dc_transfer_func *dc_create_transfer_func(void)
{
struct dc_transfer_func *tf = kvzalloc(sizeof(*tf), GFP_KERNEL);
if (tf == NULL)
goto alloc_fail;
kref_init(&tf->refcount);
return tf;
alloc_fail:
return NULL;
}
static void dc_3dlut_func_free(struct kref *kref)
{
struct dc_3dlut *lut = container_of(kref, struct dc_3dlut, refcount);
kvfree(lut);
}
struct dc_3dlut *dc_create_3dlut_func(void)
{
struct dc_3dlut *lut = kvzalloc(sizeof(*lut), GFP_KERNEL);
if (lut == NULL)
goto alloc_fail;
kref_init(&lut->refcount);
lut->state.raw = 0;
return lut;
alloc_fail:
return NULL;
}
void dc_3dlut_func_release(struct dc_3dlut *lut)
{
kref_put(&lut->refcount, dc_3dlut_func_free);
}
void dc_3dlut_func_retain(struct dc_3dlut *lut)
{
kref_get(&lut->refcount);
}
void dc_plane_force_dcc_and_tiling_disable(struct dc_plane_state *plane_state,
bool clear_tiling)
{
struct dc *dc;
int i;
if (!plane_state)
return;
dc = plane_state->ctx->dc;
if (!dc || !dc->current_state)
return;
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
if (!pipe_ctx)
continue;
if (dc->hwss.clear_surface_dcc_and_tiling)
dc->hwss.clear_surface_dcc_and_tiling(pipe_ctx, plane_state, clear_tiling);
}
}
void dc_plane_copy_config(struct dc_plane_state *dst, const struct dc_plane_state *src)
{
struct kref temp_refcount;
/* backup persistent info */
memcpy(&temp_refcount, &dst->refcount, sizeof(struct kref));
/* copy all configuration information */
memcpy(dst, src, sizeof(struct dc_plane_state));
/* restore persistent info */
memcpy(&dst->refcount, &temp_refcount, sizeof(struct kref));
}