mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 08:34:20 +08:00
e02b5cc9e8
If the drm_plane has a source width that's greater than the max width supported by a single hw overlay, then we assign a 'r_overlay' to it in omap_plane_atomic_check(). Both overlays should have the capabilities required to handle the source framebuffer. The only parameters that vary between the left and right hwoverlays are the src_w, crtc_w, src_x and crtc_x as we just even chop the fb into left and right halves. We also take care of not creating odd width size when dealing with YUV formats. Since both halves need to be 'appear' side by side the zpos is recalculated when dealing with dual overlay cases so that the other planes zpos is consistent. Depending on user space usage it is possible that on occasion the number of requested planes exceeds the numbers of overlays required to display them. In that case a failure would be returned for the plane that cannot be handled at that time. It is up to user space to make sure the H/W resource are not over-subscribed. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-10-narmstrong@baylibre.com
36 lines
1.0 KiB
C
36 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
|
* Author: Benoit Parrot <bparrot@ti.com>
|
|
*/
|
|
|
|
#ifndef __OMAPDRM_OVERLAY_H__
|
|
#define __OMAPDRM_OVERLAY_H__
|
|
|
|
#include <linux/types.h>
|
|
|
|
enum drm_plane_type;
|
|
|
|
struct drm_device;
|
|
struct drm_mode_object;
|
|
struct drm_plane;
|
|
|
|
/* Used to associate a HW overlay/plane to a plane */
|
|
struct omap_hw_overlay {
|
|
unsigned int idx;
|
|
|
|
const char *name;
|
|
enum omap_plane_id id;
|
|
|
|
enum omap_overlay_caps caps;
|
|
};
|
|
|
|
int omap_hwoverlays_init(struct omap_drm_private *priv);
|
|
void omap_hwoverlays_destroy(struct omap_drm_private *priv);
|
|
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);
|
|
void omap_overlay_release(struct drm_atomic_state *s, struct omap_hw_overlay *overlay);
|
|
void omap_overlay_update_state(struct omap_drm_private *priv, struct omap_hw_overlay *overlay);
|
|
#endif /* __OMAPDRM_OVERLAY_H__ */
|