cregit-Linux how code gets into the kernel

Release 4.17 drivers/gpu/drm/amd/display/dc/core/dc_sink.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 "dm_helpers.h"
#include "core_types.h"

/*******************************************************************************
 * Private functions
 ******************************************************************************/


static void destruct(struct dc_sink *sink) { if (sink->dc_container_id) { kfree(sink->dc_container_id); sink->dc_container_id = NULL; } }

Contributors

PersonTokensPropCommitsCommitProp
Duke Du2268.75%125.00%
Harry Wentland1031.25%375.00%
Total32100.00%4100.00%


static bool construct(struct dc_sink *sink, const struct dc_sink_init_data *init_params) { struct dc_link *link = init_params->link; if (!link) return false; sink->sink_signal = init_params->sink_signal; sink->link = link; sink->ctx = link->ctx; sink->dongle_max_pix_clk = init_params->dongle_max_pix_clk; sink->converter_disable_audio = init_params->converter_disable_audio; sink->dc_container_id = NULL; return true; }

Contributors

PersonTokensPropCommitsCommitProp
Harry Wentland6883.95%360.00%
Reza Amini78.64%120.00%
Duke Du67.41%120.00%
Total81100.00%5100.00%

/******************************************************************************* * Public functions ******************************************************************************/
void dc_sink_retain(struct dc_sink *sink) { kref_get(&sink->refcount); }

Contributors

PersonTokensPropCommitsCommitProp
Harry Wentland1372.22%250.00%
Jerry (Fangzhi) Zuo316.67%125.00%
Dave Airlie211.11%125.00%
Total18100.00%4100.00%


static void dc_sink_free(struct kref *kref) { struct dc_sink *sink = container_of(kref, struct dc_sink, refcount); destruct(sink); kfree(sink); }

Contributors

PersonTokensPropCommitsCommitProp
Dave Airlie2158.33%125.00%
Harry Wentland822.22%125.00%
Andrey Grodzovsky411.11%125.00%
Jerry (Fangzhi) Zuo38.33%125.00%
Total36100.00%4100.00%


void dc_sink_release(struct dc_sink *sink) { kref_put(&sink->refcount, dc_sink_free); }

Contributors

PersonTokensPropCommitsCommitProp
Dave Airlie1365.00%150.00%
Harry Wentland735.00%150.00%
Total20100.00%2100.00%


struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params) { struct dc_sink *sink = kzalloc(sizeof(*sink), GFP_KERNEL); if (NULL == sink) goto alloc_fail; if (false == construct(sink, init_params)) goto construct_fail; kref_init(&sink->refcount); return sink; construct_fail: kfree(sink); alloc_fail: return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Harry Wentland7093.33%360.00%
Jerry (Fangzhi) Zuo34.00%120.00%
Dave Airlie22.67%120.00%
Total75100.00%5100.00%

/******************************************************************************* * Protected functions - visible only inside of DC (not visible in DM) ******************************************************************************/

Overall Contributors

PersonTokensPropCommitsCommitProp
Harry Wentland18968.73%444.44%
Dave Airlie3813.82%111.11%
Duke Du2810.18%111.11%
Jerry (Fangzhi) Zuo93.27%111.11%
Reza Amini72.55%111.11%
Andrey Grodzovsky41.45%111.11%
Total275100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.