Commit 2f53700d authored by Rob Clark's avatar Rob Clark Committed by Greg Kroah-Hartman

staging: drm/omap: updates for DSS fifomerge API changes

Signed-off-by: default avatarRob Clark <rob@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9a0774e0
...@@ -81,7 +81,7 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc, ...@@ -81,7 +81,7 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc,
struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
struct drm_plane *plane = omap_crtc->plane; struct drm_plane *plane = omap_crtc->plane;
return plane->funcs->update_plane(plane, crtc, crtc->fb, return omap_plane_mode_set(plane, crtc, crtc->fb,
0, 0, mode->hdisplay, mode->vdisplay, 0, 0, mode->hdisplay, mode->vdisplay,
x << 16, y << 16, x << 16, y << 16,
mode->hdisplay << 16, mode->vdisplay << 16); mode->hdisplay << 16, mode->vdisplay << 16);
......
...@@ -69,6 +69,12 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, ...@@ -69,6 +69,12 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
struct omap_overlay *ovl, unsigned int possible_crtcs, struct omap_overlay *ovl, unsigned int possible_crtcs,
bool priv); bool priv);
int omap_plane_dpms(struct drm_plane *plane, int mode); int omap_plane_dpms(struct drm_plane *plane, int mode);
int omap_plane_mode_set(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb,
int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h,
uint32_t src_x, uint32_t src_y,
uint32_t src_w, uint32_t src_h);
struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct drm_encoder *omap_encoder_init(struct drm_device *dev,
struct omap_overlay_manager *mgr); struct omap_overlay_manager *mgr);
......
...@@ -85,7 +85,7 @@ static int commit(struct drm_plane *plane) ...@@ -85,7 +85,7 @@ static int commit(struct drm_plane *plane)
} }
} }
if (info->enabled) { if (ovl->is_enabled(ovl)) {
omap_framebuffer_flush(plane->fb, info->pos_x, info->pos_y, omap_framebuffer_flush(plane->fb, info->pos_x, info->pos_y,
info->out_width, info->out_height); info->out_width, info->out_height);
} }
...@@ -115,7 +115,7 @@ static void update_manager(struct drm_plane *plane) ...@@ -115,7 +115,7 @@ static void update_manager(struct drm_plane *plane)
} }
if (ovl->manager != mgr) { if (ovl->manager != mgr) {
bool enabled = omap_plane->info.enabled; bool enabled = ovl->is_enabled(ovl);
/* don't switch things around with enabled overlays: */ /* don't switch things around with enabled overlays: */
if (enabled) if (enabled)
...@@ -168,7 +168,8 @@ static void update_scanout(struct drm_plane *plane) ...@@ -168,7 +168,8 @@ static void update_scanout(struct drm_plane *plane)
if (ret) { if (ret) {
dev_err(plane->dev->dev, dev_err(plane->dev->dev,
"could not pin fb: %d\n", ret); "could not pin fb: %d\n", ret);
omap_plane->info.enabled = false; omap_plane_dpms(plane, DRM_MODE_DPMS_OFF);
return;
} }
omap_framebuffer_update_scanout(plane->fb, omap_framebuffer_update_scanout(plane->fb,
...@@ -180,7 +181,7 @@ static void update_scanout(struct drm_plane *plane) ...@@ -180,7 +181,7 @@ static void update_scanout(struct drm_plane *plane)
info->screen_width); info->screen_width);
} }
static int omap_plane_update(struct drm_plane *plane, int omap_plane_mode_set(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_crtc *crtc, struct drm_framebuffer *fb,
int crtc_x, int crtc_y, int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h, unsigned int crtc_w, unsigned int crtc_h,
...@@ -195,7 +196,6 @@ static int omap_plane_update(struct drm_plane *plane, ...@@ -195,7 +196,6 @@ static int omap_plane_update(struct drm_plane *plane,
src_w = src_w >> 16; src_w = src_w >> 16;
src_h = src_h >> 16; src_h = src_h >> 16;
omap_plane->info.enabled = true;
omap_plane->info.pos_x = crtc_x; omap_plane->info.pos_x = crtc_x;
omap_plane->info.pos_y = crtc_y; omap_plane->info.pos_y = crtc_y;
omap_plane->info.out_width = crtc_w; omap_plane->info.out_width = crtc_w;
...@@ -214,11 +214,22 @@ static int omap_plane_update(struct drm_plane *plane, ...@@ -214,11 +214,22 @@ static int omap_plane_update(struct drm_plane *plane,
update_scanout(plane); update_scanout(plane);
update_manager(plane); update_manager(plane);
commit(plane);
return 0; return 0;
} }
static int omap_plane_update(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb,
int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h,
uint32_t src_x, uint32_t src_y,
uint32_t src_w, uint32_t src_h)
{
omap_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h,
src_x, src_y, src_w, src_h);
return omap_plane_dpms(plane, DRM_MODE_DPMS_ON);
}
static int omap_plane_disable(struct drm_plane *plane) static int omap_plane_disable(struct drm_plane *plane)
{ {
return omap_plane_dpms(plane, DRM_MODE_DPMS_OFF); return omap_plane_dpms(plane, DRM_MODE_DPMS_OFF);
...@@ -236,18 +247,22 @@ static void omap_plane_destroy(struct drm_plane *plane) ...@@ -236,18 +247,22 @@ static void omap_plane_destroy(struct drm_plane *plane)
int omap_plane_dpms(struct drm_plane *plane, int mode) int omap_plane_dpms(struct drm_plane *plane, int mode)
{ {
struct omap_plane *omap_plane = to_omap_plane(plane); struct omap_plane *omap_plane = to_omap_plane(plane);
struct omap_overlay *ovl = omap_plane->ovl;
int r;
DBG("%s: %d", omap_plane->ovl->name, mode); DBG("%s: %d", omap_plane->ovl->name, mode);
if (mode == DRM_MODE_DPMS_ON) { if (mode == DRM_MODE_DPMS_ON) {
update_scanout(plane); update_scanout(plane);
omap_plane->info.enabled = true; r = commit(plane);
if (!r)
r = ovl->enable(ovl);
} else { } else {
omap_plane->info.enabled = false; r = ovl->disable(ovl);
update_pin(plane, NULL); update_pin(plane, NULL);
} }
return commit(plane); return r;
} }
static const struct drm_plane_funcs omap_plane_funcs = { static const struct drm_plane_funcs omap_plane_funcs = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment