29 #define omap_plane _omap_plane
40 #define to_omap_plane(x) container_of(x, struct omap_plane, base)
86 id2irq[omap_plane->
ovl->id]);
101 struct drm_gem_object *bo =
NULL;
105 drm_gem_object_unreference_unlocked(bo);
108 endwin = omap_plane->
endwin;
113 endwin.fxn(endwin.arg);
153 dev_err(dev->dev,
"could not set overlay info\n");
171 dev_err(dev->dev,
"could not apply settings\n");
199 static void update_manager(
struct drm_plane *plane)
225 DBG(
"disconnecting %s from %s", ovl->
name,
240 static void unpin(
void *
arg,
struct drm_gem_object *bo)
246 (
const struct drm_gem_object **)&bo)) {
249 drm_gem_object_reference(bo);
251 dev_err(plane->
dev->dev,
"unpin fifo full!\n");
262 if (pinned_fb != fb) {
265 DBG(
"%p -> %p", pinned_fb, fb);
272 dev_err(plane->
dev->dev,
"could not swap %p -> %p\n",
288 static void update_scanout(
struct drm_plane *plane)
295 ret = update_pin(plane, plane->
fb);
298 "could not pin fb: %d\n", ret);
305 DBG(
"%s: %d,%d: %08x %08x (%d)", omap_plane->
ovl->name,
327 win->
src_x = src_x >> 16;
328 win->
src_y = src_y >> 16;
329 win->
src_w = src_w >> 16;
330 win->
src_h = src_h >> 16;
339 update_scanout(plane);
340 update_manager(plane);
345 static int omap_plane_update(
struct drm_plane *plane,
353 src_x, src_y, src_w, src_h);
357 static int omap_plane_disable(
struct drm_plane *plane)
364 static void omap_plane_destroy(
struct drm_plane *plane)
367 DBG(
"%s", omap_plane->
ovl->name);
368 omap_plane_disable(plane);
381 DBG(
"%s: %d", omap_plane->
ovl->name, mode);
384 update_scanout(plane);
391 update_pin(plane,
NULL);
399 void (*fxn)(
void *),
void *arg)
404 omap_plane->
endwin.fxn = fxn;
458 omap_plane->
win.rotation =
val;
480 .update_plane = omap_plane_update,
481 .disable_plane = omap_plane_disable,
482 .destroy = omap_plane_destroy,
495 DBG(
"%s: possible_crtcs=%08x, priv=%d", ovl->
name,
496 possible_crtcs, priv);
501 omap_plane = kzalloc(
sizeof(*omap_plane),
GFP_KERNEL);
503 dev_err(dev->dev,
"could not allocate plane\n");
511 dev_err(dev->dev,
"could not allocate unpin FIFO\n");
521 plane = &omap_plane->
base;
534 omap_plane->
info.global_alpha = 0xff;
535 omap_plane->
info.mirror = 0;
543 omap_plane->
info.zorder = 0;
545 omap_plane->
info.zorder = ovl->
id;
547 update_manager(plane);
553 omap_plane_destroy(plane);