* [RFC PATCH 13/29] OMAPDSS: APPLY: Configure writeback FIFOs
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Add writeback FIFO thresholds as extra_info parameters. Modify function
dss_ovl_fifo_setup() so that it can also also configure writeback pipeline
FIFOs. Extend the DISPC fifo functions to also configure the writeback
registers.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 70 +++++++++++++++++++++++++++++++++-----
drivers/video/omap2/dss/dispc.c | 8 +++--
2 files changed, 65 insertions(+), 13 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 9f3c174..a17cc47 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -115,6 +115,7 @@ struct wb_priv_data {
bool shadow_extra_info_dirty;
enum dss_writeback_channel_in channel_in;
+ u32 fifo_low, fifo_high;
/* If true, GO bit is up and shadow registers cannot be written.
* Never true for writeback in memory to memory mode */
@@ -687,6 +688,7 @@ static void dss_wb_write_regs_extra(struct omap_dss_writeback *wb)
return;
dispc_wb_set_channel_in(wb->id, wp->channel_in);
+ dispc_ovl_set_fifo_threshold(wb->plane_id, wp->fifo_low, wp->fifo_high);
wp->extra_info_dirty = false;
wp->shadow_extra_info_dirty = true;
@@ -1102,21 +1104,59 @@ static void dss_apply_ovl_fifo_thresholds(struct omap_overlay *ovl,
op->extra_info_dirty = true;
}
-static void dss_ovl_setup_fifo(struct omap_overlay *ovl)
+static void dss_apply_wb_fifo_thresholds(struct omap_dss_writeback *wb,
+ u32 fifo_low, u32 fifo_high)
{
- struct ovl_priv_data *op = get_ovl_priv(ovl);
+ struct wb_priv_data *wp = get_wb_priv(wb);
+
+ if (wp->fifo_low = fifo_low && wp->fifo_high = fifo_high)
+ return;
+
+ wp->fifo_low = fifo_low;
+ wp->fifo_high = fifo_high;
+ wp->extra_info_dirty = true;
+}
+
+static void dss_plane_setup_fifo(struct omap_overlay *ovl,
+ struct omap_dss_writeback *wb)
+{
+ enum omap_plane plane;
+ struct omap_overlay_manager *mgr;
struct omap_dss_device *dssdev;
+ bool enabled, enabling;
u32 size, burst_size;
u32 fifo_low, fifo_high;
- if (!op->enabled && !op->enabling)
+ if (ovl) {
+ struct ovl_priv_data *op;
+
+ mgr = ovl->manager;
+ op = get_ovl_priv(ovl);
+
+ enabled = op->enabled;
+ enabling = op->enabling;
+
+ plane = ovl->id;
+ } else {
+ struct wb_priv_data *wp;
+
+ mgr = wb->dssdev->manager;
+ wp = get_wb_priv(wb);
+
+ enabled = wp->enabled;
+ enabling = false;
+
+ plane = wb->plane_id;
+ }
+
+ if (!enabled && !enabling)
return;
- dssdev = ovl->manager->get_output(ovl->manager);
+ dssdev = mgr->get_output(mgr);
- size = dispc_ovl_get_fifo_size(ovl->id);
+ size = dispc_ovl_get_fifo_size(plane);
- burst_size = dispc_ovl_get_burst_size(ovl->id);
+ burst_size = dispc_ovl_get_burst_size(plane);
switch (dssdev->type) {
case OMAP_DISPLAY_TYPE_DPI:
@@ -1124,12 +1164,12 @@ static void dss_ovl_setup_fifo(struct omap_overlay *ovl)
case OMAP_DISPLAY_TYPE_SDI:
case OMAP_DISPLAY_TYPE_VENC:
case OMAP_DISPLAY_TYPE_HDMI:
- default_get_overlay_fifo_thresholds(ovl->id, size,
+ default_get_overlay_fifo_thresholds(plane, size,
burst_size, &fifo_low, &fifo_high);
break;
#ifdef CONFIG_OMAP2_DSS_DSI
case OMAP_DISPLAY_TYPE_DSI:
- dsi_get_overlay_fifo_thresholds(ovl->id, size,
+ dsi_get_overlay_fifo_thresholds(plane, size,
burst_size, &fifo_low, &fifo_high);
break;
#endif
@@ -1137,13 +1177,17 @@ static void dss_ovl_setup_fifo(struct omap_overlay *ovl)
BUG();
}
- dss_apply_ovl_fifo_thresholds(ovl, fifo_low, fifo_high);
+ if (ovl)
+ dss_apply_ovl_fifo_thresholds(ovl, fifo_low, fifo_high);
+ else
+ dss_apply_wb_fifo_thresholds(wb, fifo_low, fifo_high);
}
static void dss_mgr_setup_fifos(struct omap_overlay_manager *mgr)
{
struct omap_overlay *ovl;
struct mgr_priv_data *mp;
+ struct omap_dss_device *dssdev;
mp = get_mgr_priv(mgr);
@@ -1151,7 +1195,13 @@ static void dss_mgr_setup_fifos(struct omap_overlay_manager *mgr)
return;
list_for_each_entry(ovl, &mgr->overlays, list)
- dss_ovl_setup_fifo(ovl);
+ dss_plane_setup_fifo(ovl, NULL);
+
+ dssdev = mgr->get_writeback(mgr);
+ if (dssdev) {
+ struct omap_dss_writeback *wb = dssdev->wbdev;
+ dss_plane_setup_fifo(NULL, wb);
+ }
}
static void dss_setup_fifos(void)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index a4d5504..231369a 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -91,7 +91,7 @@ static struct {
int irq;
struct clk *dss_clk;
- u32 fifo_size[MAX_DSS_OVERLAYS];
+ u32 fifo_size[MAX_DSS_OVERLAYS + MAX_DSS_WB];
spinlock_t irq_lock;
u32 irq_error_mask;
@@ -907,7 +907,7 @@ void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in)
static void dispc_ovl_set_burst_size(enum omap_plane plane,
enum omap_burst_size burst_size)
{
- static const unsigned shifts[] = { 6, 14, 14, 14, };
+ static const unsigned shifts[] = { 6, 14, 14, 14, 14, };
int shift;
shift = shifts[plane];
@@ -1021,12 +1021,14 @@ static void dispc_read_plane_fifo_sizes(void)
int plane;
u8 start, end;
u32 unit;
+ int num_ovl = dss_feat_get_num_ovls();
+ int num_wb = dss_feat_get_num_wb();
unit = dss_feat_get_buffer_size_unit();
dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
- for (plane = 0; plane < dss_feat_get_num_ovls(); ++plane) {
+ for (plane = 0; plane < num_ovl + num_wb; ++plane) {
size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(plane), start, end);
size *= unit;
dispc.fifo_size[plane] = size;
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 12/29] OMAPDSS: Writeback: Add check for color_mode in dss_wb_simple_check()
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Add a check for the color_mode parameter provided by the user in
dss_wb_simple_check().
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/writeback.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
index 8b2c9b8..540e61d 100644
--- a/drivers/video/omap2/dss/writeback.c
+++ b/drivers/video/omap2/dss/writeback.c
@@ -153,6 +153,13 @@ int dss_wb_simple_check(struct omap_dss_writeback *wb,
return -EINVAL;
}
+ if ((dss_feat_get_supported_color_modes(wb->plane_id) &
+ info->color_mode) = 0) {
+ DSSERR("wb_simple_check: wb%d doesn't support mode %d\n",
+ wb->id, info->color_mode);
+ return -EINVAL;
+ }
+
if (info->capture_rate < 0 || info->capture_rate > 7) {
DSSERR("wb_simple_check: capture rate cannot be %d\n",
info->capture_rate);
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 11/29] OMAPDSS: DISPC: Add writeback as a new plane
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Since writeback has many overlay like properties, and most of it's registers are
similar to that of overlays, it's possible to reuse most of the overlay related
DISPC code for writeback if it is added as a plane.
Add OMAP_DSS_WB as new plane in the omap_plane struct. Add the writeback
register offsets in dispc.h, add minimal WB plane related info needed in
dss_features.
Add a new omap_dss_writeback parameter called plane_id, this represents the
plane or pipeline number out of all the pipelines.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dispc.h | 36 ++++++++++++++++++++++++++++++++
drivers/video/omap2/dss/dss_features.c | 10 ++++++++
drivers/video/omap2/dss/writeback.c | 1 +
include/video/omapdss.h | 2 +
4 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.h b/drivers/video/omap2/dss/dispc.h
index 5836bd1..7f69a51 100644
--- a/drivers/video/omap2/dss/dispc.h
+++ b/drivers/video/omap2/dss/dispc.h
@@ -304,6 +304,8 @@ static inline u16 DISPC_OVL_BASE(enum omap_plane plane)
return 0x014C;
case OMAP_DSS_VIDEO3:
return 0x0300;
+ case OMAP_DSS_WB:
+ return 0x0500;
default:
BUG();
}
@@ -318,6 +320,7 @@ static inline u16 DISPC_BA0_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0000;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0008;
default:
BUG();
@@ -332,6 +335,7 @@ static inline u16 DISPC_BA1_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0004;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x000C;
default:
BUG();
@@ -349,6 +353,8 @@ static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
return 0x04BC;
case OMAP_DSS_VIDEO3:
return 0x0310;
+ case OMAP_DSS_WB:
+ return 0x0118;
default:
BUG();
}
@@ -365,6 +371,8 @@ static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
return 0x04C0;
case OMAP_DSS_VIDEO3:
return 0x0314;
+ case OMAP_DSS_WB:
+ return 0x011C;
default:
BUG();
}
@@ -392,6 +400,7 @@ static inline u16 DISPC_SIZE_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x000C;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x00A8;
default:
BUG();
@@ -407,6 +416,7 @@ static inline u16 DISPC_ATTR_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0010;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0070;
default:
BUG();
@@ -424,6 +434,8 @@ static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
return 0x04DC;
case OMAP_DSS_VIDEO3:
return 0x032C;
+ case OMAP_DSS_WB:
+ return 0x0310;
default:
BUG();
}
@@ -438,6 +450,7 @@ static inline u16 DISPC_FIFO_THRESH_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0014;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x008C;
default:
BUG();
@@ -453,6 +466,7 @@ static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0018;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0088;
default:
BUG();
@@ -468,6 +482,7 @@ static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x001C;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x00A4;
default:
BUG();
@@ -483,6 +498,7 @@ static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0020;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0098;
default:
BUG();
@@ -526,6 +542,7 @@ static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0024;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0090;
default:
BUG();
@@ -543,6 +560,8 @@ static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
return 0x055C;
case OMAP_DSS_VIDEO3:
return 0x0424;
+ case OMAP_DSS_WB:
+ return 0x290;
default:
BUG();
}
@@ -557,6 +576,7 @@ static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0028;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0094;
default:
BUG();
@@ -573,6 +593,7 @@ static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x002C;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0000;
default:
BUG();
@@ -590,6 +611,8 @@ static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
return 0x0560;
case OMAP_DSS_VIDEO3:
return 0x0428;
+ case OMAP_DSS_WB:
+ return 0x0294;
default:
BUG();
}
@@ -604,6 +627,7 @@ static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO2:
return 0x0030;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0004;
default:
BUG();
@@ -621,6 +645,8 @@ static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
return 0x0564;
case OMAP_DSS_VIDEO3:
return 0x042C;
+ case OMAP_DSS_WB:
+ return 0x0298;
default:
BUG();
}
@@ -636,6 +662,7 @@ static inline u16 DISPC_FIR_COEF_H_OFFSET(enum omap_plane plane, u16 i)
case OMAP_DSS_VIDEO2:
return 0x0034 + i * 0x8;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0010 + i * 0x8;
default:
BUG();
@@ -654,6 +681,8 @@ static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum omap_plane plane, u16 i)
return 0x0568 + i * 0x8;
case OMAP_DSS_VIDEO3:
return 0x0430 + i * 0x8;
+ case OMAP_DSS_WB:
+ return 0x02A0 + i * 0x8;
default:
BUG();
}
@@ -669,6 +698,7 @@ static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum omap_plane plane, u16 i)
case OMAP_DSS_VIDEO2:
return 0x0038 + i * 0x8;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0014 + i * 0x8;
default:
BUG();
@@ -687,6 +717,8 @@ static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum omap_plane plane, u16 i)
return 0x056C + i * 0x8;
case OMAP_DSS_VIDEO3:
return 0x0434 + i * 0x8;
+ case OMAP_DSS_WB:
+ return 0x02A4 + i * 0x8;
default:
BUG();
}
@@ -701,6 +733,7 @@ static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0074 + i * 0x4;
default:
BUG();
@@ -718,6 +751,7 @@ static inline u16 DISPC_FIR_COEF_V_OFFSET(enum omap_plane plane, u16 i)
case OMAP_DSS_VIDEO2:
return 0x00B4 + i * 0x4;
case OMAP_DSS_VIDEO3:
+ case OMAP_DSS_WB:
return 0x0050 + i * 0x4;
default:
BUG();
@@ -736,6 +770,8 @@ static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum omap_plane plane, u16 i)
return 0x05A8 + i * 0x4;
case OMAP_DSS_VIDEO3:
return 0x0470 + i * 0x4;
+ case OMAP_DSS_WB:
+ return 0x02E0 + i * 0x4;
default:
BUG();
}
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index ca41620..9478ed8 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -221,6 +221,16 @@ static const enum omap_color_mode omap4_dss_supported_color_modes[] = {
OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
OMAP_DSS_COLOR_RGBX32,
+
+ /* OMAP_DSS_WB */
+ OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
+ OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
+ OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
+ OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
+ OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
+ OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
+ OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
+ OMAP_DSS_COLOR_RGBX32,
};
static const enum omap_overlay_caps omap2_dss_overlay_caps[] = {
diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
index 89738a4..8b2c9b8 100644
--- a/drivers/video/omap2/dss/writeback.c
+++ b/drivers/video/omap2/dss/writeback.c
@@ -88,6 +88,7 @@ void dss_init_writeback(void)
struct omap_dss_writeback *wb = &writeback[i];
wb->id = i;
+ wb->plane_id = OMAP_DSS_WB + i;
wb->set_wb_info = &dss_wb_set_info;
wb->get_wb_info = &dss_wb_get_info;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index d19a7d3..6bf84b2 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -68,6 +68,7 @@ enum omap_plane {
OMAP_DSS_VIDEO1 = 1,
OMAP_DSS_VIDEO2 = 2,
OMAP_DSS_VIDEO3 = 3,
+ OMAP_DSS_WB = 4,
};
enum omap_channel {
@@ -488,6 +489,7 @@ struct omap_dss_writeback_info {
struct omap_dss_writeback {
int id;
+ int plane_id;
/* dummy panel we are connected to */
struct omap_dss_device *dssdev;
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 10/29] OMAPDSS: APPLY: Calculate channel_in for writeback
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Add channel_in as a parameter in writeback's private data. This sets the
extra_info_dirty flag as this parameter is configured when we set/unset the
dummy writeback panel's manager unlike the other parameter which are
configured through set/unset_wb_info ops by the DSS2 user.
Add a helper function dss_mgr_set_writeback() which is called by the manager
set/unset_device ops to configure the channel_in parameter and set the
extra_info_dirty flags. It returns an error if we try to unset writeback when
it is enabled.
Add a dummy dispc_wb_set_channel_in() function. This will be filled up later.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 59 +++++++++++++++++++++++++++++-----
drivers/video/omap2/dss/dispc.c | 5 +++
drivers/video/omap2/dss/dss.h | 12 +++++++
drivers/video/omap2/dss/writeback.c | 15 +++++++++
4 files changed, 82 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index aee0420..9f3c174 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -114,6 +114,8 @@ struct wb_priv_data {
bool extra_info_dirty;
bool shadow_extra_info_dirty;
+ enum dss_writeback_channel_in channel_in;
+
/* If true, GO bit is up and shadow registers cannot be written.
* Never true for writeback in memory to memory mode */
bool busy;
@@ -137,6 +139,8 @@ static DEFINE_MUTEX(apply_lock);
static DECLARE_COMPLETION(extra_updated_completion);
static void dss_register_vsync_isr(void);
+static int dss_mgr_set_writeback(struct omap_overlay_manager *mgr,
+ struct omap_dss_writeback *wb, bool set);
static struct ovl_priv_data *get_ovl_priv(struct omap_overlay *ovl)
{
@@ -682,7 +686,7 @@ static void dss_wb_write_regs_extra(struct omap_dss_writeback *wb)
if (!wp->extra_info_dirty)
return;
- /* Write extra registers here */
+ dispc_wb_set_channel_in(wb->id, wp->channel_in);
wp->extra_info_dirty = false;
wp->shadow_extra_info_dirty = true;
@@ -1282,6 +1286,7 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev)
{
int r;
+ struct omap_dss_writeback *wb = dssdev->wbdev;
mutex_lock(&apply_lock);
@@ -1301,10 +1306,13 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
dssdev->manager = mgr;
- if (dssdev->wbdev)
- mgr->output->writeback = dssdev;
- else
+ if (wb) {
+ r = dss_mgr_set_writeback(mgr, wb, true);
+ if (r)
+ goto err;
+ } else {
mgr->output->device = dssdev;
+ }
mutex_unlock(&apply_lock);
@@ -1319,11 +1327,11 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
{
int r;
struct omap_dss_device *curr_dssdev;
+ struct omap_dss_writeback *wb = dssdev->wbdev;
mutex_lock(&apply_lock);
- curr_dssdev = dssdev->wbdev ? mgr->get_writeback(mgr) :
- mgr->get_display(mgr);
+ curr_dssdev = wb ? mgr->get_writeback(mgr) : mgr->get_display(mgr);
if (!curr_dssdev) {
DSSERR("failed to unset device, device not set.\n");
@@ -1342,10 +1350,13 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
curr_dssdev->manager = NULL;
- if (dssdev->wbdev)
- mgr->output->writeback = NULL;
- else
+ if (wb) {
+ r = dss_mgr_set_writeback(mgr, wb, false);
+ if (r)
+ goto err;
+ } else {
mgr->output->device = NULL;
+ }
mutex_unlock(&apply_lock);
@@ -1593,6 +1604,36 @@ err:
return r;
}
+static int dss_mgr_set_writeback(struct omap_overlay_manager *mgr,
+ struct omap_dss_writeback *wb, bool set)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+ unsigned long flags;
+
+ spin_lock_irqsave(&data_lock, flags);
+
+ if (set) {
+ wp->channel_in = dss_wb_calc_channel_in(wb);
+ wp->extra_info_dirty = true;
+ mgr->output->writeback = wb->dssdev;
+
+ } else {
+ if (wp->enabled) {
+ DSSERR("Failed to unset writeback%d from manager%d\n",
+ wb->id, mgr->id);
+ spin_unlock_irqrestore(&data_lock, flags);
+ return -EINVAL;
+ }
+
+ wp->channel_in = -1;
+ mgr->output->writeback = NULL;
+ }
+
+ spin_unlock_irqrestore(&data_lock, flags);
+
+ return 0;
+}
+
int dss_wb_set_info(struct omap_dss_writeback *wb,
struct omap_dss_writeback_info *info)
{
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 35ed6ca..a4d5504 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -899,6 +899,11 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
return channel;
}
+void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in)
+{
+ return;
+}
+
static void dispc_ovl_set_burst_size(enum omap_plane plane,
enum omap_burst_size burst_size)
{
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b4b60fc..1b128f1 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -113,6 +113,16 @@ enum dss_dsi_content_type {
DSS_DSI_CONTENT_GENERIC,
};
+enum dss_writeback_channel_in {
+ OMAP_DSS_WB_LCD1_MGR = 0,
+ OMAP_DSS_WB_LCD2_MGR = 1,
+ OMAP_DSS_WB_TV_MGR = 2,
+ OMAP_DSS_WB_OVL0 = 3,
+ OMAP_DSS_WB_OVL1 = 4,
+ OMAP_DSS_WB_OVL2 = 5,
+ OMAP_DSS_WB_OVL3 = 6,
+};
+
struct dss_clock_info {
/* rates that we get with dividers below */
unsigned long fck;
@@ -238,6 +248,7 @@ int dss_ovl_check(struct omap_overlay *ovl,
void dss_init_writeback(void);
void dss_uninit_writeback(void);
int writeback_init_display(struct omap_dss_device *dssdev);
+enum dss_writeback_channel_in dss_wb_calc_channel_in(struct omap_dss_writeback *wb);
int dss_wb_simple_check(struct omap_dss_writeback *wb,
const struct omap_dss_writeback_info *info);
@@ -483,6 +494,7 @@ bool dispc_wb_go_busy(int id);
void dispc_wb_go(int id);
int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi);
void dispc_wb_enable(int id, bool enable);
+void dispc_wb_set_channel_in(int id, enum dss_writeback_channel_in ch_in);
/* VENC */
#ifdef CONFIG_OMAP2_DSS_VENC
diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
index eefab4e..89738a4 100644
--- a/drivers/video/omap2/dss/writeback.c
+++ b/drivers/video/omap2/dss/writeback.c
@@ -122,6 +122,21 @@ int writeback_init_display(struct omap_dss_device *dssdev)
return 0;
}
+enum dss_writeback_channel_in dss_wb_calc_channel_in(struct omap_dss_writeback *wb)
+{
+ struct omap_overlay_manager *mgr = wb->dssdev->manager;
+
+ switch (mgr->id) {
+ case OMAP_DSS_CHANNEL_LCD2:
+ return OMAP_DSS_WB_LCD2_MGR;
+ case OMAP_DSS_CHANNEL_DIGIT:
+ return OMAP_DSS_WB_TV_MGR;
+ case OMAP_DSS_CHANNEL_LCD:
+ default:
+ return OMAP_DSS_WB_LCD1_MGR;
+ }
+}
+
int dss_wb_simple_check(struct omap_dss_writeback *wb,
const struct omap_dss_writeback_info *info)
{
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 09/29] OMAPDSS: APPLY: Allow manager set/unset_device ops to set/unset writeback
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Allow dss_mgr_set_device/unset_device to set/unset either display or writeback
based on the dssdev argument passed to the function. Check if the device is a
writeback device by seeing if the wbdev pointer is populated for it or not.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 4624f86..aee0420 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1300,7 +1300,11 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
}
dssdev->manager = mgr;
- mgr->output->device = dssdev;
+
+ if (dssdev->wbdev)
+ mgr->output->writeback = dssdev;
+ else
+ mgr->output->device = dssdev;
mutex_unlock(&apply_lock);
@@ -1318,7 +1322,8 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
mutex_lock(&apply_lock);
- curr_dssdev = mgr->output->device;
+ curr_dssdev = dssdev->wbdev ? mgr->get_writeback(mgr) :
+ mgr->get_display(mgr);
if (!curr_dssdev) {
DSSERR("failed to unset device, device not set.\n");
@@ -1336,7 +1341,11 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
}
curr_dssdev->manager = NULL;
- mgr->output->device = NULL;
+
+ if (dssdev->wbdev)
+ mgr->output->writeback = NULL;
+ else
+ mgr->output->device = NULL;
mutex_unlock(&apply_lock);
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 08/29] OMAPDSS: APPLY: Modify manager unset device op
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Modify manager's unset_device op so that it can be used to unset any one of the
devices connected to the overlay manager output.
The unset_device function now takes a pointer to omap_dss_device struct which
needs to be unset. The function ignores it for now, but since there can be two
devices connected to a manager now, it will be used later to unset either the
display or writeback device.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 3 ++-
drivers/video/omap2/dss/display.c | 2 +-
drivers/video/omap2/dss/dss.h | 3 ++-
drivers/video/omap2/dss/manager.c | 7 +++++--
drivers/video/omap2/dss/overlay.c | 9 ++++++---
include/video/omapdss.h | 3 ++-
6 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index ff0baeb..4624f86 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1310,7 +1310,8 @@ err:
return r;
}
-int dss_mgr_unset_device(struct omap_overlay_manager *mgr)
+int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
+ struct omap_dss_device *dssdev)
{
int r;
struct omap_dss_device *curr_dssdev;
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index a712bad..03d7fb0 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -432,7 +432,7 @@ void dss_uninit_device(struct platform_device *pdev,
device_remove_file(&dssdev->dev, attr);
if (dssdev->manager)
- dssdev->manager->unset_device(dssdev->manager);
+ dssdev->manager->unset_device(dssdev->manager, dssdev);
}
static int dss_suspend_device(struct device *dev, void *data)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index bb25d96..b4b60fc 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -178,7 +178,8 @@ void dss_mgr_get_info(struct omap_overlay_manager *mgr,
struct omap_overlay_manager_info *info);
int dss_mgr_set_device(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev);
-int dss_mgr_unset_device(struct omap_overlay_manager *mgr);
+int dss_mgr_unset_device(struct omap_overlay_manager *mgr,
+ struct omap_dss_device *dssdev);
bool dss_ovl_is_enabled(struct omap_overlay *ovl);
int dss_ovl_enable(struct omap_overlay *ovl);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 4962f7b..f4fd3d8 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -55,6 +55,7 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
int r = 0;
size_t len = size;
struct omap_dss_device *dssdev = NULL;
+ struct omap_dss_device *curr_display;
int match(struct omap_dss_device *dssdev, void *data)
{
@@ -74,8 +75,10 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
if (dssdev)
DSSDBG("display %s found\n", dssdev->name);
- if (mgr->get_display(mgr)) {
- r = mgr->unset_device(mgr);
+ curr_display = mgr->get_display(mgr);
+
+ if (curr_display) {
+ r = mgr->unset_device(mgr, curr_display);
if (r) {
DSSERR("failed to unset display\n");
goto put_device;
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index c72275e..dc0cc52 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -538,7 +538,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
if (dssdev->channel = OMAP_DSS_CHANNEL_LCD2) {
if (!lcd2_mgr->output->device || force) {
if (lcd2_mgr->output->device)
- lcd2_mgr->unset_device(lcd2_mgr);
+ lcd2_mgr->unset_device(lcd2_mgr,
+ lcd2_mgr->output->device);
lcd2_mgr->set_device(lcd2_mgr, dssdev);
mgr = lcd2_mgr;
}
@@ -546,7 +547,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
&& dssdev->type != OMAP_DISPLAY_TYPE_HDMI) {
if (!lcd_mgr->output->device || force) {
if (lcd_mgr->output->device)
- lcd_mgr->unset_device(lcd_mgr);
+ lcd_mgr->unset_device(lcd_mgr,
+ lcd_mgr->output->device);
lcd_mgr->set_device(lcd_mgr, dssdev);
mgr = lcd_mgr;
}
@@ -556,7 +558,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
|| dssdev->type = OMAP_DISPLAY_TYPE_HDMI) {
if (!tv_mgr->output->device || force) {
if (tv_mgr->output->device)
- tv_mgr->unset_device(tv_mgr);
+ tv_mgr->unset_device(tv_mgr,
+ tv_mgr->output->device);
tv_mgr->set_device(tv_mgr, dssdev);
mgr = tv_mgr;
}
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 01092e4..d19a7d3 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -456,7 +456,8 @@ struct omap_overlay_manager {
int (*set_device)(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev);
- int (*unset_device)(struct omap_overlay_manager *mgr);
+ int (*unset_device)(struct omap_overlay_manager *mgr,
+ struct omap_dss_device *dssdev);
int (*set_manager_info)(struct omap_overlay_manager *mgr,
struct omap_overlay_manager_info *info);
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 07/29] OMAPDSS: APPLY: Add extra_info for writeback
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Like overlays, writeback pipeline has a a FIFO and a channel which shouldn't
be configured along with the other info struct. Introduce flags extra_info
dirty and shadow_dirty flags. Configure them like done for overlays.
No extra parameters have been added for now. They will be added on later.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 48 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 5263ae7..ff0baeb 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -111,6 +111,9 @@ struct wb_priv_data {
bool shadow_info_dirty;
+ bool extra_info_dirty;
+ bool shadow_extra_info_dirty;
+
/* If true, GO bit is up and shadow registers cannot be written.
* Never true for writeback in memory to memory mode */
bool busy;
@@ -335,6 +338,12 @@ static bool need_isr(void)
if (wp->shadow_info_dirty)
return true;
+ if (wp->extra_info_dirty)
+ return true;
+
+ if (wp->shadow_extra_info_dirty)
+ return true;
+
}
}
}
@@ -368,7 +377,7 @@ static bool need_wb_go(struct omap_dss_writeback *wb)
wp = get_wb_priv(wb);
- if (wp->shadow_info_dirty)
+ if (wp->shadow_info_dirty || wp->shadow_extra_info_dirty)
return true;
return false;
@@ -378,6 +387,7 @@ static bool need_wb_go(struct omap_dss_writeback *wb)
static bool extra_info_update_ongoing(void)
{
const int num_ovls = omap_dss_get_num_overlays();
+ const int num_wb = dss_feat_get_num_wb();
struct ovl_priv_data *op;
struct omap_overlay *ovl;
struct mgr_priv_data *mp;
@@ -402,6 +412,27 @@ static bool extra_info_update_ongoing(void)
return true;
}
+ for (i = 0; i < num_wb; ++i) {
+ struct omap_dss_writeback *wb;
+ struct wb_priv_data *wp;
+
+ wb = omap_dss_get_writeback(i);
+ wp = get_wb_priv(wb);
+ mp = get_mgr_priv(wb->dssdev->manager);
+
+ if (!mp->enabled)
+ continue;
+
+ if (!mp->updating)
+ continue;
+
+ if (!wp->enabled)
+ continue;
+
+ if (wp->extra_info_dirty || wp->shadow_extra_info_dirty)
+ return true;
+ }
+
return false;
}
@@ -644,6 +675,19 @@ static void dss_wb_write_regs(struct omap_dss_writeback *wb)
wp->shadow_info_dirty = true;
}
+static void dss_wb_write_regs_extra(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+
+ if (!wp->extra_info_dirty)
+ return;
+
+ /* Write extra registers here */
+
+ wp->extra_info_dirty = false;
+ wp->shadow_extra_info_dirty = true;
+}
+
static void dss_mgr_write_regs(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -716,6 +760,7 @@ static void dss_write_regs(void)
continue;
dss_wb_write_regs(wb);
+ dss_wb_write_regs_extra(wb);
}
}
@@ -867,6 +912,7 @@ static void wb_clear_shadow_dirty(struct omap_dss_writeback *wb)
wp = get_wb_priv(wb);
wp->shadow_info_dirty = false;
+ wp->shadow_extra_info_dirty = false;
}
static void dss_apply_irq_handler(void *data, u32 mask)
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 06/29] OMAPDSS: APPLY: Add writeback enable/disable functions
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
In writeback capture mode, enabling writeback is similar to enabling an overlay
manager. It leads to an immediate copy of shadow registers to main registers and
starts DISPC DMA for frame transfer to the destination base addresses.
Hence, 'enabled' parameter for writeback is not a part of the writeback_info
struct. Its is maintained as a separate parameter like it's done for an overlay
manager.
Add dss_wb_enable/disable functions. Since we need to be connected to an enabled
manager when enabling writeback. Add checks to ensure that the connected manager
is enabled, add a check in dss_mgr_disable to issue a warning if writeback is in
use.
Call dss_setup_fifos() in dss_wb_enable(), this would be used to configure
writeback FIFOs in the future. Create a dummy dispc_wb_enable() function which
will be later filled up. Call dss_mgr_enable/disable through the dummy writeback
panel's enable/disable ops.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 92 +++++++++++++++++++++++++++++++++-
drivers/video/omap2/dss/dispc.c | 5 ++
drivers/video/omap2/dss/dss.h | 3 +
drivers/video/omap2/dss/writeback.c | 12 ++++-
4 files changed, 108 insertions(+), 4 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index f40f58c..5263ae7 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -114,6 +114,9 @@ struct wb_priv_data {
/* If true, GO bit is up and shadow registers cannot be written.
* Never true for writeback in memory to memory mode */
bool busy;
+
+ /* If true, someone is using writeback */
+ bool enabled;
};
static struct {
@@ -320,6 +323,9 @@ static bool need_isr(void)
struct omap_dss_writeback *wb = dssdev->wbdev;
struct wb_priv_data *wp = get_wb_priv(wb);
+ if (!wp->enabled)
+ continue;
+
if (wp->busy)
return true;
@@ -621,7 +627,7 @@ static void dss_wb_write_regs(struct omap_dss_writeback *wb)
struct omap_dss_writeback_info *wi;
int r;
- if (!wp->info_dirty)
+ if (!wp->enabled || !wp->info_dirty)
return;
WARN_ON(wp->busy);
@@ -703,7 +709,7 @@ static void dss_write_regs(void)
wp = get_wb_priv(wb);
mp = get_mgr_priv(wb->dssdev->manager);
- if (!mp->enabled)
+ if (!mp->enabled || !wp->enabled)
continue;
if (wp->busy)
@@ -752,7 +758,7 @@ static void dss_set_go_bits(void)
if (!mp->enabled)
continue;
- if (wp->busy)
+ if (!wp->enabled || wp->busy)
continue;
if (!need_wb_go(wb))
@@ -1163,6 +1169,7 @@ err:
void dss_mgr_disable(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);
+ struct omap_dss_device *dssdev = mgr->get_writeback(mgr);
unsigned long flags;
mutex_lock(&apply_lock);
@@ -1170,6 +1177,13 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr)
if (!mp->enabled)
goto out;
+ if (dssdev) {
+ /* if writeback is connected to the manager, issue a warning
+ * if it is enabled */
+ struct wb_priv_data *wp = get_wb_priv(dssdev->wbdev);
+ WARN_ON(wp->enabled);
+ }
+
if (!mgr_manual_update(mgr))
dispc_mgr_enable(mgr->id, false);
@@ -1556,3 +1570,75 @@ void dss_wb_get_info(struct omap_dss_writeback *wb,
spin_unlock_irqrestore(&data_lock, flags);
}
+
+int dss_wb_enable(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+ struct mgr_priv_data *mp;
+ unsigned long flags;
+ int r = 0;
+
+ mutex_lock(&apply_lock);
+
+ /* don't enable if it isn't connected to any manager */
+ if (!wb->dssdev->manager) {
+ r = -EINVAL;
+ goto out;
+ }
+
+ mp = get_mgr_priv(wb->dssdev->manager);
+
+ /* don't enable if the manager WB is connected to is disabled */
+ if (!mp->enabled) {
+ r = -EINVAL;
+ goto out;
+ }
+
+ if (wp->enabled)
+ goto out;
+
+ /* use a simple check for now */
+ r = dss_wb_simple_check(wb, &wp->info);
+ if (r)
+ goto out;
+
+ spin_lock_irqsave(&data_lock, flags);
+
+ wp->enabled = true;
+
+ dss_setup_fifos();
+
+ dss_write_regs();
+ dss_set_go_bits();
+
+ spin_unlock_irqrestore(&data_lock, flags);
+
+ dispc_wb_enable(wb->id, true);
+
+out:
+ mutex_unlock(&apply_lock);
+
+ return r;
+}
+
+void dss_wb_disable(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+ unsigned long flags;
+
+ mutex_lock(&apply_lock);
+
+ if (!wp->enabled)
+ goto out;
+
+ dispc_wb_enable(wb->id, false);
+
+ spin_lock_irqsave(&data_lock, flags);
+
+ wp->enabled = false;
+
+ spin_unlock_irqrestore(&data_lock, flags);
+
+out:
+ mutex_unlock(&apply_lock);
+}
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index d98905f..35ed6ca 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2070,6 +2070,11 @@ void dispc_mgr_enable(enum omap_channel channel, bool enable)
BUG();
}
+void dispc_wb_enable(int id, bool enable)
+{
+ return;
+}
+
void dispc_lcd_enable_signal_polarity(bool act_high)
{
if (!dss_has_feature(FEAT_LCDENABLEPOL))
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 556bc7c..bb25d96 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -195,6 +195,8 @@ int dss_wb_set_info(struct omap_dss_writeback *wb,
struct omap_dss_writeback_info *info);
void dss_wb_get_info(struct omap_dss_writeback *wb,
struct omap_dss_writeback_info *info);
+int dss_wb_enable(struct omap_dss_writeback *wb);
+void dss_wb_disable(struct omap_dss_writeback *wb);
/* display */
int dss_suspend_all_devices(void);
@@ -479,6 +481,7 @@ void dispc_mgr_setup(enum omap_channel channel,
bool dispc_wb_go_busy(int id);
void dispc_wb_go(int id);
int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi);
+void dispc_wb_enable(int id, bool enable);
/* VENC */
#ifdef CONFIG_OMAP2_DSS_VENC
diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
index 5e54221..eefab4e 100644
--- a/drivers/video/omap2/dss/writeback.c
+++ b/drivers/video/omap2/dss/writeback.c
@@ -38,13 +38,23 @@ static int dss_writeback_enable(struct omap_dss_writeback *wb)
r = dispc_runtime_get();
if (r)
- return r;
+ goto err0;
+
+ r = dss_wb_enable(wb);
+ if (r)
+ goto err1;
return 0;
+err1:
+ dispc_runtime_put();
+err0:
+ return r;
}
static void dss_writeback_disable(struct omap_dss_writeback *wb)
{
+ dss_wb_disable(wb);
+
dispc_runtime_put();
}
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 05/29] OMAPDSS: APPLY/Writeback: Apply writeback configurations
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
The writeback pipeline has properties of both overlays and overlay managers.
It is like an overlay as it has programmable base addresses and contains blocks
like scalar, color conversion unit, truncation unit, DISPC DMA FIFO. It is like
a manager as enabling it immediately starts transfer to the memory, and it has
a GO bit to use a new writeback configuration. Hence, writeback is a separate
entity when it comes to applying configurations.
When it comes to applying user_info to the private info maintained by DSS2, the
writeback pipeline can be considered tightly coupled with the manager it is
connected to. This makes sense as in the current DSS2 design as writeback is
always connected to a manager in all its modes. In capture mode, writeback is
connected to the manager from which we are capturing the frames. In memory to
memory mode, we would either connected to a manager if we are capturing the
manager's output, or we would connect to a dummy writeback manager when we are
capturing data from just one overlay.Calling a manager's apply() calls
omap_dss_mgr_apply_wb(), which copies the user_info to the private info struct
only if that manager has writeback connected to it. Hence, copying user_info
to private info for writeback is similar to how it is done for overlays.
Unlike overlays, writeback configurations can't be totally governed by the state
of the manager. In capture mode, writeback registers are governed by the GO bit
of WB. Hence, a new configuration can be written to writeback shadow registers
even if the manager it is connected to is busy. Hence, copying of private info
to shadow register and setting GO bit for writeback is similar to how it is done
for managers.
We register to dss_apply_irq_handler() if writeback needs to write a pending
configuration or clear the busy and shadow_dirty status if the previous
configuration was transferred from the shadow registers successfully. This
isn't optimal for capture mode as a new/pending writeback configuration is
applied sometime later than the connected manager's VSYNC interrupt. The new
configuration is taken only after WBDELAYCOUNT lines(in time) are generated by
the manager after the VSYNC interrupt.
Since we don't have any interrupt to get this event. We currently register
to the manager's VSYNC interrupt itself. The correct approach would be to
generate a timer based interrupt event after approximately WBDELAYCOUNT lines
after we get the VSYNC interrupts. This is not done for now.
Create dummy dispc_wb_go/go_busy and wb_setup functions. These will be filled
up in a later commit.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 164 ++++++++++++++++++++++++++++++++++++++-
drivers/video/omap2/dss/dispc.c | 15 ++++
drivers/video/omap2/dss/dss.h | 4 +
3 files changed, 181 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 19120c1..f40f58c 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -105,6 +105,15 @@ struct wb_priv_data {
bool user_info_dirty;
struct omap_dss_writeback_info user_info;
+
+ bool info_dirty;
+ struct omap_dss_writeback_info info;
+
+ bool shadow_info_dirty;
+
+ /* If true, GO bit is up and shadow registers cannot be written.
+ * Never true for writeback in memory to memory mode */
+ bool busy;
};
static struct {
@@ -250,6 +259,7 @@ static bool need_isr(void)
struct omap_overlay_manager *mgr;
struct mgr_priv_data *mp;
struct omap_overlay *ovl;
+ struct omap_dss_device *dssdev;
mgr = omap_dss_get_overlay_manager(i);
mp = get_mgr_priv(mgr);
@@ -304,13 +314,29 @@ static bool need_isr(void)
if (op->shadow_info_dirty)
return true;
}
+
+ dssdev = mgr->get_writeback(mgr);
+ if (dssdev) {
+ struct omap_dss_writeback *wb = dssdev->wbdev;
+ struct wb_priv_data *wp = get_wb_priv(wb);
+
+ if (wp->busy)
+ return true;
+
+ if (wp->info_dirty)
+ return true;
+
+ if (wp->shadow_info_dirty)
+ return true;
+
+ }
}
}
return false;
}
-static bool need_go(struct omap_overlay_manager *mgr)
+static bool need_mgr_go(struct omap_overlay_manager *mgr)
{
struct omap_overlay *ovl;
struct mgr_priv_data *mp;
@@ -330,6 +356,18 @@ static bool need_go(struct omap_overlay_manager *mgr)
return false;
}
+static bool need_wb_go(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp;
+
+ wp = get_wb_priv(wb);
+
+ if (wp->shadow_info_dirty)
+ return true;
+
+ return false;
+}
+
/* returns true if an extra_info field is currently being updated */
static bool extra_info_update_ongoing(void)
{
@@ -577,6 +615,29 @@ static void dss_ovl_write_regs_extra(struct omap_overlay *ovl)
op->shadow_extra_info_dirty = true;
}
+static void dss_wb_write_regs(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+ struct omap_dss_writeback_info *wi;
+ int r;
+
+ if (!wp->info_dirty)
+ return;
+
+ WARN_ON(wp->busy);
+
+ wi = &wp->info;
+
+ r = dispc_wb_setup(wb->id, wi);
+ if (r) {
+ DSSERR("dispc_wb_setup failed\n");
+ return;
+ }
+
+ wp->info_dirty = false;
+ wp->shadow_info_dirty = true;
+}
+
static void dss_mgr_write_regs(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);
@@ -607,6 +668,7 @@ static void dss_mgr_write_regs(struct omap_overlay_manager *mgr)
static void dss_write_regs(void)
{
const int num_mgrs = omap_dss_get_num_overlay_managers();
+ const int num_wb = dss_feat_get_num_wb();
int i;
for (i = 0; i < num_mgrs; ++i) {
@@ -631,11 +693,30 @@ static void dss_write_regs(void)
dss_mgr_write_regs(mgr);
}
+
+ for (i = 0; i < num_wb; ++i) {
+ struct omap_dss_writeback *wb;
+ struct wb_priv_data *wp;
+ struct mgr_priv_data *mp;
+
+ wb = omap_dss_get_writeback(i);
+ wp = get_wb_priv(wb);
+ mp = get_mgr_priv(wb->dssdev->manager);
+
+ if (!mp->enabled)
+ continue;
+
+ if (wp->busy)
+ continue;
+
+ dss_wb_write_regs(wb);
+ }
}
static void dss_set_go_bits(void)
{
const int num_mgrs = omap_dss_get_num_overlay_managers();
+ const int num_wb = dss_feat_get_num_wb();
int i;
for (i = 0; i < num_mgrs; ++i) {
@@ -648,7 +729,7 @@ static void dss_set_go_bits(void)
if (!mp->enabled || mgr_manual_update(mgr) || mp->busy)
continue;
- if (!need_go(mgr))
+ if (!need_mgr_go(mgr))
continue;
mp->busy = true;
@@ -659,6 +740,31 @@ static void dss_set_go_bits(void)
dispc_mgr_go(mgr->id);
}
+ for (i = 0; i < num_wb; ++i) {
+ struct omap_dss_writeback *wb;
+ struct wb_priv_data *wp;
+ struct mgr_priv_data *mp;
+
+ wb = omap_dss_get_writeback(i);
+ wp = get_wb_priv(wb);
+ mp = get_mgr_priv(wb->dssdev->manager);
+
+ if (!mp->enabled)
+ continue;
+
+ if (wp->busy)
+ continue;
+
+ if (!need_wb_go(wb))
+ continue;
+
+ wp->busy = true;
+
+ if (!dss_data.irq_enabled && need_isr())
+ dss_register_vsync_isr();
+
+ dispc_wb_go(wb->id);
+ }
}
void dss_mgr_start_update(struct omap_overlay_manager *mgr)
@@ -749,9 +855,18 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr)
}
}
+static void wb_clear_shadow_dirty(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp;
+
+ wp = get_wb_priv(wb);
+ wp->shadow_info_dirty = false;
+}
+
static void dss_apply_irq_handler(void *data, u32 mask)
{
const int num_mgrs = dss_feat_get_num_mgrs();
+ const int num_wb = dss_feat_get_num_wb();
int i;
bool extra_updating;
@@ -784,6 +899,32 @@ static void dss_apply_irq_handler(void *data, u32 mask)
}
}
+
+ for (i = 0; i < num_wb; i++) {
+ struct omap_dss_writeback *wb;
+ struct wb_priv_data *wp;
+ bool was_busy;
+
+ wb = omap_dss_get_writeback(i);
+ wp = get_wb_priv(wb);
+
+ was_busy = wp->busy;
+ wp->busy = dispc_wb_go_busy(i);
+
+ /*
+ * In writeback capture mode, the GO bit doesn't get reset
+ * at the manager's VSYNC interrupt. It takes an extra
+ * 'WBDELAYCOUNTER' time after VSYNC when the writeback
+ * FIFOs are flushed and the shadow registers are taken in.
+ * There isn't any DSS interrupt to notify this point in time.
+ * The correct solution would be to set off a timer here which
+ * generates an interrupt approximately after WBDELAYCOUNTER
+ * time.
+ */
+ if (was_busy && !wp->busy)
+ wb_clear_shadow_dirty(wb);
+ }
+
dss_write_regs();
dss_set_go_bits();
@@ -825,6 +966,20 @@ static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
mp->info = mp->user_info;
}
+static void omap_dss_mgr_apply_wb(struct omap_dss_writeback *wb)
+{
+ struct wb_priv_data *wp;
+
+ wp = get_wb_priv(wb);
+
+ if (!wp->user_info_dirty)
+ return;
+
+ wp->user_info_dirty = false;
+ wp->info_dirty = true;
+ wp->info = wp->user_info;
+}
+
int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
{
unsigned long flags;
@@ -852,6 +1007,11 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
/* Configure manager */
omap_dss_mgr_apply_mgr(mgr);
+ /* Configure writeback */
+ dssdev = mgr->get_writeback(mgr);
+ if (dssdev)
+ omap_dss_mgr_apply_wb(dssdev->wbdev);
+
dss_write_regs();
dss_set_go_bits();
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b228e05..d98905f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -508,6 +508,16 @@ void dispc_mgr_go(enum omap_channel channel)
REG_FLD_MOD(DISPC_CONTROL, 1, bit, bit);
}
+bool dispc_wb_go_busy(int id)
+{
+ return false;
+}
+
+void dispc_wb_go(int id)
+{
+ return;
+}
+
static void dispc_ovl_write_firh_reg(enum omap_plane plane, int reg, u32 value)
{
dispc_write_reg(DISPC_OVL_FIR_COEF_H(plane, reg), value);
@@ -1888,6 +1898,11 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
return 0;
}
+int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi)
+{
+ return 0;
+}
+
int dispc_ovl_enable(enum omap_plane plane, bool enable)
{
DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 9b3b93c..556bc7c 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -476,6 +476,10 @@ int dispc_mgr_get_clock_div(enum omap_channel channel,
void dispc_mgr_setup(enum omap_channel channel,
struct omap_overlay_manager_info *info);
+bool dispc_wb_go_busy(int id);
+void dispc_wb_go(int id);
+int dispc_wb_setup(int id, struct omap_dss_writeback_info *wi);
+
/* VENC */
#ifdef CONFIG_OMAP2_DSS_VENC
int venc_init_platform_driver(void);
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 04/29] OMAPDSS: APPLY/Writeback: Add writeback_info
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Create a struct called omap_dss_writeback_info. This contains 'overlay like'
parameters of the writeback pipeline. These parameters are expected to be
configured via get/set_info ops by the DSS2 user similar to how overlay and
manager parameters are configured. These will also be configurable via sysfs
attributes of the dummy writeback panel.
Add get_wb_info/set_wb_info ops in omap_dss_writeback struct. Create a minimal
wb_priv_data structure and a writeback simple_check function used for
dss_wb_get_info and dss_wb_set_info functions in apply.c
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 45 ++++++++++++++++++++++++++++++++
drivers/video/omap2/dss/dss.h | 7 +++++
drivers/video/omap2/dss/dss_features.h | 1 +
drivers/video/omap2/dss/writeback.c | 27 +++++++++++++++++++
include/video/omapdss.h | 18 ++++++++++++
5 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index d529664..19120c1 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -101,9 +101,16 @@ struct mgr_priv_data {
bool enabled;
};
+struct wb_priv_data {
+
+ bool user_info_dirty;
+ struct omap_dss_writeback_info user_info;
+};
+
static struct {
struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS];
struct mgr_priv_data mgr_priv_data_array[MAX_DSS_MANAGERS];
+ struct wb_priv_data wb_priv_data_array[MAX_DSS_WB];
bool irq_enabled;
} dss_data;
@@ -126,6 +133,11 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)
return &dss_data.mgr_priv_data_array[mgr->id];
}
+static struct wb_priv_data *get_wb_priv(struct omap_dss_writeback *wb)
+{
+ return &dss_data.wb_priv_data_array[wb->id];
+}
+
void dss_apply_init(void)
{
const int num_ovls = dss_feat_get_num_ovls();
@@ -1351,3 +1363,36 @@ err:
return r;
}
+int dss_wb_set_info(struct omap_dss_writeback *wb,
+ struct omap_dss_writeback_info *info)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+ unsigned long flags;
+ int r;
+
+ r = dss_wb_simple_check(wb, info);
+ if (r)
+ return r;
+
+ spin_lock_irqsave(&data_lock, flags);
+
+ wp->user_info = *info;
+ wp->user_info_dirty = true;
+
+ spin_unlock_irqrestore(&data_lock, flags);
+
+ return 0;
+}
+
+void dss_wb_get_info(struct omap_dss_writeback *wb,
+ struct omap_dss_writeback_info *info)
+{
+ struct wb_priv_data *wp = get_wb_priv(wb);
+ unsigned long flags;
+
+ spin_lock_irqsave(&data_lock, flags);
+
+ *info = wp->user_info;
+
+ spin_unlock_irqrestore(&data_lock, flags);
+}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 607e730..9b3b93c 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -191,6 +191,11 @@ int dss_ovl_set_manager(struct omap_overlay *ovl,
struct omap_overlay_manager *mgr);
int dss_ovl_unset_manager(struct omap_overlay *ovl);
+int dss_wb_set_info(struct omap_dss_writeback *wb,
+ struct omap_dss_writeback_info *info);
+void dss_wb_get_info(struct omap_dss_writeback *wb,
+ struct omap_dss_writeback_info *info);
+
/* display */
int dss_suspend_all_devices(void);
int dss_resume_all_devices(void);
@@ -230,6 +235,8 @@ int dss_ovl_check(struct omap_overlay *ovl,
void dss_init_writeback(void);
void dss_uninit_writeback(void);
int writeback_init_display(struct omap_dss_device *dssdev);
+int dss_wb_simple_check(struct omap_dss_writeback *wb,
+ const struct omap_dss_writeback_info *info);
/* DSS */
int dss_init_platform_driver(void);
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 75ee1f1..b3486da 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -28,6 +28,7 @@
#define MAX_DSS_OVERLAYS 4
#define MAX_DSS_LCD_MANAGERS 2
#define MAX_NUM_DSI 2
+#define MAX_DSS_WB 1
/* DSS has feature id */
enum dss_feat_id {
diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
index ac5d3ba..5e54221 100644
--- a/drivers/video/omap2/dss/writeback.c
+++ b/drivers/video/omap2/dss/writeback.c
@@ -78,6 +78,9 @@ void dss_init_writeback(void)
struct omap_dss_writeback *wb = &writeback[i];
wb->id = i;
+
+ wb->set_wb_info = &dss_wb_set_info;
+ wb->get_wb_info = &dss_wb_get_info;
}
omap_dss_register_driver(&writeback_panel_driver);
@@ -109,6 +112,30 @@ int writeback_init_display(struct omap_dss_device *dssdev)
return 0;
}
+int dss_wb_simple_check(struct omap_dss_writeback *wb,
+ const struct omap_dss_writeback_info *info)
+{
+ if (info->paddr = 0) {
+ DSSERR("wb_simple_check: paddr cannot be 0\n");
+ return -EINVAL;
+ }
+
+ if (info->color_mode = OMAP_DSS_COLOR_NV12 &&
+ info->p_uv_addr = 0) {
+ DSSERR("wb_simple_check: p_uv_addr cannot be 0 for NV12"
+ " format\n");
+ return -EINVAL;
+ }
+
+ if (info->capture_rate < 0 || info->capture_rate > 7) {
+ DSSERR("wb_simple_check: capture rate cannot be %d\n",
+ info->capture_rate);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
/* Dummy Writeback Panel driver */
static int writeback_panel_probe(struct omap_dss_device *dssdev)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 77e2ca4..01092e4 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -472,11 +472,29 @@ struct omap_overlay_manager {
struct omap_dss_device *(*get_writeback)(struct omap_overlay_manager *mgr);
};
+struct omap_dss_writeback_info {
+ u32 paddr;
+ u32 p_uv_addr;
+ u16 buf_width;
+ u16 buf_height;
+ enum omap_color_mode color_mode;
+ u8 rotation;
+ enum omap_dss_rotation_type rotation_type;
+ bool mirror;
+ u8 pre_mult_alpha;
+ int capture_rate;
+};
+
struct omap_dss_writeback {
int id;
/* dummy panel we are connected to */
struct omap_dss_device *dssdev;
+
+ int (*set_wb_info)(struct omap_dss_writeback *wb,
+ struct omap_dss_writeback_info *info);
+ void (*get_wb_info)(struct omap_dss_writeback *wb,
+ struct omap_dss_writeback_info *info);
};
struct omap_dss_device {
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 03/29] OMAPDSS: Writeback: Add writeback interface and panel driver
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Create a new struct called omap_dss_writeback. This will represent a writeback
pipeline the way omap_overlay and omap_overlay_manager represent overlay and
managers respectively.
Create a writeback interface and a dummy writeback panel driver. The writeback
panel driver is needed for the omap_dss_device pointer which represents
writeback in omap_dss_mgr_output.
Add a omap_dss_device pointer to the omap_dss_writeback struct, and a
omap_dss_writeback pointer in omap_dss_device struct, link the writeback and
dss_device together when the latter is added.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/Makefile | 2 +-
drivers/video/omap2/dss/core.c | 2 +
drivers/video/omap2/dss/display.c | 3 +
drivers/video/omap2/dss/dss.h | 5 +
drivers/video/omap2/dss/dss_features.c | 8 +
drivers/video/omap2/dss/dss_features.h | 1 +
drivers/video/omap2/dss/writeback.c | 223 ++++++++++++++++++++++++++++++++
include/video/omapdss.h | 13 ++
8 files changed, 256 insertions(+), 1 deletions(-)
create mode 100644 drivers/video/omap2/dss/writeback.c
diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
index 5c450b0..51c544e 100644
--- a/drivers/video/omap2/dss/Makefile
+++ b/drivers/video/omap2/dss/Makefile
@@ -1,6 +1,6 @@
obj-$(CONFIG_OMAP2_DSS) += omapdss.o
omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \
- manager.o overlay.o apply.o
+ manager.o overlay.o apply.o writeback.o
omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o
omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5c46430..21bfd0a 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -182,6 +182,7 @@ static int omap_dss_probe(struct platform_device *pdev)
dss_init_overlay_managers(pdev);
dss_init_overlays(pdev);
+ dss_init_writeback();
r = dss_init_platform_driver();
if (r) {
@@ -276,6 +277,7 @@ static int omap_dss_remove(struct platform_device *pdev)
dispc_uninit_platform_driver();
dss_uninit_platform_driver();
+ dss_uninit_writeback();
dss_uninit_overlays(pdev);
dss_uninit_overlay_managers(pdev);
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index be331dc..a712bad 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -391,6 +391,9 @@ void dss_init_device(struct platform_device *pdev,
case OMAP_DISPLAY_TYPE_HDMI:
r = hdmi_init_display(dssdev);
break;
+ case OMAP_DISPLAY_TYPE_WB:
+ r = writeback_init_display(dssdev);
+ break;
default:
DSSERR("Support for display '%s' not compiled in.\n",
dssdev->name);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 3cf99a9..607e730 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -226,6 +226,11 @@ int dss_ovl_simple_check(struct omap_overlay *ovl,
int dss_ovl_check(struct omap_overlay *ovl,
struct omap_overlay_info *info, struct omap_dss_device *dssdev);
+/* writeback */
+void dss_init_writeback(void);
+void dss_uninit_writeback(void);
+int writeback_init_display(struct omap_dss_device *dssdev);
+
/* DSS */
int dss_init_platform_driver(void);
void dss_uninit_platform_driver(void);
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 5e4b829..ca41620 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -45,6 +45,7 @@ struct omap_dss_features {
const int num_mgrs;
const int num_ovls;
+ const int num_wb;
const enum omap_display_type *supported_displays;
const enum omap_color_mode *supported_color_modes;
const enum omap_overlay_caps *overlay_caps;
@@ -423,6 +424,7 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = {
.num_mgrs = 3,
.num_ovls = 4,
+ .num_wb = 1,
.supported_displays = omap4_dss_supported_displays,
.supported_color_modes = omap4_dss_supported_color_modes,
.overlay_caps = omap4_dss_overlay_caps,
@@ -447,6 +449,7 @@ static const struct omap_dss_features omap4_dss_features = {
.num_mgrs = 3,
.num_ovls = 4,
+ .num_wb = 1,
.supported_displays = omap4_dss_supported_displays,
.supported_color_modes = omap4_dss_supported_color_modes,
.overlay_caps = omap4_dss_overlay_caps,
@@ -493,6 +496,11 @@ int dss_feat_get_num_ovls(void)
return omap_current_dss_features->num_ovls;
}
+int dss_feat_get_num_wb(void)
+{
+ return omap_current_dss_features->num_wb;
+}
+
unsigned long dss_feat_get_param_min(enum dss_range_param param)
{
return omap_current_dss_features->dss_params[param].min;
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index cd833bb..75ee1f1 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -92,6 +92,7 @@ enum dss_range_param {
/* DSS Feature Functions */
int dss_feat_get_num_mgrs(void);
int dss_feat_get_num_ovls(void);
+int dss_feat_get_num_wb(void);
unsigned long dss_feat_get_param_min(enum dss_range_param param);
unsigned long dss_feat_get_param_max(enum dss_range_param param);
enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
diff --git a/drivers/video/omap2/dss/writeback.c b/drivers/video/omap2/dss/writeback.c
new file mode 100644
index 0000000..ac5d3ba
--- /dev/null
+++ b/drivers/video/omap2/dss/writeback.c
@@ -0,0 +1,223 @@
+/*
+ * Copyright (C) 2011 Texas Instruments
+ * Author: Archit Taneja <archit@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define DSS_SUBSYS_NAME "WRITEBACK"
+
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/sysfs.h>
+
+#include <video/omapdss.h>
+
+#include "dss.h"
+#include "dss_features.h"
+
+static int num_writeback, num_wb_panels;
+static struct omap_dss_writeback *writeback;
+static struct omap_dss_driver writeback_panel_driver;
+
+static int dss_writeback_enable(struct omap_dss_writeback *wb)
+{
+ int r;
+
+ r = dispc_runtime_get();
+ if (r)
+ return r;
+
+ return 0;
+}
+
+static void dss_writeback_disable(struct omap_dss_writeback *wb)
+{
+ dispc_runtime_put();
+}
+
+struct omap_dss_writeback *omap_dss_get_writeback(int id)
+{
+ if (id >= num_writeback)
+ return NULL;
+
+ return &writeback[id];
+}
+EXPORT_SYMBOL(omap_dss_get_writeback);
+
+int omap_dss_get_num_writeback(void)
+{
+ return num_writeback;
+}
+EXPORT_SYMBOL(omap_dss_get_num_writeback);
+
+void dss_init_writeback(void)
+{
+ int i;
+
+ num_writeback = dss_feat_get_num_wb();
+
+ writeback = kzalloc(sizeof(struct omap_dss_writeback) * num_writeback,
+ GFP_KERNEL);
+
+ BUG_ON(writeback = NULL);
+
+ for (i = 0; i < num_writeback; i++) {
+ struct omap_dss_writeback *wb = &writeback[i];
+
+ wb->id = i;
+ }
+
+ omap_dss_register_driver(&writeback_panel_driver);
+}
+
+void dss_uninit_writeback(void)
+{
+ kfree(writeback);
+ writeback = NULL;
+ num_writeback = 0;
+
+ omap_dss_unregister_driver(&writeback_panel_driver);
+}
+
+int writeback_init_display(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_writeback *wb;
+
+ DSSDBG("init_display\n");
+
+ if (num_wb_panels >= num_writeback)
+ return -EINVAL;
+
+ wb = omap_dss_get_writeback(num_wb_panels++);
+
+ wb->dssdev = dssdev;
+ dssdev->wbdev = wb;
+
+ return 0;
+}
+
+/* Dummy Writeback Panel driver */
+
+static int writeback_panel_probe(struct omap_dss_device *dssdev)
+{
+ return 0;
+}
+
+static void __exit writeback_panel_remove(struct omap_dss_device *dssdev)
+{
+}
+
+static int writeback_panel_power_on(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE)
+ return 0;
+
+ r = dss_writeback_enable(dssdev->wbdev);
+ if (r)
+ return r;
+
+ return 0;
+}
+
+static void writeback_panel_power_off(struct omap_dss_device *dssdev)
+{
+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ dss_writeback_disable(dssdev->wbdev);
+}
+
+static int writeback_panel_enable(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ r = writeback_panel_power_on(dssdev);
+ if (r)
+ return r;
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+}
+
+static void writeback_panel_disable(struct omap_dss_device *dssdev)
+{
+ writeback_panel_power_off(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+
+static int writeback_panel_suspend(struct omap_dss_device *dssdev)
+{
+ writeback_panel_power_off(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+
+ return 0;
+}
+
+static int writeback_panel_resume(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ r = writeback_panel_power_on(dssdev);
+ if (r)
+ return r;
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+}
+
+static void writeback_panel_set_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ dssdev->panel.timings.x_res = timings->x_res;
+ dssdev->panel.timings.y_res = timings->y_res;
+}
+
+static void writeback_panel_get_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ *timings = dssdev->panel.timings;
+}
+
+static int writeback_panel_check_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ return 0;
+}
+
+static struct omap_dss_driver writeback_panel_driver = {
+ .probe = writeback_panel_probe,
+ .remove = writeback_panel_remove,
+
+ .enable = writeback_panel_enable,
+ .disable = writeback_panel_disable,
+ .suspend = writeback_panel_suspend,
+ .resume = writeback_panel_resume,
+
+ .set_timings = writeback_panel_set_timings,
+ .get_timings = writeback_panel_get_timings,
+ .check_timings = writeback_panel_check_timings,
+
+ .driver = {
+ .name = "writeback",
+ .owner = THIS_MODULE,
+ },
+};
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 93a1cd3..77e2ca4 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -60,6 +60,7 @@ enum omap_display_type {
OMAP_DISPLAY_TYPE_DSI = 1 << 3,
OMAP_DISPLAY_TYPE_VENC = 1 << 4,
OMAP_DISPLAY_TYPE_HDMI = 1 << 5,
+ OMAP_DISPLAY_TYPE_WB = 1 << 6,
};
enum omap_plane {
@@ -471,6 +472,13 @@ struct omap_overlay_manager {
struct omap_dss_device *(*get_writeback)(struct omap_overlay_manager *mgr);
};
+struct omap_dss_writeback {
+ int id;
+
+ /* dummy panel we are connected to */
+ struct omap_dss_device *dssdev;
+};
+
struct omap_dss_device {
struct device dev;
@@ -584,6 +592,8 @@ struct omap_dss_device {
struct omap_overlay_manager *manager;
+ struct omap_dss_writeback *wbdev;
+
enum omap_dss_display_state state;
/* platform specific */
@@ -661,6 +671,9 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
int omap_dss_get_num_overlays(void);
struct omap_overlay *omap_dss_get_overlay(int num);
+struct omap_dss_writeback *omap_dss_get_writeback(int id);
+int omap_dss_get_num_writeback(void);
+
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 02/29] OMAPDSS: Add writeback to omap_dss_mgr_output
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Add a omap_dss_device pointer in omap_dss_mgr_output to represent a writeback
device. The writeback device is a dummy omap_dss_device pointer connected to
the manager. It is a place holder for the actual writeback entity and is used
for compatibility with the existing DSS2 code.
Create helper overlay manager functions get_display() and get_writeback() which
return mgr->output->device and mgr->output->writeback devices. Modify
get_output() to return the display device if both device and writeback pointers
are set. Otherwise, return the omap_dss_device pointer which is set.
If writeback is in use, get_output() returns the display device if we are in
capture mode, and it returns the writeback device if we are in memory to memory
mode. This is beneficial as most checks/configurations for overlays and managers
should be done on the basis of the manager's output display in capture mode, and
the writeback device in case of memory to memory mode.
get_display() should be used when we are interested specifically in the
connected display, the same holds for get_writeback().
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/manager.c | 19 +++++++++++++++++--
include/video/omapdss.h | 3 +++
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 094c96c..4962f7b 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -43,7 +43,7 @@ static ssize_t manager_name_show(struct omap_overlay_manager *mgr, char *buf)
static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
{
- struct omap_dss_device *dssdev = mgr->get_output(mgr);
+ struct omap_dss_device *dssdev = mgr->get_display(mgr);
return snprintf(buf, PAGE_SIZE, "%s\n", dssdev ?
dssdev->name : "<none>");
@@ -74,7 +74,7 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
if (dssdev)
DSSDBG("display %s found\n", dssdev->name);
- if (mgr->get_output(mgr)) {
+ if (mgr->get_display(mgr)) {
r = mgr->unset_device(mgr);
if (r) {
DSSERR("failed to unset display\n");
@@ -494,9 +494,22 @@ static struct kobj_type manager_ktype = {
static inline struct omap_dss_device *dss_mgr_get_output(struct omap_overlay_manager *mgr)
{
+ if (mgr->output->device)
+ return mgr->output->device;
+
+ return mgr->output->writeback;
+}
+
+static inline struct omap_dss_device *dss_mgr_get_display(struct omap_overlay_manager *mgr)
+{
return mgr->output->device;
}
+static inline struct omap_dss_device *dss_mgr_get_writeback(struct omap_overlay_manager *mgr)
+{
+ return mgr->output->writeback;
+}
+
static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
{
unsigned long timeout = msecs_to_jiffies(500);
@@ -562,6 +575,8 @@ int dss_init_overlay_managers(struct platform_device *pdev)
mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
mgr->get_output = &dss_mgr_get_output;
+ mgr->get_display = &dss_mgr_get_display;
+ mgr->get_writeback = &dss_mgr_get_writeback;
mgr->caps = 0;
mgr->supported_displays diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 1b968bb..93a1cd3 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -413,6 +413,7 @@ struct omap_overlay {
struct omap_dss_mgr_output {
struct omap_dss_device *device;
+ struct omap_dss_device *writeback;
};
struct omap_overlay_manager_info {
@@ -466,6 +467,8 @@ struct omap_overlay_manager {
int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
struct omap_dss_device *(*get_output)(struct omap_overlay_manager *mgr);
+ struct omap_dss_device *(*get_display)(struct omap_overlay_manager *mgr);
+ struct omap_dss_device *(*get_writeback)(struct omap_overlay_manager *mgr);
};
struct omap_dss_device {
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 01/29] omapdss/omapfb/omap_vout: Introduce manager output struct
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1324989432-3625-1-git-send-email-archit@ti.com>
Introduce struct omap_dss_mgr_output, this describes the output connected to the
manager. This has been introduced as the output of a manager may not be just a
a display device, it could be connected to writeback or both.
The output struct will act as a container for 2 omap_dss_device pointers, one
for the display attached, and one for the writeback panel if that manager is
using writeback pipeline. The mode of operation(only displaying on a panel,
writeback capture mode, writeback memory to memory mode) is configured within
DSS2 based on how the user sets these outputs.
The omap_dss_device pointer connected to a manager is accessed by a omap_overlay
or a omap_overlay_manager pointer by references like manager->device and
ovl->manager->device. Replace such accesses by creating a helper function
get_output() in the overlay_manager struct.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/media/video/omap/omap_vout.c | 78 +++++++++++++++++++++---------
drivers/video/omap2/dss/apply.c | 73 +++++++++++++++++++--------
drivers/video/omap2/dss/dispc.c | 11 +++--
drivers/video/omap2/dss/manager.c | 29 +++++++++--
drivers/video/omap2/dss/overlay.c | 12 ++--
drivers/video/omap2/omapfb/omapfb-main.c | 7 ++-
drivers/video/omap2/omapfb/omapfb.h | 5 +-
include/video/omapdss.h | 8 +++-
8 files changed, 158 insertions(+), 65 deletions(-)
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index 27c19fe..b9cdb1e 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -453,11 +453,16 @@ static int omapvid_init(struct omap_vout_device *vout, u32 addr)
win = &vout->win;
for (i = 0; i < ovid->num_overlays; i++) {
+ struct omap_dss_device *dssdev;
+
ovl = ovid->overlays[i];
- if (!ovl->manager || !ovl->manager->device)
+ dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
+
+ if (!dssdev)
return -EINVAL;
- timing = &ovl->manager->device->panel.timings;
+ timing = &dssdev->panel.timings;
outw = win->w.width;
outh = win->w.height;
@@ -514,8 +519,12 @@ static int omapvid_apply_changes(struct omap_vout_device *vout)
struct omapvideo_info *ovid = &vout->vid_info;
for (i = 0; i < ovid->num_overlays; i++) {
+ struct omap_dss_device *dssdev;
+
ovl = ovid->overlays[i];
- if (!ovl->manager || !ovl->manager->device)
+ dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
+ if (!dssdev)
return -EINVAL;
ovl->manager->apply(ovl->manager);
}
@@ -539,10 +548,11 @@ static void omap_vout_isr(void *arg, unsigned int irqstatus)
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
/* get the display device attached to the overlay */
- if (!ovl->manager || !ovl->manager->device)
- return;
+ cur_display = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
- cur_display = ovl->manager->device;
+ if (!cur_display)
+ return;
spin_lock(&vout->vbq_lock);
do_gettimeofday(&timevalue);
@@ -942,7 +952,10 @@ static int omap_vout_release(struct file *file)
/* Disable all the overlay managers connected with this interface */
for (i = 0; i < ovid->num_overlays; i++) {
struct omap_overlay *ovl = ovid->overlays[i];
- if (ovl->manager && ovl->manager->device)
+ struct omap_dss_device *dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
+
+ if (dssdev)
ovl->disable(ovl);
}
/* Turn off the pipeline */
@@ -1074,14 +1087,17 @@ static int vidioc_try_fmt_vid_out(struct file *file, void *fh,
struct omapvideo_info *ovid;
struct omap_video_timings *timing;
struct omap_vout_device *vout = fh;
+ struct omap_dss_device *dssdev;
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
+ /* get the display device attached to the overlay */
+ dssdev = ovl->manager ? ovl->manager->get_output(ovl->manager) : NULL;
- if (!ovl->manager || !ovl->manager->device)
+ if (!dssdev)
return -EINVAL;
- /* get the display device attached to the overlay */
- timing = &ovl->manager->device->panel.timings;
+
+ timing = &dssdev->panel.timings;
vout->fbuf.fmt.height = timing->y_res;
vout->fbuf.fmt.width = timing->x_res;
@@ -1098,6 +1114,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
struct omapvideo_info *ovid;
struct omap_video_timings *timing;
struct omap_vout_device *vout = fh;
+ struct omap_dss_device *dssdev;
if (vout->streaming)
return -EBUSY;
@@ -1106,13 +1123,14 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
+ dssdev = ovl->manager ? ovl->manager->get_output(ovl->manager) : NULL;
/* get the display device attached to the overlay */
- if (!ovl->manager || !ovl->manager->device) {
+ if (!dssdev) {
ret = -EINVAL;
goto s_fmt_vid_out_exit;
}
- timing = &ovl->manager->device->panel.timings;
+ timing = &dssdev->panel.timings;
/* We dont support RGB24-packed mode if vrfb rotation
* is enabled*/
@@ -1291,6 +1309,7 @@ static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
struct omapvideo_info *ovid;
struct omap_overlay *ovl;
struct omap_video_timings *timing;
+ struct omap_dss_device *dssdev;
if (vout->streaming)
return -EBUSY;
@@ -1298,13 +1317,15 @@ static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
mutex_lock(&vout->lock);
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
+ /* get the display device attached to the overlay */
+ dssdev = ovl->manager ? ovl->manager->get_output(ovl->manager) : NULL;
- if (!ovl->manager || !ovl->manager->device) {
+ if (!dssdev) {
ret = -EINVAL;
goto s_crop_err;
}
- /* get the display device attached to the overlay */
- timing = &ovl->manager->device->panel.timings;
+
+ timing = &dssdev->panel.timings;
if (is_rotation_90_or_270(vout)) {
vout->fbuf.fmt.height = timing->x_res;
@@ -1659,8 +1680,10 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
for (j = 0; j < ovid->num_overlays; j++) {
struct omap_overlay *ovl = ovid->overlays[j];
+ struct omap_dss_device *dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
- if (ovl->manager && ovl->manager->device) {
+ if (dssdev) {
struct omap_overlay_info info;
ovl->get_overlay_info(ovl, &info);
info.paddr = addr;
@@ -1683,8 +1706,10 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
for (j = 0; j < ovid->num_overlays; j++) {
struct omap_overlay *ovl = ovid->overlays[j];
+ struct omap_dss_device *dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
- if (ovl->manager && ovl->manager->device) {
+ if (dssdev) {
ret = ovl->enable(ovl);
if (ret)
goto streamon_err1;
@@ -1719,8 +1744,10 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
for (j = 0; j < ovid->num_overlays; j++) {
struct omap_overlay *ovl = ovid->overlays[j];
+ struct omap_dss_device *dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
- if (ovl->manager && ovl->manager->device)
+ if (dssdev)
ovl->disable(ovl);
}
@@ -1881,8 +1908,9 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
struct video_device *vfd;
struct v4l2_pix_format *pix;
struct v4l2_control *control;
+ struct omap_overlay *ovl = vout->vid_info.overlays[0];
struct omap_dss_device *display - vout->vid_info.overlays[0]->manager->device;
+ ovl->manager->get_output(ovl->manager);
/* set the default pix */
pix = &vout->pix;
@@ -2188,8 +2216,10 @@ static int __init omap_vout_probe(struct platform_device *pdev)
*/
for (i = 1; i < vid_dev->num_overlays; i++) {
ovl = omap_dss_get_overlay(i);
- if (ovl->manager && ovl->manager->device) {
- def_display = ovl->manager->device;
+ dssdev = ovl->manager ? ovl->manager->get_output(ovl->manager) :
+ NULL;
+ if (dssdev) {
+ def_display = dssdev;
} else {
dev_warn(&pdev->dev, "cannot find display\n");
def_display = NULL;
@@ -2236,8 +2266,10 @@ probe_err1:
for (i = 1; i < vid_dev->num_overlays; i++) {
def_display = NULL;
ovl = omap_dss_get_overlay(i);
- if (ovl->manager && ovl->manager->device)
- def_display = ovl->manager->device;
+ dssdev = ovl->manager ? ovl->manager->get_output(ovl->manager) :
+ NULL;
+ if (dssdev)
+ def_display = dssdev;
if (def_display && def_display->driver)
def_display->driver->disable(def_display);
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 052dc87..d529664 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -164,12 +164,16 @@ void dss_apply_init(void)
static bool ovl_manual_update(struct omap_overlay *ovl)
{
- return ovl->manager->device->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
+ struct omap_dss_device *dssdev = ovl->manager->get_output(ovl->manager);
+
+ return dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
}
static bool mgr_manual_update(struct omap_overlay_manager *mgr)
{
- return mgr->device->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
+ struct omap_dss_device *dssdev = mgr->get_output(mgr);
+
+ return dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
}
static int dss_check_settings_low(struct omap_overlay_manager *mgr,
@@ -380,7 +384,7 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
u32 irq;
int r;
int i;
- struct omap_dss_device *dssdev = mgr->device;
+ struct omap_dss_device *dssdev = mgr->get_output(mgr);
if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return 0;
@@ -443,7 +447,7 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
if (!ovl->manager)
return 0;
- dssdev = ovl->manager->device;
+ dssdev = ovl->manager->get_output(ovl->manager);
if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return 0;
@@ -500,18 +504,21 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl)
struct omap_overlay_info *oi;
bool ilace, replication;
struct mgr_priv_data *mp;
+ struct omap_dss_device *dssdev;
int r;
DSSDBGF("%d", ovl->id);
+ dssdev = ovl->manager->get_output(ovl->manager);
+
if (!op->enabled || !op->info_dirty)
return;
oi = &op->info;
- replication = dss_use_replication(ovl->manager->device, oi->color_mode);
+ replication = dss_use_replication(dssdev, oi->color_mode);
- ilace = ovl->manager->device->type = OMAP_DISPLAY_TYPE_VENC;
+ ilace = dssdev->type = OMAP_DISPLAY_TYPE_VENC;
r = dispc_ovl_setup(ovl->id, oi, ilace, replication);
if (r) {
@@ -593,15 +600,17 @@ static void dss_write_regs(void)
for (i = 0; i < num_mgrs; ++i) {
struct omap_overlay_manager *mgr;
struct mgr_priv_data *mp;
+ struct omap_dss_device *dssdev;
int r;
mgr = omap_dss_get_overlay_manager(i);
mp = get_mgr_priv(mgr);
+ dssdev = mgr->get_output(mgr);
if (!mp->enabled || mgr_manual_update(mgr) || mp->busy)
continue;
- r = dss_check_settings(mgr, mgr->device);
+ r = dss_check_settings(mgr, dssdev);
if (r) {
DSSERR("cannot write registers for manager %s: "
"illegal configuration\n", mgr->name);
@@ -643,6 +652,7 @@ static void dss_set_go_bits(void)
void dss_mgr_start_update(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);
+ struct omap_dss_device *dssdev;
unsigned long flags;
int r;
@@ -650,7 +660,9 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr)
WARN_ON(mp->updating);
- r = dss_check_settings(mgr, mgr->device);
+ dssdev = mgr->get_output(mgr);
+
+ r = dss_check_settings(mgr, dssdev);
if (r) {
DSSERR("cannot start manual update: illegal configuration\n");
spin_unlock_irqrestore(&data_lock, flags);
@@ -805,13 +817,16 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
{
unsigned long flags;
struct omap_overlay *ovl;
+ struct omap_dss_device *dssdev;
int r;
DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
spin_lock_irqsave(&data_lock, flags);
- r = dss_check_settings_apply(mgr, mgr->device);
+ dssdev = mgr->get_output(mgr);
+
+ r = dss_check_settings_apply(mgr, dssdev);
if (r) {
spin_unlock_irqrestore(&data_lock, flags);
DSSERR("failed to apply settings: illegal configuration.\n");
@@ -869,7 +884,7 @@ static void dss_ovl_setup_fifo(struct omap_overlay *ovl)
if (!op->enabled && !op->enabling)
return;
- dssdev = ovl->manager->device;
+ dssdev = ovl->manager->get_output(ovl->manager);
size = dispc_ovl_get_fifo_size(ovl->id);
@@ -926,6 +941,7 @@ static void dss_setup_fifos(void)
int dss_mgr_enable(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);
+ struct omap_dss_device *dssdev;
unsigned long flags;
int r;
@@ -938,7 +954,9 @@ int dss_mgr_enable(struct omap_overlay_manager *mgr)
mp->enabled = true;
- r = dss_check_settings(mgr, mgr->device);
+ dssdev = mgr->get_output(mgr);
+
+ r = dss_check_settings(mgr, dssdev);
if (r) {
DSSERR("failed to enable manager %d: check_settings failed\n",
mgr->id);
@@ -1036,21 +1054,21 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
mutex_lock(&apply_lock);
if (dssdev->manager) {
- DSSERR("display '%s' already has a manager '%s'\n",
+ DSSERR("device '%s' already has a manager '%s'\n",
dssdev->name, dssdev->manager->name);
r = -EINVAL;
goto err;
}
if ((mgr->supported_displays & dssdev->type) = 0) {
- DSSERR("display '%s' does not support manager '%s'\n",
+ DSSERR("device '%s' does not support manager '%s'\n",
dssdev->name, mgr->name);
r = -EINVAL;
goto err;
}
dssdev->manager = mgr;
- mgr->device = dssdev;
+ mgr->output->device = dssdev;
mutex_unlock(&apply_lock);
@@ -1063,11 +1081,14 @@ err:
int dss_mgr_unset_device(struct omap_overlay_manager *mgr)
{
int r;
+ struct omap_dss_device *curr_dssdev;
mutex_lock(&apply_lock);
- if (!mgr->device) {
- DSSERR("failed to unset display, display not set.\n");
+ curr_dssdev = mgr->output->device;
+
+ if (!curr_dssdev) {
+ DSSERR("failed to unset device, device not set.\n");
r = -EINVAL;
goto err;
}
@@ -1076,13 +1097,13 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr)
* Don't allow currently enabled displays to have the overlay manager
* pulled out from underneath them
*/
- if (mgr->device->state != OMAP_DSS_DISPLAY_DISABLED) {
+ if (curr_dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
r = -EINVAL;
goto err;
}
- mgr->device->manager = NULL;
- mgr->device = NULL;
+ curr_dssdev->manager = NULL;
+ mgr->output->device = NULL;
mutex_unlock(&apply_lock);
@@ -1240,6 +1261,7 @@ bool dss_ovl_is_enabled(struct omap_overlay *ovl)
int dss_ovl_enable(struct omap_overlay *ovl)
{
struct ovl_priv_data *op = get_ovl_priv(ovl);
+ struct omap_dss_device *dssdev;
unsigned long flags;
int r;
@@ -1250,7 +1272,10 @@ int dss_ovl_enable(struct omap_overlay *ovl)
goto err1;
}
- if (ovl->manager = NULL || ovl->manager->device = NULL) {
+ dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
+
+ if (!dssdev) {
r = -EINVAL;
goto err1;
}
@@ -1259,7 +1284,7 @@ int dss_ovl_enable(struct omap_overlay *ovl)
op->enabling = true;
- r = dss_check_settings(ovl->manager, ovl->manager->device);
+ r = dss_check_settings(ovl->manager, dssdev);
if (r) {
DSSERR("failed to enable overlay %d: check_settings failed\n",
ovl->id);
@@ -1290,6 +1315,7 @@ err1:
int dss_ovl_disable(struct omap_overlay *ovl)
{
struct ovl_priv_data *op = get_ovl_priv(ovl);
+ struct omap_dss_device *dssdev;
unsigned long flags;
int r;
@@ -1300,7 +1326,10 @@ int dss_ovl_disable(struct omap_overlay *ovl)
goto err;
}
- if (ovl->manager = NULL || ovl->manager->device = NULL) {
+ dssdev = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
+
+ if (!dssdev) {
r = -EINVAL;
goto err;
}
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index a5ec7f3..b228e05 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -419,7 +419,7 @@ static struct omap_dss_device *dispc_mgr_get_device(enum omap_channel channel)
struct omap_overlay_manager *mgr omap_dss_get_overlay_manager(channel);
- return mgr ? mgr->device : NULL;
+ return mgr ? mgr->get_output(mgr) : NULL;
}
u32 dispc_mgr_get_vsync_irq(enum omap_channel channel)
@@ -3096,7 +3096,7 @@ static void dispc_error_worker(struct work_struct *work)
bit = sync_lost_bits[i];
if (bit & errors) {
- struct omap_dss_device *dssdev = mgr->device;
+ struct omap_dss_device *dssdev = mgr->get_output(mgr);
bool enable;
DSSERR("SYNC_LOST on channel %s, restarting the output "
@@ -3127,9 +3127,12 @@ static void dispc_error_worker(struct work_struct *work)
DSSERR("OCP_ERR\n");
for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
struct omap_overlay_manager *mgr;
+ struct omap_dss_device *dssdev;
+
mgr = omap_dss_get_overlay_manager(i);
- if (mgr->device && mgr->device->driver)
- mgr->device->driver->disable(mgr->device);
+ dssdev = mgr->get_output(mgr);
+ if (dssdev && dssdev->driver)
+ dssdev->driver->disable(dssdev);
}
}
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index d1858e7..094c96c 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -43,8 +43,10 @@ static ssize_t manager_name_show(struct omap_overlay_manager *mgr, char *buf)
static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%s\n",
- mgr->device ? mgr->device->name : "<none>");
+ struct omap_dss_device *dssdev = mgr->get_output(mgr);
+
+ return snprintf(buf, PAGE_SIZE, "%s\n", dssdev ?
+ dssdev->name : "<none>");
}
static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
@@ -72,7 +74,7 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
if (dssdev)
DSSDBG("display %s found\n", dssdev->name);
- if (mgr->device) {
+ if (mgr->get_output(mgr)) {
r = mgr->unset_device(mgr);
if (r) {
DSSERR("failed to unset display\n");
@@ -490,14 +492,23 @@ static struct kobj_type manager_ktype = {
.default_attrs = manager_sysfs_attrs,
};
+static inline struct omap_dss_device *dss_mgr_get_output(struct omap_overlay_manager *mgr)
+{
+ return mgr->output->device;
+}
+
static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
{
unsigned long timeout = msecs_to_jiffies(500);
+ struct omap_dss_device *dssdev = mgr->get_output(mgr);
u32 irq;
- if (mgr->device->type = OMAP_DISPLAY_TYPE_VENC) {
+ if (!dssdev)
+ return 0;
+
+ if (dssdev->type = OMAP_DISPLAY_TYPE_VENC) {
irq = DISPC_IRQ_EVSYNC_ODD;
- } else if (mgr->device->type = OMAP_DISPLAY_TYPE_HDMI) {
+ } else if (dssdev->type = OMAP_DISPLAY_TYPE_HDMI) {
irq = DISPC_IRQ_EVSYNC_EVEN;
} else {
if (mgr->id = OMAP_DSS_CHANNEL_LCD)
@@ -522,6 +533,11 @@ int dss_init_overlay_managers(struct platform_device *pdev)
for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i];
+ mgr->output = kzalloc(sizeof(struct omap_dss_mgr_output *),
+ GFP_KERNEL);
+
+ BUG_ON(mgr->output = NULL);
+
switch (i) {
case 0:
mgr->name = "lcd";
@@ -545,6 +561,8 @@ int dss_init_overlay_managers(struct platform_device *pdev)
mgr->wait_for_go = &dss_mgr_wait_for_go;
mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
+ mgr->get_output = &dss_mgr_get_output;
+
mgr->caps = 0;
mgr->supported_displays dss_feat_get_supported_displays(mgr->id);
@@ -568,6 +586,7 @@ void dss_uninit_overlay_managers(struct platform_device *pdev)
for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i];
+ kfree(mgr->output);
kobject_del(&mgr->kobj);
kobject_put(&mgr->kobj);
}
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 6e82181..c72275e 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -536,16 +536,16 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
lcd2_mgr = omap_dss_get_overlay_manager(OMAP_DSS_OVL_MGR_LCD2);
if (dssdev->channel = OMAP_DSS_CHANNEL_LCD2) {
- if (!lcd2_mgr->device || force) {
- if (lcd2_mgr->device)
+ if (!lcd2_mgr->output->device || force) {
+ if (lcd2_mgr->output->device)
lcd2_mgr->unset_device(lcd2_mgr);
lcd2_mgr->set_device(lcd2_mgr, dssdev);
mgr = lcd2_mgr;
}
} else if (dssdev->type != OMAP_DISPLAY_TYPE_VENC
&& dssdev->type != OMAP_DISPLAY_TYPE_HDMI) {
- if (!lcd_mgr->device || force) {
- if (lcd_mgr->device)
+ if (!lcd_mgr->output->device || force) {
+ if (lcd_mgr->output->device)
lcd_mgr->unset_device(lcd_mgr);
lcd_mgr->set_device(lcd_mgr, dssdev);
mgr = lcd_mgr;
@@ -554,8 +554,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
if (dssdev->type = OMAP_DISPLAY_TYPE_VENC
|| dssdev->type = OMAP_DISPLAY_TYPE_HDMI) {
- if (!tv_mgr->device || force) {
- if (tv_mgr->device)
+ if (!tv_mgr->output->device || force) {
+ if (tv_mgr->output->device)
tv_mgr->unset_device(tv_mgr);
tv_mgr->set_device(tv_mgr, dssdev);
mgr = tv_mgr;
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 46024ab..fe0aa98 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2412,6 +2412,7 @@ static int omapfb_probe(struct platform_device *pdev)
struct omap_overlay *ovl;
struct omap_dss_device *def_display;
struct omap_dss_device *dssdev;
+ struct omap_dss_device *mgr_device;
DBG("omapfb_probe\n");
@@ -2485,8 +2486,10 @@ static int omapfb_probe(struct platform_device *pdev)
/* gfx overlay should be the default one. find a display
* connected to that, and use it as default display */
ovl = omap_dss_get_overlay(0);
- if (ovl->manager && ovl->manager->device) {
- def_display = ovl->manager->device;
+ mgr_device = ovl->manager ?
+ ovl->manager->get_output(ovl->manager) : NULL;
+ if (mgr_device) {
+ def_display = mgr_device;
} else {
dev_warn(&pdev->dev, "cannot find default display\n");
def_display = NULL;
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index b03fb13..45b1f81 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -148,8 +148,9 @@ static inline struct omap_dss_device *fb2display(struct fb_info *fbi)
/* XXX: returns the display connected to first attached overlay */
for (i = 0; i < ofbi->num_overlays; i++) {
- if (ofbi->overlays[i]->manager)
- return ofbi->overlays[i]->manager->device;
+ struct omap_overlay_manager *mgr = ofbi->overlays[i]->manager;
+ if (mgr)
+ return mgr->get_output(mgr);
}
return NULL;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 39862b8..1b968bb 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -411,6 +411,10 @@ struct omap_overlay {
int (*wait_for_go)(struct omap_overlay *ovl);
};
+struct omap_dss_mgr_output {
+ struct omap_dss_device *device;
+};
+
struct omap_overlay_manager_info {
u32 default_color;
@@ -435,7 +439,7 @@ struct omap_overlay_manager {
enum omap_display_type supported_displays;
/* dynamic fields */
- struct omap_dss_device *device;
+ struct omap_dss_mgr_output *output;
/*
* The following functions do not block:
@@ -460,6 +464,8 @@ struct omap_overlay_manager {
int (*apply)(struct omap_overlay_manager *mgr);
int (*wait_for_go)(struct omap_overlay_manager *mgr);
int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
+
+ struct omap_dss_device *(*get_output)(struct omap_overlay_manager *mgr);
};
struct omap_dss_device {
--
1.7.4.1
^ permalink raw reply related
* [RFC PATCH 00/29] OMAPDSS: Initial Writeback Capture mode support
From: Archit Taneja @ 2011-12-27 12:48 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: rohitkc, linux-omap, linux-fbdev, Archit Taneja
DSS HW on OMAP4 supports a new pipeline called writeback. Unlike other
pipelines(called overlays in DSS2 SW), writeback takes pixel data from an
overlay output or a overlay manager output and writes it back into a specified
address in memory.
writeback allows us to take benefit of the hardware processing available inside
the DISPC like color space conversion, rescaling, compositing etc and do either
a) perform memory-to-memory transfer with data processing, b) capture a
displayed frame. The former is known as memory to memory mode of the writeback
pipeline, and the latter is known as capture mode. More details about writeback
can be found in the Display Subsystem section of the OMAP4 TRM.
In the current DSS2 design, there are 3 major entities: overlay(represents
pipelines), overlay manager(represents a compositor of pipelines and the output
going to a display) and a omap_dss_device(to represent a display). These
entities can be linked to each other. One or more overlays can connect to a
manager, and a manager connects to a display.
Writeback HW has some properties of an overlay, and some of an overlay manager.
But as far as DSS2 design is concerned, it best fits as a special panel. This
panel connects to a manager and displays/writes the content back to memory after
doing some optional data processing.
The design adopted for writeback support in DSS2 is as follows:
- Writeback exists as an entity of its own, this entity is used to configure and
represent the actual writeback HW.
- This entity doesn't connect itself directly to a manager, it connects to a
manager via a dummy writeback panel.
- The dummy writeback panel is just a place holder of the actual writeback
entity. To do any writeback configuration, we extract the writeback pointer
through the dummy writeback panel pointer.
- In capture mode, an overlay manager needs to be connected to 2 outputs at the
same time. The first output is the display device, and the second is the
writeback panel. For this requirement, managers don't connect to a dss device,
they now connect to an entity called output. This entity is just a container
for 2 omap_dss_devices, one for display and one for writeback.
With the design mentioned above. The three different ways writeback is used is
explained:
- capture mode: A manager is connected to both display and writeback
dss_devices.
- memory to memory mode(connected to a manager): A manager is connected to only
the writeback dss_device.
- memory to memory mode(connected to an overlay): A dummy writeback manager is
connect to the writeback dss_device.
This patch series only enables capture mode support, i.e., allowing us to write
to the memory a processed version of the frame that we display onto a panel
through an overlay manager. The memory to memory mode support will be extended
later.
In order to use writeback, we need a capture device driver of some sort, a v4l2
capture device is currently in the works. The patches are currently tested by
extending writeback panel's sysfs attributes to allow us to configure the
destination addresses and other parameters via sysfs.
This can be tried out here:
git://gitorious.org:~boddob/linux-omap-dss2/archit-dss2-clone.git wb-v1
The patches are based on the following tree:
git://gitorious.org/linux-omap-dss2/linux.git master
Tested on a OMAP4 based blaze tablet. Note that this isn't tested thoroughly for
all possible writeback configurations, the aim is to get comments on the design.
Archit Taneja (29):
omapdss/omapfb/omap_vout: Introduce manager output struct
OMAPDSS: Add writeback to omap_dss_mgr_output
OMAPDSS: Writeback: Add writeback interface and panel driver
OMAPDSS: APPLY/Writeback: Add writeback_info
OMAPDSS: APPLY/Writeback: Apply writeback configurations
OMAPDSS: APPLY: Add writeback enable/disable functions
OMAPDSS: APPLY: Add extra_info for writeback
OMAPDSS: APPLY: Modify manager unset device op
OMAPDSS: APPLY: Allow manager set/unset_device ops to set/unset
writeback
OMAPDSS: APPLY: Calculate channel_in for writeback
OMAPDSS: DISPC: Add writeback as a new plane
OMAPDSS: Writeback: Add check for color_mode in dss_wb_simple_check()
OMAPDSS: APPLY: Configure writeback FIFOs
OMAPDSS: DISPC: Allow both upscaling and downscaling of chroma
OMAPDSS: DISPC: Pass overlay caps as a parameter to dispc overlay
related functions
OMAPDSS: OVERLAY: Add position and replication as overlay caps
OMAPDSS: DISPC: Make dispc_ovl_setup call dispc_plane_setup
OMAPDSS: DISPC: Make chroma_upscale an argument to dispc_plane_setup
OMAPDSS: DISPC: Don't set chroma resampling bit for writeback
OMAPDSS: Writeback: Add writeback capabilities
OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup
OMAPDSS: DISPC: Setup writeback go, enable and channel_in functions
OMAPDSS: Writeback: Configure writeback specific parameters
OMAPDSS: Writeback: Use panel driver ops to configure mirroring
rotation and buffer size
OMAPDSS: Writeback: Add sysfs attributes to writeback panel
OMAPDSS: DISPLAY: Add a manager apply to sysfs store attributes for
writeback
OMAPDSS: MANAGER: Split manager_display_store into smaller functions
OMAPDSS: MANAGER: Add writeback as a sysfs attribute
OMAPDSS: FEATURES: Allow WB panels to attach to managers
drivers/media/video/omap/omap_vout.c | 78 +++--
drivers/video/omap2/dss/Makefile | 2 +-
drivers/video/omap2/dss/apply.c | 549 +++++++++++++++++++++++++--
drivers/video/omap2/dss/core.c | 2 +
drivers/video/omap2/dss/dispc.c | 343 ++++++++++++-----
drivers/video/omap2/dss/dispc.h | 36 ++
drivers/video/omap2/dss/display.c | 23 +-
drivers/video/omap2/dss/dss.h | 39 ++-
drivers/video/omap2/dss/dss_features.c | 24 +-
drivers/video/omap2/dss/dss_features.h | 2 +
drivers/video/omap2/dss/manager.c | 125 ++++++-
drivers/video/omap2/dss/overlay.c | 27 +-
drivers/video/omap2/dss/writeback.c | 615 ++++++++++++++++++++++++++++++
drivers/video/omap2/omapfb/omapfb-main.c | 7 +-
drivers/video/omap2/omapfb/omapfb.h | 5 +-
include/video/omapdss.h | 52 +++-
16 files changed, 1749 insertions(+), 180 deletions(-)
create mode 100644 drivers/video/omap2/dss/writeback.c
--
1.7.4.1
^ permalink raw reply
* Re: [PATCH] video: s3c-fb: Make runtime PM functional again
From: Mark Brown @ 2011-12-27 10:32 UTC (permalink / raw)
To: Jingoo Han; +Cc: 'Florian Tobias Schandinat', linux-kernel, linux-fbdev
In-Reply-To: <000801ccc451$b3a853d0$1af8fb70$%han@samsung.com>
On Tue, Dec 27, 2011 at 01:40:47PM +0900, Jingoo Han wrote:
> > While this does make things simpler (the main motivation for the
> > original change) it will not only cause us to use more power in the
> > framebuffer controller but will also prevent us entering lower power
> > domain and SoC wide states as we can never power down the domain
> > containing the device. Since neither of these things is desirable
> > revert the change.
> The main difference is as follows:
> If no fb windows are opened.
> - Your patch: LCD block power is off
> - My patch: LCD block power is on still.
By holding the LCD block power on your patch will also prevent the SoC
using lower power modes like STOP and DEEP-STOP on the S3C6410.
> However, after booting, probing, open is called from platform system, soon.
> And, the default window is always opened. This means that at least one window
This only happens if you enable CONFIG_FRAMEBUFFER_CONSOLE as that
causes the console code to become a framebuffer client.
> is opened after booting. So, I don't think that "video: s3c-fb: modify runtime
> pm functions" (commit: 35784b) cause us to use more power in the framebuffer
> controller.
If the console isn't using the framebuffer then whenever userspace
releases we'll be able to runtime suspend the framebuffer. This isn't
ideal as what userspace expects is that it can hold the device open and
use blanking to save power - I'm working on patches to do this - but
it's a start.
> My intention is that runtime pm is used only for LCD block power off when
> suspend and resume are called.
This isn't runtime PM at all, it's system PM which for some reason calls
runtime PM functions. At best the runtime PM calls won't do anything as
they're inhibited during system PM.
^ permalink raw reply
* RE: [PATCH] video: s3c-fb: Make runtime PM functional again
From: Jingoo Han @ 2011-12-27 4:40 UTC (permalink / raw)
To: 'Mark Brown', 'Florian Tobias Schandinat'
Cc: linux-kernel, linux-fbdev
In-Reply-To: <1324911505-31715-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Hi, Mark
Mark wrote:
> -----Original Message-----
> Subject: [PATCH] video: s3c-fb: Make runtime PM functional again
>
> The change in "video: s3c-fb: modify runtime pm functions" (commit
> 35784b) renders the runtime power management for the device completely
> ineffectual as while it leaves runtime power management notionally
> enabled a runtime power reference is held for the entire time the device
> is registered meaning it will never actually do anything.
>
> A further issue is introduced as runtime power management is added
> during the system suspend path which is not something which drivers are
> supposed to do and would interact poorly if there were any operations
> done in the runtime power management callbacks.
>
> While this does make things simpler (the main motivation for the
> original change) it will not only cause us to use more power in the
> framebuffer controller but will also prevent us entering lower power
> domain and SoC wide states as we can never power down the domain
> containing the device. Since neither of these things is desirable
> revert the change.
The main difference is as follows:
If no fb windows are opened.
- Your patch: LCD block power is off
- My patch: LCD block power is on still.
However, after booting, probing, open is called from platform system, soon.
And, the default window is always opened. This means that at least one window
is opened after booting. So, I don't think that "video: s3c-fb: modify runtime
pm functions" (commit: 35784b) cause us to use more power in the framebuffer
controller.
My intention is that runtime pm is used only for LCD block power off when
suspend and resume are called.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/video/s3c-fb.c | 51 +++++++++++++++++++++++++++++------------------
> 1 files changed, 31 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index e531ebc..690b44e 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -1036,8 +1036,30 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd,
> return ret;
> }
>
> +static int s3c_fb_open(struct fb_info *info, int user)
> +{
> + struct s3c_fb_win *win = info->par;
> + struct s3c_fb *sfb = win->parent;
> +
> + pm_runtime_get_sync(sfb->dev);
> +
> + return 0;
> +}
> +
> +static int s3c_fb_release(struct fb_info *info, int user)
> +{
> + struct s3c_fb_win *win = info->par;
> + struct s3c_fb *sfb = win->parent;
> +
> + pm_runtime_put_sync(sfb->dev);
> +
> + return 0;
> +}
> +
> static struct fb_ops s3c_fb_ops = {
> .owner = THIS_MODULE,
> + .fb_open = s3c_fb_open,
> + .fb_release = s3c_fb_release,
> .fb_check_var = s3c_fb_check_var,
> .fb_set_par = s3c_fb_set_par,
> .fb_blank = s3c_fb_blank,
> @@ -1436,6 +1458,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
> }
>
> platform_set_drvdata(pdev, sfb);
> + pm_runtime_put_sync(sfb->dev);
>
> return 0;
>
> @@ -1468,6 +1491,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
> struct s3c_fb *sfb = platform_get_drvdata(pdev);
> int win;
>
> + pm_runtime_get_sync(sfb->dev);
> +
> for (win = 0; win < S3C_FB_MAX_WIN; win++)
> if (sfb->windows[win])
> s3c_fb_release_win(sfb, sfb->windows[win]);
> @@ -1488,7 +1513,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> +#ifdef CONFIG_PM
> static int s3c_fb_suspend(struct device *dev)
> {
> struct platform_device *pdev = to_platform_device(dev);
> @@ -1509,8 +1534,6 @@ static int s3c_fb_suspend(struct device *dev)
> clk_disable(sfb->lcd_clk);
>
> clk_disable(sfb->bus_clk);
> - pm_runtime_put_sync(sfb->dev);
> -
> return 0;
> }
>
> @@ -1522,7 +1545,6 @@ static int s3c_fb_resume(struct device *dev)
> struct s3c_fb_win *win;
> int win_no;
>
> - pm_runtime_get_sync(sfb->dev);
> clk_enable(sfb->bus_clk);
>
> if (!sfb->variant.has_clksel)
> @@ -1561,19 +1583,11 @@ static int s3c_fb_resume(struct device *dev)
>
> return 0;
> }
> +#else
> +#define s3c_fb_suspend NULL
> +#define s3c_fb_resume NULL
> #endif
>
> -#ifdef CONFIG_PM_RUNTIME
> -static int s3c_fb_runtime_suspend(struct device *dev)
> -{
> - return 0;
> -}
> -
> -static int s3c_fb_runtime_resume(struct device *dev)
> -{
> - return 0;
> -}
> -#endif
>
> #define VALID_BPP124 (VALID_BPP(1) | VALID_BPP(2) | VALID_BPP(4))
> #define VALID_BPP1248 (VALID_BPP124 | VALID_BPP(8))
> @@ -1896,10 +1910,7 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
> };
> MODULE_DEVICE_TABLE(platform, s3c_fb_driver_ids);
>
> -static const struct dev_pm_ops s3c_fb_pm_ops = {
> - SET_SYSTEM_SLEEP_PM_OPS(s3c_fb_suspend, s3c_fb_resume)
> - SET_RUNTIME_PM_OPS(s3c_fb_runtime_suspend, s3c_fb_runtime_resume, NULL)
> -};
> +static UNIVERSAL_DEV_PM_OPS(s3cfb_pm_ops, s3c_fb_suspend, s3c_fb_resume, NULL);
>
> static struct platform_driver s3c_fb_driver = {
> .probe = s3c_fb_probe,
> @@ -1908,7 +1919,7 @@ static struct platform_driver s3c_fb_driver = {
> .driver = {
> .name = "s3c-fb",
> .owner = THIS_MODULE,
> - .pm = &s3c_fb_pm_ops,
> + .pm = &s3cfb_pm_ops,
> },
> };
>
> --
> 1.7.7.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH] video: s3c-fb: Use s3c_fb_enable() to enable the
From: Jingoo Han @ 2011-12-27 1:02 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1324925318-10022-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Hi, Mark.
> -----Original Message-----
> From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]
> Sent: Tuesday, December 27, 2011 3:49 AM
> To: Jingoo Han; Florian Tobias Schandinat
> Cc: linux-fbdev@vger.kernel.org; Mark Brown
> Subject: [PATCH] video: s3c-fb: Use s3c_fb_enable() to enable the framebuffer
>
> The s3c-fb driver has a function called s3c_fb_enable() which turns on
> and off the physical output. However it is only actually used in paths
> which disable the screen, the enabling just writes to the register. Make
> the code less confusing by ensuring that the enable also goes through
> the same path.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It looks good to me.
Acked-by: Jingoo Han <jg1.han@samsung.com>
Thanks.
> ---
> drivers/video/s3c-fb.c | 55 ++++++++++++++++++++++++-----------------------
> 1 files changed, 28 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 690b44e..76f6155 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -439,6 +439,32 @@ static void shadow_protect_win(struct s3c_fb_win *win, bool protect)
> }
>
> /**
> + * s3c_fb_enable() - Set the state of the main LCD output
> + * @sfb: The main framebuffer state.
> + * @enable: The state to set.
> + */
> +static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
> +{
> + u32 vidcon0 = readl(sfb->regs + VIDCON0);
> +
> + if (enable)
> + vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
> + else {
> + /* see the note in the framebuffer datasheet about
> + * why you cannot take both of these bits down at the
> + * same time. */
> +
> + if (!(vidcon0 & VIDCON0_ENVID))
> + return;
> +
> + vidcon0 |= VIDCON0_ENVID;
> + vidcon0 &= ~VIDCON0_ENVID_F;
> + }
> +
> + writel(vidcon0, sfb->regs + VIDCON0);
> +}
> +
> +/**
> * s3c_fb_set_par() - framebuffer request to set new framebuffer state.
> * @info: The framebuffer to change.
> *
> @@ -508,9 +534,10 @@ static int s3c_fb_set_par(struct fb_info *info)
> if (sfb->variant.is_2443)
> data |= (1 << 5);
>
> - data |= VIDCON0_ENVID | VIDCON0_ENVID_F;
> writel(data, regs + VIDCON0);
>
> + s3c_fb_enable(sfb, 1);
> +
> data = VIDTCON0_VBPD(var->upper_margin - 1) |
> VIDTCON0_VFPD(var->lower_margin - 1) |
> VIDTCON0_VSPW(var->vsync_len - 1);
> @@ -759,32 +786,6 @@ static int s3c_fb_setcolreg(unsigned regno,
> }
>
> /**
> - * s3c_fb_enable() - Set the state of the main LCD output
> - * @sfb: The main framebuffer state.
> - * @enable: The state to set.
> - */
> -static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
> -{
> - u32 vidcon0 = readl(sfb->regs + VIDCON0);
> -
> - if (enable)
> - vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
> - else {
> - /* see the note in the framebuffer datasheet about
> - * why you cannot take both of these bits down at the
> - * same time. */
> -
> - if (!(vidcon0 & VIDCON0_ENVID))
> - return;
> -
> - vidcon0 |= VIDCON0_ENVID;
> - vidcon0 &= ~VIDCON0_ENVID_F;
> - }
> -
> - writel(vidcon0, sfb->regs + VIDCON0);
> -}
> -
> -/**
> * s3c_fb_blank() - blank or unblank the given window
> * @blank_mode: The blank state from FB_BLANK_*
> * @info: The framebuffer to blank.
> --
> 1.7.7.3
^ permalink raw reply
* [PATCH] OMAPDSS: add OrtusTech COM43H4M10XTC display support
From: Ilya Yanok @ 2011-12-26 22:56 UTC (permalink / raw)
To: linux-fbdev, linux-omap; +Cc: sasha_d, Ilya Yanok, Tomi Valkeinen
dd data for the OrtusTech COM43H4M10XTC display to the
generic_dpi_panel driver.
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
drivers/video/omap2/displays/panel-generic-dpi.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 593f831..99669ae 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -317,6 +317,26 @@ static struct panel_config generic_dpi_panels[] = {
OMAP_DSS_LCD_IHS,
.name = "focaltech_etm070003dh6",
},
+ /* OrtusTech COM43H4M10XTC */
+ {
+ {
+ .x_res = 480,
+ .y_res = 272,
+
+ .pixel_clock = 8000,
+
+ .hsw = 41,
+ .hfp = 8,
+ .hbp = 4,
+
+ .vsw = 10,
+ .vfp = 4,
+ .vbp = 2,
+ },
+ .config = OMAP_DSS_LCD_TFT,
+
+ .name = "ortustech_com43h4m10xtc",
+ },
};
struct panel_drv_data {
--
1.7.6.4
^ permalink raw reply related
* [PATCH] video: s3c-fb: Use s3c_fb_enable() to enable the framebuffer
From: Mark Brown @ 2011-12-26 18:48 UTC (permalink / raw)
To: linux-fbdev
The s3c-fb driver has a function called s3c_fb_enable() which turns on
and off the physical output. However it is only actually used in paths
which disable the screen, the enabling just writes to the register. Make
the code less confusing by ensuring that the enable also goes through
the same path.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/video/s3c-fb.c | 55 ++++++++++++++++++++++++-----------------------
1 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 690b44e..76f6155 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -439,6 +439,32 @@ static void shadow_protect_win(struct s3c_fb_win *win, bool protect)
}
/**
+ * s3c_fb_enable() - Set the state of the main LCD output
+ * @sfb: The main framebuffer state.
+ * @enable: The state to set.
+ */
+static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
+{
+ u32 vidcon0 = readl(sfb->regs + VIDCON0);
+
+ if (enable)
+ vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
+ else {
+ /* see the note in the framebuffer datasheet about
+ * why you cannot take both of these bits down at the
+ * same time. */
+
+ if (!(vidcon0 & VIDCON0_ENVID))
+ return;
+
+ vidcon0 |= VIDCON0_ENVID;
+ vidcon0 &= ~VIDCON0_ENVID_F;
+ }
+
+ writel(vidcon0, sfb->regs + VIDCON0);
+}
+
+/**
* s3c_fb_set_par() - framebuffer request to set new framebuffer state.
* @info: The framebuffer to change.
*
@@ -508,9 +534,10 @@ static int s3c_fb_set_par(struct fb_info *info)
if (sfb->variant.is_2443)
data |= (1 << 5);
- data |= VIDCON0_ENVID | VIDCON0_ENVID_F;
writel(data, regs + VIDCON0);
+ s3c_fb_enable(sfb, 1);
+
data = VIDTCON0_VBPD(var->upper_margin - 1) |
VIDTCON0_VFPD(var->lower_margin - 1) |
VIDTCON0_VSPW(var->vsync_len - 1);
@@ -759,32 +786,6 @@ static int s3c_fb_setcolreg(unsigned regno,
}
/**
- * s3c_fb_enable() - Set the state of the main LCD output
- * @sfb: The main framebuffer state.
- * @enable: The state to set.
- */
-static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
-{
- u32 vidcon0 = readl(sfb->regs + VIDCON0);
-
- if (enable)
- vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
- else {
- /* see the note in the framebuffer datasheet about
- * why you cannot take both of these bits down at the
- * same time. */
-
- if (!(vidcon0 & VIDCON0_ENVID))
- return;
-
- vidcon0 |= VIDCON0_ENVID;
- vidcon0 &= ~VIDCON0_ENVID_F;
- }
-
- writel(vidcon0, sfb->regs + VIDCON0);
-}
-
-/**
* s3c_fb_blank() - blank or unblank the given window
* @blank_mode: The blank state from FB_BLANK_*
* @info: The framebuffer to blank.
--
1.7.7.3
^ permalink raw reply related
* [PATCH] video: s3c-fb: Make runtime PM functional again
From: Mark Brown @ 2011-12-26 14:58 UTC (permalink / raw)
To: Jingoo Han, Florian Tobias Schandinat
Cc: linux-kernel, linux-fbdev, Mark Brown
In-Reply-To: <1302506578-21676-1-git-send-email-jg1.han@samsung.com>
The change in "video: s3c-fb: modify runtime pm functions" (commit
35784b) renders the runtime power management for the device completely
ineffectual as while it leaves runtime power management notionally
enabled a runtime power reference is held for the entire time the device
is registered meaning it will never actually do anything.
A further issue is introduced as runtime power management is added
during the system suspend path which is not something which drivers are
supposed to do and would interact poorly if there were any operations
done in the runtime power management callbacks.
While this does make things simpler (the main motivation for the
original change) it will not only cause us to use more power in the
framebuffer controller but will also prevent us entering lower power
domain and SoC wide states as we can never power down the domain
containing the device. Since neither of these things is desirable
revert the change.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/video/s3c-fb.c | 51 +++++++++++++++++++++++++++++------------------
1 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index e531ebc..690b44e 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1036,8 +1036,30 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd,
return ret;
}
+static int s3c_fb_open(struct fb_info *info, int user)
+{
+ struct s3c_fb_win *win = info->par;
+ struct s3c_fb *sfb = win->parent;
+
+ pm_runtime_get_sync(sfb->dev);
+
+ return 0;
+}
+
+static int s3c_fb_release(struct fb_info *info, int user)
+{
+ struct s3c_fb_win *win = info->par;
+ struct s3c_fb *sfb = win->parent;
+
+ pm_runtime_put_sync(sfb->dev);
+
+ return 0;
+}
+
static struct fb_ops s3c_fb_ops = {
.owner = THIS_MODULE,
+ .fb_open = s3c_fb_open,
+ .fb_release = s3c_fb_release,
.fb_check_var = s3c_fb_check_var,
.fb_set_par = s3c_fb_set_par,
.fb_blank = s3c_fb_blank,
@@ -1436,6 +1458,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, sfb);
+ pm_runtime_put_sync(sfb->dev);
return 0;
@@ -1468,6 +1491,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
struct s3c_fb *sfb = platform_get_drvdata(pdev);
int win;
+ pm_runtime_get_sync(sfb->dev);
+
for (win = 0; win < S3C_FB_MAX_WIN; win++)
if (sfb->windows[win])
s3c_fb_release_win(sfb, sfb->windows[win]);
@@ -1488,7 +1513,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
static int s3c_fb_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -1509,8 +1534,6 @@ static int s3c_fb_suspend(struct device *dev)
clk_disable(sfb->lcd_clk);
clk_disable(sfb->bus_clk);
- pm_runtime_put_sync(sfb->dev);
-
return 0;
}
@@ -1522,7 +1545,6 @@ static int s3c_fb_resume(struct device *dev)
struct s3c_fb_win *win;
int win_no;
- pm_runtime_get_sync(sfb->dev);
clk_enable(sfb->bus_clk);
if (!sfb->variant.has_clksel)
@@ -1561,19 +1583,11 @@ static int s3c_fb_resume(struct device *dev)
return 0;
}
+#else
+#define s3c_fb_suspend NULL
+#define s3c_fb_resume NULL
#endif
-#ifdef CONFIG_PM_RUNTIME
-static int s3c_fb_runtime_suspend(struct device *dev)
-{
- return 0;
-}
-
-static int s3c_fb_runtime_resume(struct device *dev)
-{
- return 0;
-}
-#endif
#define VALID_BPP124 (VALID_BPP(1) | VALID_BPP(2) | VALID_BPP(4))
#define VALID_BPP1248 (VALID_BPP124 | VALID_BPP(8))
@@ -1896,10 +1910,7 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
};
MODULE_DEVICE_TABLE(platform, s3c_fb_driver_ids);
-static const struct dev_pm_ops s3c_fb_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(s3c_fb_suspend, s3c_fb_resume)
- SET_RUNTIME_PM_OPS(s3c_fb_runtime_suspend, s3c_fb_runtime_resume, NULL)
-};
+static UNIVERSAL_DEV_PM_OPS(s3cfb_pm_ops, s3c_fb_suspend, s3c_fb_resume, NULL);
static struct platform_driver s3c_fb_driver = {
.probe = s3c_fb_probe,
@@ -1908,7 +1919,7 @@ static struct platform_driver s3c_fb_driver = {
.driver = {
.name = "s3c-fb",
.owner = THIS_MODULE,
- .pm = &s3c_fb_pm_ops,
+ .pm = &s3cfb_pm_ops,
},
};
--
1.7.7.3
^ permalink raw reply related
* Need advice on performant text-mode output API
From: Andrey Utkin @ 2011-12-24 15:54 UTC (permalink / raw)
To: linux-fbdev
Hi. I develop the program that visualizes disk checking process.
Similarly to known DOS program, MHDD.
To get the idea, you can find screencasts of its usage on Youtube.
Or look at my program's screenshot:
http://cloud.github.com/downloads/krieger-od/whdd/whdd_screenshot5.png
So i need to update big zone at left, and stats in top right corner.
The point is that it can be ~1000 blocks processed per second,
although it is ok to render them each Nth time, like at each 10-50
blocks processed.
Currently i use ncurses, and its performance is unacceptable, the
screen blinks awfully, because it prints whole screen of chars on
refresh.
I ask for directing me to any sufficiently performant libs/API, to
replace ncurses.
It would be ok, and even nice, if it is plain text mode (80x25, 16
colors), without any overhead of representing my chars as graphical
points.
It would be _very_ nice, if that API provide 'windows' model in terms
of ncurses, to work with rectangular pieces.
No OS portability is required. Linux only is sufficient.
Terminal emulator support is of course not required, although i'm
interested: is it possible to have.
I've found some project - directfb, but i'm not sure if it fits best
for my purpose. It seems to be focused on rich graphic rendering
possibilities. I need stupid, but fast text mode. Similar thing about
SDL.
Any help is appreciated. Thanks.
--
Andrey Utkin
^ permalink raw reply
* Re: [GIT PULL] ARM: amba: Enable module alias autogeneration for
From: Russell King - ARM Linux @ 2011-12-22 18:50 UTC (permalink / raw)
To: Dave Martin
Cc: Alessandro Rubini, patches, linux-kernel, linux-arm-kernel, alan,
a.zummo, alsa-devel, cjb, dan.j.williams, dmitry.torokhov,
grant.likely, perex, jassisinghbrar, julia, linus.walleij,
linux-fbdev, linux-input, linux-mmc, linux-serial, linux-watchdog,
lethal, Pawel.Moll, rtc-linux, spi-devel-general, tiwai,
vinod.koul, wim
In-Reply-To: <20111222112125.GA2573@localhost>
On Thu, Dec 22, 2011 at 11:21:25AM +0000, Dave Martin wrote:
> On Mon, Dec 19, 2011 at 09:39:42PM +0000, Russell King - ARM Linux wrote:
> > I have pulled it, I just haven't merged it in anywhere yet.
>
> OK, great -- thanks.
>
> I wasn't too familiar with the procedure, so I just wanted
> to be sure that I hadn't done things wrong.
FYI, I'll be pushing out an update to my tree Friday evening.
^ permalink raw reply
* Re: [GIT PULL] ARM: amba: Enable module alias autogeneration for
From: Dave Martin @ 2011-12-22 11:21 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Alessandro Rubini, patches, linux-kernel, linux-arm-kernel, alan,
a.zummo, alsa-devel, cjb, dan.j.williams, dmitry.torokhov,
grant.likely, perex, jassisinghbrar, julia, linus.walleij,
linux-fbdev, linux-input, linux-mmc, linux-serial, linux-watchdog,
lethal, Pawel.Moll, rtc-linux, spi-devel-general, tiwai,
vinod.koul, wim
In-Reply-To: <20111219213942.GM14542@n2100.arm.linux.org.uk>
On Mon, Dec 19, 2011 at 09:39:42PM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 19, 2011 at 01:24:09PM +0000, Dave Martin wrote:
> > Hi Russell,
> >
> > This one isn't urgent, but I'm not seeing the amba modalias patches
> > anywhere yet. Did you have any outstanding concerns which need to be
> > resolved?
> >
> > If you can suggest when/if these are likely to merge that would be great.
> >
> > Since Alessandro is now expecting to have to rebase on top of the amba
> > additions anyway, we shouldn't need to worry about conflicting with his
> > patches.
> >
> > Of course, if you've already merged these somewhere, then there's no
> > problem.
>
> I have pulled it, I just haven't merged it in anywhere yet.
OK, great -- thanks.
I wasn't too familiar with the procedure, so I just wanted
to be sure that I hadn't done things wrong.
Have a good Christmas in the meantime!
Cheers
---Dave
^ permalink raw reply
* [PATCH v2] video: da8xx-fb: reset LCDC only if functional clock changes with DVFS
From: Manjunathappa, Prakash @ 2011-12-22 9:31 UTC (permalink / raw)
To: linux-fbdev
LCDC functional clock may or may not be derived from CPU/MPU DPLL,
For example,
AM335x => Separate independent DPLL for LCDC
Davinci => Same DPLL as MPU
So, on platforms where LCDC functional clock is not derived from CPU/MPU
PLL it is not required to reset LCDC module as its functional clock does
not change with DVFS.
This patch adds check to do reset only if functional clock changes
between pre and post notifier callbacks with DVFS.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
drivers/video/da8xx-fb.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 6b27751..6146186 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -163,6 +163,7 @@ struct da8xx_fb_par {
int vsync_timeout;
#ifdef CONFIG_CPU_FREQ
struct notifier_block freq_transition;
+ unsigned int lcd_fck_rate;
#endif
void (*panel_power_ctrl)(int);
};
@@ -895,11 +896,12 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
struct da8xx_fb_par *par;
par = container_of(nb, struct da8xx_fb_par, freq_transition);
- if (val = CPUFREQ_PRECHANGE) {
- lcd_disable_raster();
- } else if (val = CPUFREQ_POSTCHANGE) {
- lcd_calc_clk_divider(par);
- lcd_enable_raster();
+ if (val = CPUFREQ_POSTCHANGE) {
+ if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
+ lcd_disable_raster();
+ lcd_calc_clk_divider(par);
+ lcd_enable_raster();
+ }
}
return 0;
@@ -1192,6 +1194,9 @@ static int __devinit fb_probe(struct platform_device *device)
par = da8xx_fb_info->par;
par->lcdc_clk = fb_clk;
+#ifdef CONFIG_CPU_FREQ
+ par->lcd_fck_rate = clk_get_rate(fb_clk);
+#endif
par->pxl_clk = lcdc_info->pxl_clk;
if (fb_pdata->panel_power_ctrl) {
par->panel_power_ctrl = fb_pdata->panel_power_ctrl;
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] fbdev: matroxfb: Fix compilation after fb_var_screeninfo
From: Florian Tobias Schandinat @ 2011-12-21 21:44 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Geert Uytterhoeven, Stephen Rothwell, linux-fbdev, linux-next,
linux-kernel
In-Reply-To: <1324407611-6886-1-git-send-email-laurent.pinchart@ideasonboard.com>
On 12/20/2011 07:00 PM, Laurent Pinchart wrote:
> Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration API")
> modified the layout of the fb_var_screeninfo structure. Remove zero
> fields from the static initializers in the matroxfb driver accordingly.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/matrox/matroxfb_base.c | 1 -
> drivers/video/matrox/matroxfb_crtc2.c | 1 -
> 2 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
> index 44bf8d4..401a56e 100644
> --- a/drivers/video/matrox/matroxfb_base.c
> +++ b/drivers/video/matrox/matroxfb_base.c
> @@ -147,7 +147,6 @@ static struct fb_var_screeninfo vesafb_defined = {
> 39721L,48L,16L,33L,10L,
> 96L,2L,~0, /* No sync info */
> FB_VMODE_NONINTERLACED,
> - 0, {0,0,0,0,0}
> };
>
>
> diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
> index d7112c3..02796a4 100644
> --- a/drivers/video/matrox/matroxfb_crtc2.c
> +++ b/drivers/video/matrox/matroxfb_crtc2.c
> @@ -593,7 +593,6 @@ static struct fb_var_screeninfo matroxfb_dh_defined = {
> 39721L,48L,16L,33L,10L,
> 96L,2,0, /* no sync info */
> FB_VMODE_NONINTERLACED,
> - 0, {0,0,0,0,0}
> };
>
> static int matroxfb_dh_regit(const struct matrox_fb_info *minfo,
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox