Commit 5260fb5b authored by Vincent Abriou's avatar Vincent Abriou

drm/sti: set mixer background color through module param

Add bkgcolor module parameter that allow to change the background
color of the mixer. It can be set with an RGB value coded as 0xRRGGBB.
The default value is black.
Signed-off-by: default avatarVincent Abriou <vincent.abriou@st.com>
Signed-off-by: default avatarNicolas VANHAELEWYN <nicolas.vanhaelewyn@st.com>
parent b5d34a27
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
#include "sti_mixer.h" #include "sti_mixer.h"
#include "sti_vtg.h" #include "sti_vtg.h"
/* Module parameter to set the background color of the mixer */
static unsigned int bkg_color = 0x000000;
MODULE_PARM_DESC(bkgcolor, "Value of the background color 0xRRGGBB");
module_param_named(bkgcolor, bkg_color, int, 0644);
/* Identity: G=Y , B=Cb , R=Cr */ /* Identity: G=Y , B=Cb , R=Cr */
static const u32 mixerColorSpaceMatIdentity[] = { static const u32 mixerColorSpaceMatIdentity[] = {
0x10000000, 0x00000000, 0x10000000, 0x00001000, 0x10000000, 0x00000000, 0x10000000, 0x00001000,
...@@ -80,11 +85,9 @@ void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable) ...@@ -80,11 +85,9 @@ void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
} }
static void sti_mixer_set_background_color(struct sti_mixer *mixer, static void sti_mixer_set_background_color(struct sti_mixer *mixer,
u8 red, u8 green, u8 blue) unsigned int rgb)
{ {
u32 val = (red << 16) | (green << 8) | blue; sti_mixer_reg_write(mixer, GAM_MIXER_BKC, rgb);
sti_mixer_reg_write(mixer, GAM_MIXER_BKC, val);
} }
static void sti_mixer_set_background_area(struct sti_mixer *mixer, static void sti_mixer_set_background_area(struct sti_mixer *mixer,
...@@ -174,7 +177,7 @@ int sti_mixer_active_video_area(struct sti_mixer *mixer, ...@@ -174,7 +177,7 @@ int sti_mixer_active_video_area(struct sti_mixer *mixer,
sti_mixer_reg_write(mixer, GAM_MIXER_AVO, ydo << 16 | xdo); sti_mixer_reg_write(mixer, GAM_MIXER_AVO, ydo << 16 | xdo);
sti_mixer_reg_write(mixer, GAM_MIXER_AVS, yds << 16 | xds); sti_mixer_reg_write(mixer, GAM_MIXER_AVS, yds << 16 | xds);
sti_mixer_set_background_color(mixer, 0xFF, 0, 0); sti_mixer_set_background_color(mixer, bkg_color);
sti_mixer_set_background_area(mixer, mode); sti_mixer_set_background_area(mixer, mode);
sti_mixer_set_background_status(mixer, true); sti_mixer_set_background_status(mixer, true);
......
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