summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLeo (Sunpeng) Li2017-07-26 22:13:48 +0200
committerAlex Deucher2017-09-27 00:15:47 +0200
commita989ab08a7e3ee4675ea56b5dcfd0f2966aa91db (patch)
tree7c68103720eb92cf43f77246f4e358168cdd248c /drivers/gpu
parentdrm/amd/display: Roll core_stream into dc_stream (diff)
downloadkernel-qcow2-linux-a989ab08a7e3ee4675ea56b5dcfd0f2966aa91db.tar.gz
kernel-qcow2-linux-a989ab08a7e3ee4675ea56b5dcfd0f2966aa91db.tar.xz
kernel-qcow2-linux-a989ab08a7e3ee4675ea56b5dcfd0f2966aa91db.zip
drm/amd/display: Roll stream into dc_stream
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 46ad1bc12f63..a77e1e80d7c2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -31,17 +31,6 @@
#include "timing_generator.h"
/*******************************************************************************
- * Private definitions
- ******************************************************************************/
-
-struct stream {
- struct dc_stream protected;
- int ref_count;
-};
-
-#define DC_STREAM_TO_STREAM(dc_stream) container_of(dc_stream, struct stream, protected)
-
-/*******************************************************************************
* Private functions
******************************************************************************/
@@ -105,24 +94,22 @@ static void destruct(struct dc_stream *stream)
}
}
-void dc_stream_retain(struct dc_stream *dc_stream)
+void dc_stream_retain(struct dc_stream *stream)
{
- struct stream *stream = DC_STREAM_TO_STREAM(dc_stream);
ASSERT(stream->ref_count > 0);
stream->ref_count++;
}
-void dc_stream_release(struct dc_stream *public)
+void dc_stream_release(struct dc_stream *stream)
{
- struct stream *stream = DC_STREAM_TO_STREAM(public);
- if (public != NULL) {
+ if (stream != NULL) {
ASSERT(stream->ref_count > 0);
stream->ref_count--;
if (stream->ref_count == 0) {
- destruct(public);
+ destruct(stream);
dm_free(stream);
}
}
@@ -131,22 +118,22 @@ void dc_stream_release(struct dc_stream *public)
struct dc_stream *dc_create_stream_for_sink(
struct dc_sink *sink)
{
- struct stream *stream;
+ struct dc_stream *stream;
if (sink == NULL)
goto alloc_fail;
- stream = dm_alloc(sizeof(struct stream));
+ stream = dm_alloc(sizeof(struct dc_stream));
if (NULL == stream)
goto alloc_fail;
- if (false == construct(&stream->protected, sink))
+ if (false == construct(stream, sink))
goto construct_fail;
stream->ref_count++;
- return &stream->protected;
+ return stream;
construct_fail:
dm_free(stream);