Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320615
b: refs/heads/master
c: 6964b10
h: refs/heads/master
i:
  320613: b901cc0
  320611: 5e6d8d7
  320607: c02051b
v: v3
  • Loading branch information
Manjunath Hadli authored and Mauro Carvalho Chehab committed Jul 30, 2012
1 parent 5ed5499 commit a1cd1fc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2401dd25c70c07dcec8d7b5497cec4a7e74d2e31
refs/heads/master: 6964b1036388fee258c48a911ac4a3ff4e55b62d
30 changes: 30 additions & 0 deletions trunk/drivers/media/video/davinci/vpif.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ static inline void vpif_clr_bit(u32 reg, u32 bit)
#define VPIF_CH3_INT_CTRL_SHIFT (6)
#define VPIF_CH_INT_CTRL_SHIFT (6)

#define VPIF_CH2_CLIP_ANC_EN 14
#define VPIF_CH2_CLIP_ACTIVE_EN 13

#define VPIF_CH3_CLIP_ANC_EN 14
#define VPIF_CH3_CLIP_ACTIVE_EN 13

/* enabled interrupt on both the fields on vpid_ch0_ctrl register */
#define channel0_intr_assert() (regw((regr(VPIF_CH0_CTRL)|\
(VPIF_INT_BOTH << VPIF_CH0_INT_CTRL_SHIFT)), VPIF_CH0_CTRL))
Expand Down Expand Up @@ -515,6 +521,30 @@ static inline void channel3_raw_enable(int enable, u8 index)
vpif_clr_bit(VPIF_CH3_CTRL, mask);
}

/* function to enable clipping (for both active and blanking regions) on ch 2 */
static inline void channel2_clipping_enable(int enable)
{
if (enable) {
vpif_set_bit(VPIF_CH2_CTRL, VPIF_CH2_CLIP_ANC_EN);
vpif_set_bit(VPIF_CH2_CTRL, VPIF_CH2_CLIP_ACTIVE_EN);
} else {
vpif_clr_bit(VPIF_CH2_CTRL, VPIF_CH2_CLIP_ANC_EN);
vpif_clr_bit(VPIF_CH2_CTRL, VPIF_CH2_CLIP_ACTIVE_EN);
}
}

/* function to enable clipping (for both active and blanking regions) on ch 2 */
static inline void channel3_clipping_enable(int enable)
{
if (enable) {
vpif_set_bit(VPIF_CH3_CTRL, VPIF_CH3_CLIP_ANC_EN);
vpif_set_bit(VPIF_CH3_CTRL, VPIF_CH3_CLIP_ACTIVE_EN);
} else {
vpif_clr_bit(VPIF_CH3_CTRL, VPIF_CH3_CLIP_ANC_EN);
vpif_clr_bit(VPIF_CH3_CTRL, VPIF_CH3_CLIP_ACTIVE_EN);
}
}

/* inline function to set buffer addresses in case of Y/C non mux mode */
static inline void ch2_set_videobuf_addr_yc_nmux(unsigned long top_strt_luma,
unsigned long btm_strt_luma,
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/media/video/davinci/vpif_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,17 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
channel2_intr_assert();
channel2_intr_enable(1);
enable_channel2(1);
if (vpif_config_data->ch2_clip_en)
channel2_clipping_enable(1);
}

if ((VPIF_CHANNEL3_VIDEO == ch->channel_id)
|| (common->started == 2)) {
channel3_intr_assert();
channel3_intr_enable(1);
enable_channel3(1);
if (vpif_config_data->ch3_clip_en)
channel3_clipping_enable(1);
}
channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;

Expand Down Expand Up @@ -1140,6 +1144,8 @@ static int vpif_streamoff(struct file *file, void *priv,
struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel;
struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
struct vpif_display_config *vpif_config_data =
vpif_dev->platform_data;

if (buftype != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
vpif_err("buffer type not supported\n");
Expand All @@ -1159,11 +1165,15 @@ static int vpif_streamoff(struct file *file, void *priv,
if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
/* disable channel */
if (VPIF_CHANNEL2_VIDEO == ch->channel_id) {
if (vpif_config_data->ch2_clip_en)
channel2_clipping_enable(0);
enable_channel2(0);
channel2_intr_enable(0);
}
if ((VPIF_CHANNEL3_VIDEO == ch->channel_id) ||
(2 == common->started)) {
if (vpif_config_data->ch3_clip_en)
channel3_clipping_enable(0);
enable_channel3(0);
channel3_intr_enable(0);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/media/davinci/vpif_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ struct vpif_display_config {
const char **output;
int output_count;
const char *card_name;
bool ch2_clip_en;
bool ch3_clip_en;
};

struct vpif_input {
Expand Down

0 comments on commit a1cd1fc

Please sign in to comment.