Commit 8aa111e3 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Alex Deucher

drm/amd/display/dc/dce110/dce110_mem_input_v: use swap macro in program_size_and_rotation

Make use of the swap macro instead of _manually_ swapping values
and remove unnecessary variable swap.

This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 99676f20
...@@ -237,26 +237,14 @@ static void program_size_and_rotation( ...@@ -237,26 +237,14 @@ static void program_size_and_rotation(
if (rotation == ROTATION_ANGLE_90 || if (rotation == ROTATION_ANGLE_90 ||
rotation == ROTATION_ANGLE_270) { rotation == ROTATION_ANGLE_270) {
uint32_t swap; swap(local_size.video.luma_size.x,
swap = local_size.video.luma_size.x; local_size.video.luma_size.y);
local_size.video.luma_size.x = swap(local_size.video.luma_size.width,
local_size.video.luma_size.y; local_size.video.luma_size.height);
local_size.video.luma_size.y = swap; swap(local_size.video.chroma_size.x,
local_size.video.chroma_size.y);
swap = local_size.video.luma_size.width; swap(local_size.video.chroma_size.width,
local_size.video.luma_size.width = local_size.video.chroma_size.height);
local_size.video.luma_size.height;
local_size.video.luma_size.height = swap;
swap = local_size.video.chroma_size.x;
local_size.video.chroma_size.x =
local_size.video.chroma_size.y;
local_size.video.chroma_size.y = swap;
swap = local_size.video.chroma_size.width;
local_size.video.chroma_size.width =
local_size.video.chroma_size.height;
local_size.video.chroma_size.height = swap;
} }
value = 0; value = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment