hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/drm/drm_framebuffer.h
....@@ -23,13 +23,18 @@
2323 #ifndef __DRM_FRAMEBUFFER_H__
2424 #define __DRM_FRAMEBUFFER_H__
2525
26
-#include <linux/list.h>
2726 #include <linux/ctype.h>
27
+#include <linux/list.h>
28
+#include <linux/sched.h>
29
+
2830 #include <drm/drm_mode_object.h>
2931
30
-struct drm_framebuffer;
31
-struct drm_file;
32
+struct drm_clip_rect;
3233 struct drm_device;
34
+struct drm_file;
35
+struct drm_format_info;
36
+struct drm_framebuffer;
37
+struct drm_gem_object;
3338
3439 /**
3540 * struct drm_framebuffer_funcs - framebuffer hooks
....@@ -81,6 +86,9 @@
8186 * See documentation in drm_mode.h for the struct drm_mode_fb_dirty_cmd
8287 * for more information as all the semantics and arguments have a one to
8388 * one mapping on this function.
89
+ *
90
+ * Atomic drivers should use drm_atomic_helper_dirtyfb() to implement
91
+ * this hook.
8492 *
8593 * RETURNS:
8694 *
....@@ -241,30 +249,6 @@
241249 }
242250
243251 /**
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
-/**
268252 * drm_framebuffer_read_refcount - read the framebuffer reference count.
269253 * @fb: framebuffer
270254 *
....@@ -313,4 +297,42 @@
313297 int drm_framebuffer_plane_height(int height,
314298 const struct drm_framebuffer *fb, int plane);
315299
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
+
316338 #endif