aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Abriou <vincent.abriou@st.com>2015-10-22 04:35:50 -0400
committerVincent Abriou <vincent.abriou@st.com>2015-11-03 07:04:55 -0500
commit5260fb5b33ffad7b3c1cd84dc260f4d51ef453c0 (patch)
tree1f85537d3c5baa7d45a64ceba2a705766d7a5fcc
parentb5d34a272d37c08612aaea9601ddd311757fd149 (diff)
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: Vincent Abriou <vincent.abriou@st.com> Signed-off-by: Nicolas VANHAELEWYN <nicolas.vanhaelewyn@st.com>
-rw-r--r--drivers/gpu/drm/sti/sti_mixer.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index 4c18b50d71c5..49db835dce03 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -10,6 +10,11 @@
10#include "sti_mixer.h" 10#include "sti_mixer.h"
11#include "sti_vtg.h" 11#include "sti_vtg.h"
12 12
13/* Module parameter to set the background color of the mixer */
14static unsigned int bkg_color = 0x000000;
15MODULE_PARM_DESC(bkgcolor, "Value of the background color 0xRRGGBB");
16module_param_named(bkgcolor, bkg_color, int, 0644);
17
13/* Identity: G=Y , B=Cb , R=Cr */ 18/* Identity: G=Y , B=Cb , R=Cr */
14static const u32 mixerColorSpaceMatIdentity[] = { 19static const u32 mixerColorSpaceMatIdentity[] = {
15 0x10000000, 0x00000000, 0x10000000, 0x00001000, 20 0x10000000, 0x00000000, 0x10000000, 0x00001000,
@@ -80,11 +85,9 @@ void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
80} 85}
81 86
82static void sti_mixer_set_background_color(struct sti_mixer *mixer, 87static void sti_mixer_set_background_color(struct sti_mixer *mixer,
83 u8 red, u8 green, u8 blue) 88 unsigned int rgb)
84{ 89{
85 u32 val = (red << 16) | (green << 8) | blue; 90 sti_mixer_reg_write(mixer, GAM_MIXER_BKC, rgb);
86
87 sti_mixer_reg_write(mixer, GAM_MIXER_BKC, val);
88} 91}
89 92
90static void sti_mixer_set_background_area(struct sti_mixer *mixer, 93static 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 sti_mixer_reg_write(mixer, GAM_MIXER_AVO, ydo << 16 | xdo); 177 sti_mixer_reg_write(mixer, GAM_MIXER_AVO, ydo << 16 | xdo);
175 sti_mixer_reg_write(mixer, GAM_MIXER_AVS, yds << 16 | xds); 178 sti_mixer_reg_write(mixer, GAM_MIXER_AVS, yds << 16 | xds);
176 179
177 sti_mixer_set_background_color(mixer, 0xFF, 0, 0); 180 sti_mixer_set_background_color(mixer, bkg_color);
178 181
179 sti_mixer_set_background_area(mixer, mode); 182 sti_mixer_set_background_area(mixer, mode);
180 sti_mixer_set_background_status(mixer, true); 183 sti_mixer_set_background_status(mixer, true);