summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRicardo Perez Olivares <x0081762@ti.com>2010-08-17 11:17:11 -0500
committerRicardo Perez Olivares <x0081762@ti.com>2010-08-17 11:17:11 -0500
commit461a16daf1f037eb06dfca693e4204af2193e75e (patch)
tree99b5b3bf969688e38ad9896ef56588f9c3f5ff6e /drivers
parent73648374047e416930ec97daf4dbe486e4549c32 (diff)
parent31d587df2118334504bd62493693ddb45564ad08 (diff)
Merge branch 'display-next' of git://dev.omapzoom.org/pub/scm/axelcx/kernel-display into L24x9
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/omap/omap_vout.c41
-rw-r--r--drivers/media/video/omap/omap_wb.c19
-rw-r--r--drivers/video/omap2/displays/panel-taal.c20
-rw-r--r--drivers/video/omap2/dss/dispc.c30
-rw-r--r--drivers/video/omap2/dss/dsi.c17
5 files changed, 75 insertions, 52 deletions
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index 70a8a00ff9fd..f1d6248c540a 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -241,6 +241,7 @@ static void omap_vout_free_buffer(unsigned long virtaddr, u32 phys_addr,
}
#ifndef CONFIG_ARCH_OMAP4
+/*
* Function for allocating video buffers
*/
static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
@@ -909,21 +910,21 @@ int omapvid_setup_overlay(struct omap_vout_device *vout,
info.out_height = outh;
info.global_alpha =
vout->vid_info.overlays[0]->info.global_alpha;
-#ifndef CONFIG_ARCH_OMAP4
- if (!rotation_enabled(vout)) {
- info.rotation = 0;
- info.rotation_type = OMAP_DSS_ROT_DMA;
- info.screen_width = pixwidth;
+ if (!cpu_is_omap44xx()) {
+ if (!rotation_enabled(vout)) {
+ info.rotation = 0;
+ info.rotation_type = OMAP_DSS_ROT_DMA;
+ info.screen_width = pixwidth;
+ } else {
+ info.rotation = vout->rotation;
+ info.rotation_type = OMAP_DSS_ROT_VRFB;
+ info.screen_width = 2048;
+ }
} else {
+ info.rotation_type = OMAP_DSS_ROT_TILER;
+ info.screen_width = pixwidth;
info.rotation = vout->rotation;
- info.rotation_type = OMAP_DSS_ROT_VRFB;
- info.screen_width = 2048;
}
-#else
- info.rotation_type = OMAP_DSS_ROT_TILER;
- info.screen_width = pixwidth;
- info.rotation = vout->rotation;
-#endif
v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev,
"%s enable=%d addr=%x width=%d\n height=%d color_mode=%d\n"
@@ -1050,7 +1051,9 @@ void omap_vout_isr(void *arg, unsigned int irqstatus)
struct omap_vout_device *vout = (struct omap_vout_device *)arg;
unsigned long flags;
int irq = 0;
-
+#ifndef CONFIG_OMAP2_DSS_HDMI
+ u32 fid;
+#endif
if (!vout->streaming)
return;
@@ -1258,7 +1261,6 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
*count = vout->buffer_allocated = i;
#else
-
/* tiler_alloc_buf to be called here
pre-requisites: rotation, format?
based on that buffers will be allocated.
@@ -1422,10 +1424,10 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q,
* from this array will be used to configure DSS */
vout->queued_buf_addr[vb->i] = (u8 *)
vout->vrfb_context[vb->i].paddr[rotation];
-#else /* TILER to be used */
+#else /* TILER to be used */
/* Here, we need to use the physical addresses given by Tiler:
- */
+ */
dmabuf = vout->buf_phy_addr[vb->i];
vout->queued_buf_addr[vb->i] = (u8 *) vout->buf_phy_addr[vb->i];
vout->queued_buf_uv_addr[vb->i] = (u8 *) vout->buf_phy_uv_addr[vb->i];
@@ -1837,17 +1839,14 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
/* get the framebuffer parameters */
-#ifndef CONFIG_ARCH_OMAP4
- if (rotate_90_or_270(vout)) {
+ if (!cpu_is_omap44xx() && rotate_90_or_270(vout)) {
vout->fbuf.fmt.height = timing->x_res;
vout->fbuf.fmt.width = timing->y_res;
} else {
-#endif
vout->fbuf.fmt.height = timing->y_res;
vout->fbuf.fmt.width = timing->x_res;
-#ifndef CONFIG_ARCH_OMAP4
}
-#endif
+
/* change to samller size is OK */
bpp = omap_vout_try_format(&f->fmt.pix);
diff --git a/drivers/media/video/omap/omap_wb.c b/drivers/media/video/omap/omap_wb.c
index f6ed1f51d005..136b57c95c35 100644
--- a/drivers/media/video/omap/omap_wb.c
+++ b/drivers/media/video/omap/omap_wb.c
@@ -80,31 +80,36 @@ int omap_setup_wb(struct omap_wb_device *wb_device, u32 addr, u32 uv_addr)
struct omap_writeback *wb;
struct omap_overlay_manager *mgr = NULL;
struct omap_writeback_info wb_info;
+ struct omap_overlay *ovl = NULL;
int r = 0;
int i = 0;
wb_info.enabled = true;
wb_info.info_dirty = true;
wb_info.capturemode = wb_device->capturemode;
wb_info.dss_mode = wb_device->dss_mode;
- wb_info.height = wb_device->pix.height;
- wb_info.width = wb_device->pix.width;
- wb_info.out_height = wb_device->win.w.height;
- wb_info.out_width = wb_device->win.w.width;
+ wb_info.out_height = wb_device->pix.height;
+ wb_info.out_width = wb_device->pix.width;
wb_info.source = wb_device->source;
wb_info.source_type = wb_device->source_type;
wb_info.paddr = addr;
wb_info.puv_addr = uv_addr;
+ ovl = omap_dss_get_overlay(wb_info.source - 3);
+
+ wb_info.height = ovl->info.out_height;
+ wb_info.width = ovl->info.out_width;
+
v4l2_dbg(1, debug_wb, &wb_device->wb_dev->v4l2_dev,
"omap_write back struct contents :\n"
"enabled = %d\n infodirty = %d\n"
"capturemode = %d\n dss_mode = %d\n"
- "height = %ld\n width = %ld\n source = %d\n"
+ "height = %ld\n width = %ld\n out_height = %ld\n"
+ "out_width = %ld\n source = %d\n"
"source_type = %d\n paddr =%lx\n puvaddr = %lx\n",
wb_info.enabled, wb_info.info_dirty, wb_info.capturemode,
wb_info.dss_mode, wb_info.height, wb_info.width,
- wb_info.source, wb_info.source_type, wb_info.paddr,
- wb_info.puv_addr);
+ wb_info.out_height, wb_info.out_width, wb_info.source,
+ wb_info.source_type, wb_info.paddr, wb_info.puv_addr);
for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
/* Fix : checking for mgr will shift to DSS2 */
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 73db44fa6e66..83f20cd79338 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -1037,6 +1037,9 @@ static int taal_enable(struct omap_dss_device *dssdev)
mutex_lock(&td->lock);
+ if (td->force_update)
+ td->te_enabled = 1;
+
if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
r = -EINVAL;
goto err;
@@ -1075,8 +1078,14 @@ static void taal_disable(struct omap_dss_device *dssdev)
dev_dbg(&dssdev->dev, "disable\n");
+ if (td->force_update)
+ _taal_enable_te(dssdev, 0);
+
mutex_lock(&td->lock);
+ if (td->force_update)
+ td->te_enabled = 0;
+
cancel_delayed_work(&td->esd_work);
dsi_bus_lock(ix);
@@ -1101,8 +1110,14 @@ static int taal_suspend(struct omap_dss_device *dssdev)
dev_dbg(&dssdev->dev, "suspend\n");
+ if (td->force_update)
+ _taal_enable_te(dssdev, 0);
+
mutex_lock(&td->lock);
+ if (td->force_update)
+ td->te_enabled = 0;
+
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
r = -EINVAL;
goto err;
@@ -1139,6 +1154,9 @@ static int taal_resume(struct omap_dss_device *dssdev)
mutex_lock(&td->lock);
+ if (td->force_update)
+ td->te_enabled = 1;
+
if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
r = -EINVAL;
goto err;
@@ -1146,8 +1164,6 @@ static int taal_resume(struct omap_dss_device *dssdev)
dsi_bus_lock(ix);
- td->te_enabled = 1;
-
r = taal_power_on(dssdev);
dsi_bus_unlock(ix);
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index c315aae88035..b6d6ab583c25 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -4692,6 +4692,8 @@ int dispc_setup_wb(struct writeback_cache_data *wb)
printk(KERN_ERR "dispc_setup_wb out_height not in range\n");
return -EINVAL;
}
+ /* validate color format and 5taps*/
+ DSSDBG(KERN_ERR"%d color mode %d input color mode", color_mode, wb->input_color_mode);
switch (color_mode) {
case OMAP_DSS_COLOR_RGB16:
@@ -4819,7 +4821,7 @@ int dispc_setup_wb(struct writeback_cache_data *wb)
out_ch_width = out_width;
out_ch_height = out_height;
- /* account for output color decimation */
+ /* we must scale NV12 format */
switch (color_mode) {
case OMAP_DSS_COLOR_NV12:
out_ch_height >>= 1;
@@ -4830,37 +4832,29 @@ int dispc_setup_wb(struct writeback_cache_data *wb)
;
}
- /* account for input color decimation */
- switch (wb->input_color_mode) {
- case OMAP_DSS_COLOR_NV12:
- ch_height >>= 1;
- case OMAP_DSS_COLOR_UYVY:
- case OMAP_DSS_COLOR_YUV2:
- ch_width >>= 1;
- default:
- ;
- }
-
- _dispc_set_vid_size(plane, out_width, out_height);
- _dispc_set_vid_color_conv(plane, cconv);
+ DSSDBG("WB ch_width %d ch_height %d out_ch_width %d out_ch_height %d",
+ ch_width, ch_height, out_ch_width, out_ch_height);
/* we must scale NV12 format */
scale_x = width != out_width || ch_width != out_ch_width;
scale_y = height != out_height || ch_height != out_ch_height;
+
+ DSSDBG(KERN_ERR"%d scale_x %d scale y ", scale_x, scale_y);
+ _dispc_set_vid_size(plane, out_width, out_height);
+
_dispc_set_scaling(plane, width, height,
out_width, out_height,
0, three_taps, false, scale_x, scale_y);
- if (out_ch_width != out_width) {
+ if (ch_width != width) {
/* this is true for YUV formats */
+ printk(KERN_ERR "scale uv set");
_dispc_set_scaling_uv(plane, ch_width, ch_height,
out_ch_width, out_ch_height, 0,
three_taps, false, scale_x, scale_y);
- } else {
- /* set chroma resampling */
- REG_FLD_MOD(DISPC_VID_ATTRIBUTES2(plane - 1), 0, 8, 8);
}
+ _dispc_set_vid_color_conv(plane, cconv);
pix_inc = dispc_read_reg(dispc_reg_att[plane]);
DSSDBG("vid[%d] attributes = %x\n", plane, pix_inc);
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index f002511eab19..6a3acef1f8f5 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -2154,11 +2154,13 @@ static u16 dsi_vc_flush_receive_data(enum omap_dsi_index ix,
u32 val;
u8 dt;
val = dsi_read_reg(ix, DSI_VC_SHORT_PACKET_HEADER(channel));
- DSSERR("\trawval %#08x\n", val);
+ if (!cpu_is_omap44xx())
+ DSSERR("\trawval %#08x\n", val);
dt = FLD_GET(val, 5, 0);
if (dt == DSI_DT_RX_ACK_WITH_ERR) {
u16 err = FLD_GET(val, 23, 8);
- dsi_show_rx_ack_with_err(err);
+ if (!cpu_is_omap44xx())
+ dsi_show_rx_ack_with_err(err);
} else if (dt == DSI_DT_RX_SHORT_READ_1) {
DSSERR("\tDCS short response, 1 byte: %#x\n",
FLD_GET(val, 23, 8));
@@ -2187,7 +2189,8 @@ static int dsi_vc_send_bta(enum omap_dsi_index ix, int channel)
if (REG_GET(ix, DSI_VC_CTRL(channel), 20, 20)) {
/* RX_FIFO_NOT_EMPTY */
- DSSERR("rx fifo not empty when sending BTA, dumping data:\n");
+ if (!cpu_is_omap44xx())
+ DSSERR("rx fifo not empty when sending BTA, dumping data:\n");
dsi_vc_flush_receive_data(ix, channel);
}
@@ -3151,7 +3154,8 @@ static void dsi_handle_framedone(enum omap_dsi_index ix, int error)
/* RX_FIFO_NOT_EMPTY */
if (REG_GET(ix, DSI_VC_CTRL(channel), 20, 20)) {
- DSSERR("Received error during frame transfer:\n");
+ if (!cpu_is_omap44xx())
+ DSSERR("Received error during frame transfer:\n");
dsi_vc_flush_receive_data(ix, channel);
if (!error)
error = -EIO;
@@ -3695,7 +3699,12 @@ int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
struct dsi_struct *p_dsi;
p_dsi = (dssdev->channel == OMAP_DSS_CHANNEL_LCD) ? &dsi1 : &dsi2;
+ mutex_lock(&p_dsi->lock);
+
p_dsi->te_enabled = enable;
+
+ mutex_unlock(&p_dsi->lock);
+
return 0;
}
EXPORT_SYMBOL(omapdss_dsi_enable_te);