/* skip if already in-use */ if (hwoverlay_to_plane[cur->idx]) continue;
/* skip if doesn't support some required caps: */ if (caps & ~cur->caps) continue;
/* check supported format */ if (!dispc_ovl_color_mode_supported(priv->dispc,
cur->id, fourcc)) continue;
return cur;
}
DBG("no match"); return NULL;
}
/* * Assign a new overlay to a plane with the required caps and supported fourcc * If a plane need a new overlay, the previous one should have been released * with omap_overlay_release() * This should be called from the plane atomic_check() in order to prepare the * next global overlay_map to be enabled when atomic transaction is valid.
*/ int omap_overlay_assign(struct drm_atomic_state *s, struct drm_plane *plane,
u32 caps, u32 fourcc, struct omap_hw_overlay **overlay, struct omap_hw_overlay **r_overlay)
{ /* Get the global state of the current atomic transaction */ struct omap_global_state *state = omap_get_global_state(s); struct drm_plane **overlay_map = state->hwoverlay_to_plane; struct omap_hw_overlay *ovl, *r_ovl;
ovl = omap_plane_find_free_overlay(s->dev, overlay_map, caps, fourcc); if (!ovl) return -ENOMEM;
DBG("%s: assign to plane %s caps %x", ovl->name, plane->name, caps);
if (r_overlay) {
DBG("%s: assign to right of plane %s caps %x",
r_ovl->name, plane->name, caps);
}
return 0;
}
/* * Release an overlay from a plane if the plane gets not visible or the plane * need a new overlay if overlay caps changes. * This should be called from the plane atomic_check() in order to prepare the * next global overlay_map to be enabled when atomic transaction is valid.
*/ void omap_overlay_release(struct drm_atomic_state *s, struct omap_hw_overlay *overlay)
{ /* Get the global state of the current atomic transaction */ struct omap_global_state *state = omap_get_global_state(s); struct drm_plane **overlay_map = state->hwoverlay_to_plane;
if (!overlay) return;
if (WARN_ON(!overlay_map[overlay->idx])) return;
DBG("%s: release from plane %s", overlay->name, overlay_map[overlay->idx]->name);
overlay_map[overlay->idx] = NULL;
}
/* * Update an overlay state that was attached to a plane before the current atomic state. * This should be called from the plane atomic_update() or atomic_disable(), * where an overlay association to a plane could have changed between the old and current * atomic state.
*/ void omap_overlay_update_state(struct omap_drm_private *priv, struct omap_hw_overlay *overlay)
{ struct omap_global_state *state = omap_get_existing_global_state(priv); struct drm_plane **overlay_map = state->hwoverlay_to_plane;
/* Check if this overlay is not used anymore, then disable it */ if (!overlay_map[overlay->idx]) {
DBG("%s: disabled", overlay->name);
/* disable the overlay */
dispc_ovl_enable(priv->dispc, overlay->id, false);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.