diff options
| -rw-r--r-- | drivers/media/platform/vsp1/vsp1_bru.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_bru.c b/drivers/media/platform/vsp1/vsp1_bru.c index d8d49fb7f5ff..86b32bca408d 100644 --- a/drivers/media/platform/vsp1/vsp1_bru.c +++ b/drivers/media/platform/vsp1/vsp1_bru.c | |||
| @@ -43,8 +43,10 @@ static inline void vsp1_bru_write(struct vsp1_bru *bru, u32 reg, u32 data) | |||
| 43 | 43 | ||
| 44 | static int bru_s_stream(struct v4l2_subdev *subdev, int enable) | 44 | static int bru_s_stream(struct v4l2_subdev *subdev, int enable) |
| 45 | { | 45 | { |
| 46 | struct vsp1_pipeline *pipe = to_vsp1_pipeline(&subdev->entity); | ||
| 46 | struct vsp1_bru *bru = to_bru(subdev); | 47 | struct vsp1_bru *bru = to_bru(subdev); |
| 47 | struct v4l2_mbus_framefmt *format; | 48 | struct v4l2_mbus_framefmt *format; |
| 49 | unsigned int flags; | ||
| 48 | unsigned int i; | 50 | unsigned int i; |
| 49 | 51 | ||
| 50 | if (!enable) | 52 | if (!enable) |
| @@ -58,8 +60,13 @@ static int bru_s_stream(struct v4l2_subdev *subdev, int enable) | |||
| 58 | * to sane default values for now. | 60 | * to sane default values for now. |
| 59 | */ | 61 | */ |
| 60 | 62 | ||
| 61 | /* Disable both color data normalization and dithering. */ | 63 | /* Disable dithering and enable color data normalization unless the |
| 62 | vsp1_bru_write(bru, VI6_BRU_INCTRL, 0); | 64 | * format at the pipeline output is premultiplied. |
| 65 | */ | ||
| 66 | flags = pipe->output ? pipe->output->video.format.flags : 0; | ||
| 67 | vsp1_bru_write(bru, VI6_BRU_INCTRL, | ||
| 68 | flags & V4L2_PIX_FMT_FLAG_PREMUL_ALPHA ? | ||
| 69 | 0 : VI6_BRU_INCTRL_NRM); | ||
| 63 | 70 | ||
| 64 | /* Set the background position to cover the whole output image and | 71 | /* Set the background position to cover the whole output image and |
| 65 | * set its color to opaque black. | 72 | * set its color to opaque black. |
