| .. | .. |
|---|
| 23 | 23 | #ifndef __DRM_FRAMEBUFFER_H__ |
|---|
| 24 | 24 | #define __DRM_FRAMEBUFFER_H__ |
|---|
| 25 | 25 | |
|---|
| 26 | | -#include <linux/list.h> |
|---|
| 27 | 26 | #include <linux/ctype.h> |
|---|
| 27 | +#include <linux/list.h> |
|---|
| 28 | +#include <linux/sched.h> |
|---|
| 29 | + |
|---|
| 28 | 30 | #include <drm/drm_mode_object.h> |
|---|
| 29 | 31 | |
|---|
| 30 | | -struct drm_framebuffer; |
|---|
| 31 | | -struct drm_file; |
|---|
| 32 | +struct drm_clip_rect; |
|---|
| 32 | 33 | struct drm_device; |
|---|
| 34 | +struct drm_file; |
|---|
| 35 | +struct drm_format_info; |
|---|
| 36 | +struct drm_framebuffer; |
|---|
| 37 | +struct drm_gem_object; |
|---|
| 33 | 38 | |
|---|
| 34 | 39 | /** |
|---|
| 35 | 40 | * struct drm_framebuffer_funcs - framebuffer hooks |
|---|
| .. | .. |
|---|
| 81 | 86 | * See documentation in drm_mode.h for the struct drm_mode_fb_dirty_cmd |
|---|
| 82 | 87 | * for more information as all the semantics and arguments have a one to |
|---|
| 83 | 88 | * one mapping on this function. |
|---|
| 89 | + * |
|---|
| 90 | + * Atomic drivers should use drm_atomic_helper_dirtyfb() to implement |
|---|
| 91 | + * this hook. |
|---|
| 84 | 92 | * |
|---|
| 85 | 93 | * RETURNS: |
|---|
| 86 | 94 | * |
|---|
| .. | .. |
|---|
| 241 | 249 | } |
|---|
| 242 | 250 | |
|---|
| 243 | 251 | /** |
|---|
| 244 | | - * drm_framebuffer_reference - acquire a framebuffer reference |
|---|
| 245 | | - * @fb: DRM framebuffer |
|---|
| 246 | | - * |
|---|
| 247 | | - * This is a compatibility alias for drm_framebuffer_get() and should not be |
|---|
| 248 | | - * used by new code. |
|---|
| 249 | | - */ |
|---|
| 250 | | -static inline void drm_framebuffer_reference(struct drm_framebuffer *fb) |
|---|
| 251 | | -{ |
|---|
| 252 | | - drm_framebuffer_get(fb); |
|---|
| 253 | | -} |
|---|
| 254 | | - |
|---|
| 255 | | -/** |
|---|
| 256 | | - * drm_framebuffer_unreference - release a framebuffer reference |
|---|
| 257 | | - * @fb: DRM framebuffer |
|---|
| 258 | | - * |
|---|
| 259 | | - * This is a compatibility alias for drm_framebuffer_put() and should not be |
|---|
| 260 | | - * used by new code. |
|---|
| 261 | | - */ |
|---|
| 262 | | -static inline void drm_framebuffer_unreference(struct drm_framebuffer *fb) |
|---|
| 263 | | -{ |
|---|
| 264 | | - drm_framebuffer_put(fb); |
|---|
| 265 | | -} |
|---|
| 266 | | - |
|---|
| 267 | | -/** |
|---|
| 268 | 252 | * drm_framebuffer_read_refcount - read the framebuffer reference count. |
|---|
| 269 | 253 | * @fb: framebuffer |
|---|
| 270 | 254 | * |
|---|
| .. | .. |
|---|
| 313 | 297 | int drm_framebuffer_plane_height(int height, |
|---|
| 314 | 298 | const struct drm_framebuffer *fb, int plane); |
|---|
| 315 | 299 | |
|---|
| 300 | +/** |
|---|
| 301 | + * struct drm_afbc_framebuffer - a special afbc frame buffer object |
|---|
| 302 | + * |
|---|
| 303 | + * A derived class of struct drm_framebuffer, dedicated for afbc use cases. |
|---|
| 304 | + */ |
|---|
| 305 | +struct drm_afbc_framebuffer { |
|---|
| 306 | + /** |
|---|
| 307 | + * @base: base framebuffer structure. |
|---|
| 308 | + */ |
|---|
| 309 | + struct drm_framebuffer base; |
|---|
| 310 | + /** |
|---|
| 311 | + * @block_width: width of a single afbc block |
|---|
| 312 | + */ |
|---|
| 313 | + u32 block_width; |
|---|
| 314 | + /** |
|---|
| 315 | + * @block_height: height of a single afbc block |
|---|
| 316 | + */ |
|---|
| 317 | + u32 block_height; |
|---|
| 318 | + /** |
|---|
| 319 | + * @aligned_width: aligned frame buffer width |
|---|
| 320 | + */ |
|---|
| 321 | + u32 aligned_width; |
|---|
| 322 | + /** |
|---|
| 323 | + * @aligned_height: aligned frame buffer height |
|---|
| 324 | + */ |
|---|
| 325 | + u32 aligned_height; |
|---|
| 326 | + /** |
|---|
| 327 | + * @offset: offset of the first afbc header |
|---|
| 328 | + */ |
|---|
| 329 | + u32 offset; |
|---|
| 330 | + /** |
|---|
| 331 | + * @afbc_size: minimum size of afbc buffer |
|---|
| 332 | + */ |
|---|
| 333 | + u32 afbc_size; |
|---|
| 334 | +}; |
|---|
| 335 | + |
|---|
| 336 | +#define fb_to_afbc_fb(x) container_of(x, struct drm_afbc_framebuffer, base) |
|---|
| 337 | + |
|---|
| 316 | 338 | #endif |
|---|