18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2016 Intel Corporation
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, distribute, and sell this software and its
58c2ecf20Sopenharmony_ci * documentation for any purpose is hereby granted without fee, provided that
68c2ecf20Sopenharmony_ci * the above copyright notice appear in all copies and that both that copyright
78c2ecf20Sopenharmony_ci * notice and this permission notice appear in supporting documentation, and
88c2ecf20Sopenharmony_ci * that the name of the copyright holders not be used in advertising or
98c2ecf20Sopenharmony_ci * publicity pertaining to distribution of the software without specific,
108c2ecf20Sopenharmony_ci * written prior permission.  The copyright holders make no representations
118c2ecf20Sopenharmony_ci * about the suitability of this software for any purpose.  It is provided "as
128c2ecf20Sopenharmony_ci * is" without express or implied warranty.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
158c2ecf20Sopenharmony_ci * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
168c2ecf20Sopenharmony_ci * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
178c2ecf20Sopenharmony_ci * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
188c2ecf20Sopenharmony_ci * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
198c2ecf20Sopenharmony_ci * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
208c2ecf20Sopenharmony_ci * OF THIS SOFTWARE.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#ifndef __DRM_FRAMEBUFFER_H__
248c2ecf20Sopenharmony_ci#define __DRM_FRAMEBUFFER_H__
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#include <linux/ctype.h>
278c2ecf20Sopenharmony_ci#include <linux/list.h>
288c2ecf20Sopenharmony_ci#include <linux/sched.h>
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#include <drm/drm_mode_object.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_cistruct drm_clip_rect;
338c2ecf20Sopenharmony_cistruct drm_device;
348c2ecf20Sopenharmony_cistruct drm_file;
358c2ecf20Sopenharmony_cistruct drm_format_info;
368c2ecf20Sopenharmony_cistruct drm_framebuffer;
378c2ecf20Sopenharmony_cistruct drm_gem_object;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/**
408c2ecf20Sopenharmony_ci * struct drm_framebuffer_funcs - framebuffer hooks
418c2ecf20Sopenharmony_ci */
428c2ecf20Sopenharmony_cistruct drm_framebuffer_funcs {
438c2ecf20Sopenharmony_ci	/**
448c2ecf20Sopenharmony_ci	 * @destroy:
458c2ecf20Sopenharmony_ci	 *
468c2ecf20Sopenharmony_ci	 * Clean up framebuffer resources, specifically also unreference the
478c2ecf20Sopenharmony_ci	 * backing storage. The core guarantees to call this function for every
488c2ecf20Sopenharmony_ci	 * framebuffer successfully created by calling
498c2ecf20Sopenharmony_ci	 * &drm_mode_config_funcs.fb_create. Drivers must also call
508c2ecf20Sopenharmony_ci	 * drm_framebuffer_cleanup() to release DRM core resources for this
518c2ecf20Sopenharmony_ci	 * framebuffer.
528c2ecf20Sopenharmony_ci	 */
538c2ecf20Sopenharmony_ci	void (*destroy)(struct drm_framebuffer *framebuffer);
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci	/**
568c2ecf20Sopenharmony_ci	 * @create_handle:
578c2ecf20Sopenharmony_ci	 *
588c2ecf20Sopenharmony_ci	 * Create a buffer handle in the driver-specific buffer manager (either
598c2ecf20Sopenharmony_ci	 * GEM or TTM) valid for the passed-in &struct drm_file. This is used by
608c2ecf20Sopenharmony_ci	 * the core to implement the GETFB IOCTL, which returns (for
618c2ecf20Sopenharmony_ci	 * sufficiently priviledged user) also a native buffer handle. This can
628c2ecf20Sopenharmony_ci	 * be used for seamless transitions between modesetting clients by
638c2ecf20Sopenharmony_ci	 * copying the current screen contents to a private buffer and blending
648c2ecf20Sopenharmony_ci	 * between that and the new contents.
658c2ecf20Sopenharmony_ci	 *
668c2ecf20Sopenharmony_ci	 * GEM based drivers should call drm_gem_handle_create() to create the
678c2ecf20Sopenharmony_ci	 * handle.
688c2ecf20Sopenharmony_ci	 *
698c2ecf20Sopenharmony_ci	 * RETURNS:
708c2ecf20Sopenharmony_ci	 *
718c2ecf20Sopenharmony_ci	 * 0 on success or a negative error code on failure.
728c2ecf20Sopenharmony_ci	 */
738c2ecf20Sopenharmony_ci	int (*create_handle)(struct drm_framebuffer *fb,
748c2ecf20Sopenharmony_ci			     struct drm_file *file_priv,
758c2ecf20Sopenharmony_ci			     unsigned int *handle);
768c2ecf20Sopenharmony_ci	/**
778c2ecf20Sopenharmony_ci	 * @dirty:
788c2ecf20Sopenharmony_ci	 *
798c2ecf20Sopenharmony_ci	 * Optional callback for the dirty fb IOCTL.
808c2ecf20Sopenharmony_ci	 *
818c2ecf20Sopenharmony_ci	 * Userspace can notify the driver via this callback that an area of the
828c2ecf20Sopenharmony_ci	 * framebuffer has changed and should be flushed to the display
838c2ecf20Sopenharmony_ci	 * hardware. This can also be used internally, e.g. by the fbdev
848c2ecf20Sopenharmony_ci	 * emulation, though that's not the case currently.
858c2ecf20Sopenharmony_ci	 *
868c2ecf20Sopenharmony_ci	 * See documentation in drm_mode.h for the struct drm_mode_fb_dirty_cmd
878c2ecf20Sopenharmony_ci	 * for more information as all the semantics and arguments have a one to
888c2ecf20Sopenharmony_ci	 * one mapping on this function.
898c2ecf20Sopenharmony_ci	 *
908c2ecf20Sopenharmony_ci	 * Atomic drivers should use drm_atomic_helper_dirtyfb() to implement
918c2ecf20Sopenharmony_ci	 * this hook.
928c2ecf20Sopenharmony_ci	 *
938c2ecf20Sopenharmony_ci	 * RETURNS:
948c2ecf20Sopenharmony_ci	 *
958c2ecf20Sopenharmony_ci	 * 0 on success or a negative error code on failure.
968c2ecf20Sopenharmony_ci	 */
978c2ecf20Sopenharmony_ci	int (*dirty)(struct drm_framebuffer *framebuffer,
988c2ecf20Sopenharmony_ci		     struct drm_file *file_priv, unsigned flags,
998c2ecf20Sopenharmony_ci		     unsigned color, struct drm_clip_rect *clips,
1008c2ecf20Sopenharmony_ci		     unsigned num_clips);
1018c2ecf20Sopenharmony_ci};
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci/**
1048c2ecf20Sopenharmony_ci * struct drm_framebuffer - frame buffer object
1058c2ecf20Sopenharmony_ci *
1068c2ecf20Sopenharmony_ci * Note that the fb is refcounted for the benefit of driver internals,
1078c2ecf20Sopenharmony_ci * for example some hw, disabling a CRTC/plane is asynchronous, and
1088c2ecf20Sopenharmony_ci * scanout does not actually complete until the next vblank.  So some
1098c2ecf20Sopenharmony_ci * cleanup (like releasing the reference(s) on the backing GEM bo(s))
1108c2ecf20Sopenharmony_ci * should be deferred.  In cases like this, the driver would like to
1118c2ecf20Sopenharmony_ci * hold a ref to the fb even though it has already been removed from
1128c2ecf20Sopenharmony_ci * userspace perspective. See drm_framebuffer_get() and
1138c2ecf20Sopenharmony_ci * drm_framebuffer_put().
1148c2ecf20Sopenharmony_ci *
1158c2ecf20Sopenharmony_ci * The refcount is stored inside the mode object @base.
1168c2ecf20Sopenharmony_ci */
1178c2ecf20Sopenharmony_cistruct drm_framebuffer {
1188c2ecf20Sopenharmony_ci	/**
1198c2ecf20Sopenharmony_ci	 * @dev: DRM device this framebuffer belongs to
1208c2ecf20Sopenharmony_ci	 */
1218c2ecf20Sopenharmony_ci	struct drm_device *dev;
1228c2ecf20Sopenharmony_ci	/**
1238c2ecf20Sopenharmony_ci	 * @head: Place on the &drm_mode_config.fb_list, access protected by
1248c2ecf20Sopenharmony_ci	 * &drm_mode_config.fb_lock.
1258c2ecf20Sopenharmony_ci	 */
1268c2ecf20Sopenharmony_ci	struct list_head head;
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci	/**
1298c2ecf20Sopenharmony_ci	 * @base: base modeset object structure, contains the reference count.
1308c2ecf20Sopenharmony_ci	 */
1318c2ecf20Sopenharmony_ci	struct drm_mode_object base;
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci	/**
1348c2ecf20Sopenharmony_ci	 * @comm: Name of the process allocating the fb, used for fb dumping.
1358c2ecf20Sopenharmony_ci	 */
1368c2ecf20Sopenharmony_ci	char comm[TASK_COMM_LEN];
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci	/**
1398c2ecf20Sopenharmony_ci	 * @format: framebuffer format information
1408c2ecf20Sopenharmony_ci	 */
1418c2ecf20Sopenharmony_ci	const struct drm_format_info *format;
1428c2ecf20Sopenharmony_ci	/**
1438c2ecf20Sopenharmony_ci	 * @funcs: framebuffer vfunc table
1448c2ecf20Sopenharmony_ci	 */
1458c2ecf20Sopenharmony_ci	const struct drm_framebuffer_funcs *funcs;
1468c2ecf20Sopenharmony_ci	/**
1478c2ecf20Sopenharmony_ci	 * @pitches: Line stride per buffer. For userspace created object this
1488c2ecf20Sopenharmony_ci	 * is copied from drm_mode_fb_cmd2.
1498c2ecf20Sopenharmony_ci	 */
1508c2ecf20Sopenharmony_ci	unsigned int pitches[4];
1518c2ecf20Sopenharmony_ci	/**
1528c2ecf20Sopenharmony_ci	 * @offsets: Offset from buffer start to the actual pixel data in bytes,
1538c2ecf20Sopenharmony_ci	 * per buffer. For userspace created object this is copied from
1548c2ecf20Sopenharmony_ci	 * drm_mode_fb_cmd2.
1558c2ecf20Sopenharmony_ci	 *
1568c2ecf20Sopenharmony_ci	 * Note that this is a linear offset and does not take into account
1578c2ecf20Sopenharmony_ci	 * tiling or buffer laytou per @modifier. It meant to be used when the
1588c2ecf20Sopenharmony_ci	 * actual pixel data for this framebuffer plane starts at an offset,
1598c2ecf20Sopenharmony_ci	 * e.g.  when multiple planes are allocated within the same backing
1608c2ecf20Sopenharmony_ci	 * storage buffer object. For tiled layouts this generally means it
1618c2ecf20Sopenharmony_ci	 * @offsets must at least be tile-size aligned, but hardware often has
1628c2ecf20Sopenharmony_ci	 * stricter requirements.
1638c2ecf20Sopenharmony_ci	 *
1648c2ecf20Sopenharmony_ci	 * This should not be used to specifiy x/y pixel offsets into the buffer
1658c2ecf20Sopenharmony_ci	 * data (even for linear buffers). Specifying an x/y pixel offset is
1668c2ecf20Sopenharmony_ci	 * instead done through the source rectangle in &struct drm_plane_state.
1678c2ecf20Sopenharmony_ci	 */
1688c2ecf20Sopenharmony_ci	unsigned int offsets[4];
1698c2ecf20Sopenharmony_ci	/**
1708c2ecf20Sopenharmony_ci	 * @modifier: Data layout modifier. This is used to describe
1718c2ecf20Sopenharmony_ci	 * tiling, or also special layouts (like compression) of auxiliary
1728c2ecf20Sopenharmony_ci	 * buffers. For userspace created object this is copied from
1738c2ecf20Sopenharmony_ci	 * drm_mode_fb_cmd2.
1748c2ecf20Sopenharmony_ci	 */
1758c2ecf20Sopenharmony_ci	uint64_t modifier;
1768c2ecf20Sopenharmony_ci	/**
1778c2ecf20Sopenharmony_ci	 * @width: Logical width of the visible area of the framebuffer, in
1788c2ecf20Sopenharmony_ci	 * pixels.
1798c2ecf20Sopenharmony_ci	 */
1808c2ecf20Sopenharmony_ci	unsigned int width;
1818c2ecf20Sopenharmony_ci	/**
1828c2ecf20Sopenharmony_ci	 * @height: Logical height of the visible area of the framebuffer, in
1838c2ecf20Sopenharmony_ci	 * pixels.
1848c2ecf20Sopenharmony_ci	 */
1858c2ecf20Sopenharmony_ci	unsigned int height;
1868c2ecf20Sopenharmony_ci	/**
1878c2ecf20Sopenharmony_ci	 * @flags: Framebuffer flags like DRM_MODE_FB_INTERLACED or
1888c2ecf20Sopenharmony_ci	 * DRM_MODE_FB_MODIFIERS.
1898c2ecf20Sopenharmony_ci	 */
1908c2ecf20Sopenharmony_ci	int flags;
1918c2ecf20Sopenharmony_ci	/**
1928c2ecf20Sopenharmony_ci	 * @hot_x: X coordinate of the cursor hotspot. Used by the legacy cursor
1938c2ecf20Sopenharmony_ci	 * IOCTL when the driver supports cursor through a DRM_PLANE_TYPE_CURSOR
1948c2ecf20Sopenharmony_ci	 * universal plane.
1958c2ecf20Sopenharmony_ci	 */
1968c2ecf20Sopenharmony_ci	int hot_x;
1978c2ecf20Sopenharmony_ci	/**
1988c2ecf20Sopenharmony_ci	 * @hot_y: Y coordinate of the cursor hotspot. Used by the legacy cursor
1998c2ecf20Sopenharmony_ci	 * IOCTL when the driver supports cursor through a DRM_PLANE_TYPE_CURSOR
2008c2ecf20Sopenharmony_ci	 * universal plane.
2018c2ecf20Sopenharmony_ci	 */
2028c2ecf20Sopenharmony_ci	int hot_y;
2038c2ecf20Sopenharmony_ci	/**
2048c2ecf20Sopenharmony_ci	 * @filp_head: Placed on &drm_file.fbs, protected by &drm_file.fbs_lock.
2058c2ecf20Sopenharmony_ci	 */
2068c2ecf20Sopenharmony_ci	struct list_head filp_head;
2078c2ecf20Sopenharmony_ci	/**
2088c2ecf20Sopenharmony_ci	 * @obj: GEM objects backing the framebuffer, one per plane (optional).
2098c2ecf20Sopenharmony_ci	 *
2108c2ecf20Sopenharmony_ci	 * This is used by the GEM framebuffer helpers, see e.g.
2118c2ecf20Sopenharmony_ci	 * drm_gem_fb_create().
2128c2ecf20Sopenharmony_ci	 */
2138c2ecf20Sopenharmony_ci	struct drm_gem_object *obj[4];
2148c2ecf20Sopenharmony_ci};
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define obj_to_fb(x) container_of(x, struct drm_framebuffer, base)
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ciint drm_framebuffer_init(struct drm_device *dev,
2198c2ecf20Sopenharmony_ci			 struct drm_framebuffer *fb,
2208c2ecf20Sopenharmony_ci			 const struct drm_framebuffer_funcs *funcs);
2218c2ecf20Sopenharmony_cistruct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev,
2228c2ecf20Sopenharmony_ci					       struct drm_file *file_priv,
2238c2ecf20Sopenharmony_ci					       uint32_t id);
2248c2ecf20Sopenharmony_civoid drm_framebuffer_remove(struct drm_framebuffer *fb);
2258c2ecf20Sopenharmony_civoid drm_framebuffer_cleanup(struct drm_framebuffer *fb);
2268c2ecf20Sopenharmony_civoid drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci/**
2298c2ecf20Sopenharmony_ci * drm_framebuffer_get - acquire a framebuffer reference
2308c2ecf20Sopenharmony_ci * @fb: DRM framebuffer
2318c2ecf20Sopenharmony_ci *
2328c2ecf20Sopenharmony_ci * This function increments the framebuffer's reference count.
2338c2ecf20Sopenharmony_ci */
2348c2ecf20Sopenharmony_cistatic inline void drm_framebuffer_get(struct drm_framebuffer *fb)
2358c2ecf20Sopenharmony_ci{
2368c2ecf20Sopenharmony_ci	drm_mode_object_get(&fb->base);
2378c2ecf20Sopenharmony_ci}
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci/**
2408c2ecf20Sopenharmony_ci * drm_framebuffer_put - release a framebuffer reference
2418c2ecf20Sopenharmony_ci * @fb: DRM framebuffer
2428c2ecf20Sopenharmony_ci *
2438c2ecf20Sopenharmony_ci * This function decrements the framebuffer's reference count and frees the
2448c2ecf20Sopenharmony_ci * framebuffer if the reference count drops to zero.
2458c2ecf20Sopenharmony_ci */
2468c2ecf20Sopenharmony_cistatic inline void drm_framebuffer_put(struct drm_framebuffer *fb)
2478c2ecf20Sopenharmony_ci{
2488c2ecf20Sopenharmony_ci	drm_mode_object_put(&fb->base);
2498c2ecf20Sopenharmony_ci}
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci/**
2528c2ecf20Sopenharmony_ci * drm_framebuffer_read_refcount - read the framebuffer reference count.
2538c2ecf20Sopenharmony_ci * @fb: framebuffer
2548c2ecf20Sopenharmony_ci *
2558c2ecf20Sopenharmony_ci * This functions returns the framebuffer's reference count.
2568c2ecf20Sopenharmony_ci */
2578c2ecf20Sopenharmony_cistatic inline uint32_t drm_framebuffer_read_refcount(const struct drm_framebuffer *fb)
2588c2ecf20Sopenharmony_ci{
2598c2ecf20Sopenharmony_ci	return kref_read(&fb->base.refcount);
2608c2ecf20Sopenharmony_ci}
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci/**
2638c2ecf20Sopenharmony_ci * drm_framebuffer_assign - store a reference to the fb
2648c2ecf20Sopenharmony_ci * @p: location to store framebuffer
2658c2ecf20Sopenharmony_ci * @fb: new framebuffer (maybe NULL)
2668c2ecf20Sopenharmony_ci *
2678c2ecf20Sopenharmony_ci * This functions sets the location to store a reference to the framebuffer,
2688c2ecf20Sopenharmony_ci * unreferencing the framebuffer that was previously stored in that location.
2698c2ecf20Sopenharmony_ci */
2708c2ecf20Sopenharmony_cistatic inline void drm_framebuffer_assign(struct drm_framebuffer **p,
2718c2ecf20Sopenharmony_ci					  struct drm_framebuffer *fb)
2728c2ecf20Sopenharmony_ci{
2738c2ecf20Sopenharmony_ci	if (fb)
2748c2ecf20Sopenharmony_ci		drm_framebuffer_get(fb);
2758c2ecf20Sopenharmony_ci	if (*p)
2768c2ecf20Sopenharmony_ci		drm_framebuffer_put(*p);
2778c2ecf20Sopenharmony_ci	*p = fb;
2788c2ecf20Sopenharmony_ci}
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci/*
2818c2ecf20Sopenharmony_ci * drm_for_each_fb - iterate over all framebuffers
2828c2ecf20Sopenharmony_ci * @fb: the loop cursor
2838c2ecf20Sopenharmony_ci * @dev: the DRM device
2848c2ecf20Sopenharmony_ci *
2858c2ecf20Sopenharmony_ci * Iterate over all framebuffers of @dev. User must hold
2868c2ecf20Sopenharmony_ci * &drm_mode_config.fb_lock.
2878c2ecf20Sopenharmony_ci */
2888c2ecf20Sopenharmony_ci#define drm_for_each_fb(fb, dev) \
2898c2ecf20Sopenharmony_ci	for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.fb_lock)),		\
2908c2ecf20Sopenharmony_ci	     fb = list_first_entry(&(dev)->mode_config.fb_list,	\
2918c2ecf20Sopenharmony_ci					  struct drm_framebuffer, head);	\
2928c2ecf20Sopenharmony_ci	     &fb->head != (&(dev)->mode_config.fb_list);			\
2938c2ecf20Sopenharmony_ci	     fb = list_next_entry(fb, head))
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ciint drm_framebuffer_plane_width(int width,
2968c2ecf20Sopenharmony_ci				const struct drm_framebuffer *fb, int plane);
2978c2ecf20Sopenharmony_ciint drm_framebuffer_plane_height(int height,
2988c2ecf20Sopenharmony_ci				 const struct drm_framebuffer *fb, int plane);
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci/**
3018c2ecf20Sopenharmony_ci * struct drm_afbc_framebuffer - a special afbc frame buffer object
3028c2ecf20Sopenharmony_ci *
3038c2ecf20Sopenharmony_ci * A derived class of struct drm_framebuffer, dedicated for afbc use cases.
3048c2ecf20Sopenharmony_ci */
3058c2ecf20Sopenharmony_cistruct drm_afbc_framebuffer {
3068c2ecf20Sopenharmony_ci	/**
3078c2ecf20Sopenharmony_ci	 * @base: base framebuffer structure.
3088c2ecf20Sopenharmony_ci	 */
3098c2ecf20Sopenharmony_ci	struct drm_framebuffer base;
3108c2ecf20Sopenharmony_ci	/**
3118c2ecf20Sopenharmony_ci	 * @block_width: width of a single afbc block
3128c2ecf20Sopenharmony_ci	 */
3138c2ecf20Sopenharmony_ci	u32 block_width;
3148c2ecf20Sopenharmony_ci	/**
3158c2ecf20Sopenharmony_ci	 * @block_height: height of a single afbc block
3168c2ecf20Sopenharmony_ci	 */
3178c2ecf20Sopenharmony_ci	u32 block_height;
3188c2ecf20Sopenharmony_ci	/**
3198c2ecf20Sopenharmony_ci	 * @aligned_width: aligned frame buffer width
3208c2ecf20Sopenharmony_ci	 */
3218c2ecf20Sopenharmony_ci	u32 aligned_width;
3228c2ecf20Sopenharmony_ci	/**
3238c2ecf20Sopenharmony_ci	 * @aligned_height: aligned frame buffer height
3248c2ecf20Sopenharmony_ci	 */
3258c2ecf20Sopenharmony_ci	u32 aligned_height;
3268c2ecf20Sopenharmony_ci	/**
3278c2ecf20Sopenharmony_ci	 * @offset: offset of the first afbc header
3288c2ecf20Sopenharmony_ci	 */
3298c2ecf20Sopenharmony_ci	u32 offset;
3308c2ecf20Sopenharmony_ci	/**
3318c2ecf20Sopenharmony_ci	 * @afbc_size: minimum size of afbc buffer
3328c2ecf20Sopenharmony_ci	 */
3338c2ecf20Sopenharmony_ci	u32 afbc_size;
3348c2ecf20Sopenharmony_ci};
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci#define fb_to_afbc_fb(x) container_of(x, struct drm_afbc_framebuffer, base)
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci#endif
339