Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AngeloGioacchino Del Regno
linux
Commits
636fcbd6
Unverified
Commit
636fcbd6
authored
3 months ago
by
AngeloGioacchino Del Regno
Browse files
Options
Downloads
Patches
Plain Diff
mtk_dpi: Add more color formats
parent
a28831b0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/gpu/drm/mediatek/mtk_dpi.c
+29
-6
29 additions, 6 deletions
drivers/gpu/drm/mediatek/mtk_dpi.c
with
29 additions
and
6 deletions
drivers/gpu/drm/mediatek/mtk_dpi.c
+
29
−
6
View file @
636fcbd6
...
@@ -59,7 +59,12 @@ enum mtk_dpi_out_channel_swap {
...
@@ -59,7 +59,12 @@ enum mtk_dpi_out_channel_swap {
enum
mtk_dpi_out_color_format
{
enum
mtk_dpi_out_color_format
{
MTK_DPI_COLOR_FORMAT_RGB
,
MTK_DPI_COLOR_FORMAT_RGB
,
MTK_DPI_COLOR_FORMAT_YCBCR_422
MTK_DPI_COLOR_FORMAT_RGB_FULL
,
MTK_DPI_COLOR_FORMAT_YCBCR_444
,
MTK_DPI_COLOR_FORMAT_YCBCR_422
,
MTK_DPI_COLOR_FORMAT_XV_YCC
,
MTK_DPI_COLOR_FORMAT_YCBCR_444_FULL
,
MTK_DPI_COLOR_FORMAT_YCBCR_422_FULL
};
};
struct
mtk_dpi
{
struct
mtk_dpi
{
...
@@ -450,12 +455,19 @@ static void mtk_dpi_config_disable_edge(struct mtk_dpi *dpi)
...
@@ -450,12 +455,19 @@ static void mtk_dpi_config_disable_edge(struct mtk_dpi *dpi)
static
void
mtk_dpi_config_color_format
(
struct
mtk_dpi
*
dpi
,
static
void
mtk_dpi_config_color_format
(
struct
mtk_dpi
*
dpi
,
enum
mtk_dpi_out_color_format
format
)
enum
mtk_dpi_out_color_format
format
)
{
{
mtk_dpi_config_channel_swap
(
dpi
,
MTK_DPI_OUT_CHANNEL_SWAP_RGB
);
switch
(
format
)
{
case
MTK_DPI_COLOR_FORMAT_YCBCR_444
:
if
(
format
==
MTK_DPI_COLOR_FORMAT_YCBCR_422
)
{
case
MTK_DPI_COLOR_FORMAT_YCBCR_444_FULL
:
mtk_dpi_config_yuv422_enable
(
dpi
,
false
);
mtk_dpi_config_csc_enable
(
dpi
,
true
);
if
(
dpi
->
conf
->
swap_input_support
)
mtk_dpi_config_swap_input
(
dpi
,
false
);
mtk_dpi_config_channel_swap
(
dpi
,
MTK_DPI_OUT_CHANNEL_SWAP_BGR
);
break
;
case
MTK_DPI_COLOR_FORMAT_YCBCR_422
:
case
MTK_DPI_COLOR_FORMAT_YCBCR_422_FULL
:
mtk_dpi_config_yuv422_enable
(
dpi
,
true
);
mtk_dpi_config_yuv422_enable
(
dpi
,
true
);
mtk_dpi_config_csc_enable
(
dpi
,
true
);
mtk_dpi_config_csc_enable
(
dpi
,
true
);
/*
/*
* If height is smaller than 720, we need to use RGB_TO_BT601
* If height is smaller than 720, we need to use RGB_TO_BT601
* to transfer to yuv422. Otherwise, we use RGB_TO_JPEG.
* to transfer to yuv422. Otherwise, we use RGB_TO_JPEG.
...
@@ -463,11 +475,17 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
...
@@ -463,11 +475,17 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
mtk_dpi_mask
(
dpi
,
DPI_MATRIX_SET
,
dpi
->
mode
.
hdisplay
<=
720
?
mtk_dpi_mask
(
dpi
,
DPI_MATRIX_SET
,
dpi
->
mode
.
hdisplay
<=
720
?
MATRIX_SEL_RGB_TO_BT601
:
MATRIX_SEL_RGB_TO_JPEG
,
MATRIX_SEL_RGB_TO_BT601
:
MATRIX_SEL_RGB_TO_JPEG
,
INT_MATRIX_SEL_MASK
);
INT_MATRIX_SEL_MASK
);
}
else
{
if
(
dpi
->
conf
->
swap_input_support
)
mtk_dpi_config_swap_input
(
dpi
,
true
);
mtk_dpi_config_channel_swap
(
dpi
,
MTK_DPI_OUT_CHANNEL_SWAP_RGB
);
break
;
default:
mtk_dpi_config_yuv422_enable
(
dpi
,
false
);
mtk_dpi_config_yuv422_enable
(
dpi
,
false
);
mtk_dpi_config_csc_enable
(
dpi
,
false
);
mtk_dpi_config_csc_enable
(
dpi
,
false
);
if
(
dpi
->
conf
->
swap_input_support
)
if
(
dpi
->
conf
->
swap_input_support
)
mtk_dpi_config_swap_input
(
dpi
,
false
);
mtk_dpi_config_swap_input
(
dpi
,
false
);
mtk_dpi_config_channel_swap
(
dpi
,
MTK_DPI_OUT_CHANNEL_SWAP_RGB
);
break
;
}
}
}
}
...
@@ -1026,6 +1044,11 @@ static const u32 mt8183_output_fmts[] = {
...
@@ -1026,6 +1044,11 @@ static const u32 mt8183_output_fmts[] = {
MEDIA_BUS_FMT_RGB888_2X12_BE
,
MEDIA_BUS_FMT_RGB888_2X12_BE
,
};
};
static
const
u32
mt8195_dpi_output_fmts
[]
=
{
MEDIA_BUS_FMT_RGB888_2X12_LE
,
MEDIA_BUS_FMT_RGB888_2X12_BE
,
};
static
const
u32
mt8195_output_fmts
[]
=
{
static
const
u32
mt8195_output_fmts
[]
=
{
MEDIA_BUS_FMT_RGB888_1X24
,
MEDIA_BUS_FMT_RGB888_1X24
,
MEDIA_BUS_FMT_YUYV8_1X16
,
MEDIA_BUS_FMT_YUYV8_1X16
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment