Skip to content

Commit

Permalink
OMAP: DSS2: move update() and sync()
Browse files Browse the repository at this point in the history
Move update() and sync() from omap_dss_device to omap_dss_driver.

Also, update was hardcoded to use virtual channel 0. This patch adds a
parameter that specifies the VC.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  • Loading branch information
Tomi Valkeinen committed Feb 24, 2010
1 parent 446f7bf commit 18946f6
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 506 deletions.
24 changes: 18 additions & 6 deletions arch/arm/plat-omap/include/plat/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,6 @@ struct omap_dss_device {
struct omap_video_timings *timings);
void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);
int (*update)(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h);
int (*sync)(struct omap_dss_device *dssdev);

int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
u32 (*get_wss)(struct omap_dss_device *dssdev);
Expand All @@ -500,15 +497,16 @@ struct omap_dss_driver {
int (*resume)(struct omap_dss_device *display);
int (*run_test)(struct omap_dss_device *display, int test);

void (*setup_update)(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h);
int (*set_update_mode)(struct omap_dss_device *dssdev,
enum omap_dss_update_mode);
enum omap_dss_update_mode (*get_update_mode)(
struct omap_dss_device *dssdev);

int (*update)(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h);
int (*sync)(struct omap_dss_device *dssdev);

int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
int (*wait_for_te)(struct omap_dss_device *dssdev);
int (*get_te)(struct omap_dss_device *dssdev);

u8 (*get_rotate)(struct omap_dss_device *dssdev);
Expand Down Expand Up @@ -566,4 +564,18 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
void omapdss_dsi_vc_enable_hs(int channel, bool enable);
int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);

int omap_dsi_prepare_update(struct omap_dss_device *dssdev,
u16 *x, u16 *y, u16 *w, u16 *h);
int omap_dsi_update(struct omap_dss_device *dssdev,
int channel,
u16 x, u16 y, u16 w, u16 h,
void (*callback)(int, void *), void *data);

int omap_rfbi_prepare_update(struct omap_dss_device *dssdev,
u16 *x, u16 *y, u16 *w, u16 *h);
int omap_rfbi_update(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h,
void (*callback)(void *), void *data);


#endif
76 changes: 54 additions & 22 deletions drivers/video/omap2/displays/panel-taal.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,58 @@ static int taal_resume(struct omap_dss_device *dssdev)
return 0;
}

static void taal_setup_update(struct omap_dss_device *dssdev,
static void taal_framedone_cb(int err, void *data)
{
struct omap_dss_device *dssdev = data;
dev_dbg(&dssdev->dev, "framedone, err %d\n", err);
dsi_bus_unlock();
}

static int taal_update(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h)
{
taal_set_update_window(x, y, w, h);
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
int r;

dev_dbg(&dssdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);

dsi_bus_lock();

if (!td->enabled) {
r = 0;
goto err;
}

r = omap_dsi_prepare_update(dssdev, &x, &y, &w, &h);
if (r)
goto err;

r = taal_set_update_window(x, y, w, h);
if (r)
goto err;

r = omap_dsi_update(dssdev, TCH, x, y, w, h,
taal_framedone_cb, dssdev);
if (r)
goto err;

/* note: no bus_unlock here. unlock is in framedone_cb */
return 0;
err:
dsi_bus_unlock();
return r;
}

static int taal_sync(struct omap_dss_device *dssdev)
{
dev_dbg(&dssdev->dev, "sync\n");

dsi_bus_lock();
dsi_bus_unlock();

dev_dbg(&dssdev->dev, "sync done\n");

return 0;
}

static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
Expand Down Expand Up @@ -762,24 +810,6 @@ static int taal_get_te(struct omap_dss_device *dssdev)
return td->te_enabled;
}

static int taal_wait_te(struct omap_dss_device *dssdev)
{
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
long wait = msecs_to_jiffies(500);

if (!td->use_ext_te || !td->te_enabled)
return 0;

INIT_COMPLETION(td->te_completion);
wait = wait_for_completion_timeout(&td->te_completion, wait);
if (wait == 0) {
dev_err(&dssdev->dev, "timeout waiting TE\n");
return -ETIME;
}

return 0;
}

static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)
{
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
Expand Down Expand Up @@ -1018,15 +1048,17 @@ static struct omap_dss_driver taal_driver = {
.suspend = taal_suspend,
.resume = taal_resume,

.setup_update = taal_setup_update,
.set_update_mode = taal_set_update_mode,
.get_update_mode = taal_get_update_mode,

.update = taal_update,
.sync = taal_sync,

.get_resolution = taal_get_resolution,
.get_recommended_bpp = omapdss_default_get_recommended_bpp,

.enable_te = taal_enable_te,
.get_te = taal_get_te,
.wait_for_te = taal_wait_te,

.set_rotate = taal_rotate,
.get_rotate = taal_get_rotate,
Expand Down
Loading

0 comments on commit 18946f6

Please sign in to comment.