Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331760
b: refs/heads/master
c: b011941
h: refs/heads/master
v: v3
  • Loading branch information
Inki Dae committed Oct 4, 2012
1 parent 7825fbf commit ae67313
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50caf25c583b938c681b61e64dac58da9b640f2f
refs/heads/master: b011941f0ffdefb87585d9ed786164037d0d50df
17 changes: 17 additions & 0 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@
#define MAX_FB_BUFFER 4
#define DEFAULT_ZPOS -1

#define _wait_for(COND, MS) ({ \
unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \
int ret__ = 0; \
while (!(COND)) { \
if (time_after(jiffies, timeout__)) { \
ret__ = -ETIMEDOUT; \
break; \
} \
} \
ret__; \
})

#define wait_for(COND, MS) _wait_for(COND, MS)

struct drm_device;
struct exynos_drm_overlay;
struct drm_connector;
Expand All @@ -61,13 +75,16 @@ enum exynos_drm_output_type {
* @commit: apply hardware specific overlay data to registers.
* @enable: enable hardware specific overlay.
* @disable: disable hardware specific overlay.
* @wait_for_vblank: wait for vblank interrupt to make sure that
* hardware overlay is disabled.
*/
struct exynos_drm_overlay_ops {
void (*mode_set)(struct device *subdrv_dev,
struct exynos_drm_overlay *overlay);
void (*commit)(struct device *subdrv_dev, int zpos);
void (*enable)(struct device *subdrv_dev, int zpos);
void (*disable)(struct device *subdrv_dev, int zpos);
void (*wait_for_vblank)(struct device *subdrv_dev);
};

/*
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,14 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data)

if (overlay_ops && overlay_ops->disable)
overlay_ops->disable(manager->dev, zpos);

/*
* wait for vblank interrupt
* - this makes sure that hardware overlay is disabled to avoid
* for the dma accesses to memory after gem buffer was released
* because the setting for disabling the overlay will be updated
* at vsync.
*/
if (overlay_ops->wait_for_vblank)
overlay_ops->wait_for_vblank(manager->dev);
}

0 comments on commit ae67313

Please sign in to comment.