mbox series

[0/5] drm/i915: make struct intel_frontbuffer opaque

Message ID cover.1718633874.git.jani.nikula@intel.com (mailing list archive)
Headers show
Series drm/i915: make struct intel_frontbuffer opaque | expand

Message

Jani Nikula June 17, 2024, 2:18 p.m. UTC
Hide the struct intel_frontbuffer implementation to add more clarity in
the interface boundaries.


Jani Nikula (5):
  drm/i915/frontbuffer: un-inline frontbuffer bits checks
  drm/i915/frontbuffer: hide ->bits more
  drm/i915/frontbuffer: add low-level kref accessors
  drm/i915/frontbuffer: hide ->write
  drm/i915/frontbuffer: make struct intel_frontbuffer opaque

 drivers/gpu/drm/i915/display/intel_fb.c       |  2 +-
 .../gpu/drm/i915/display/intel_frontbuffer.c  | 57 +++++++++++++++++--
 .../gpu/drm/i915/display/intel_frontbuffer.h  | 53 ++++++-----------
 .../drm/i915/display/intel_plane_initial.c    |  2 +-
 .../i915/gem/i915_gem_object_frontbuffer.h    |  4 +-
 drivers/gpu/drm/i915/i915_vma.c               |  2 +-
 drivers/gpu/drm/xe/display/xe_plane_initial.c |  2 +-
 7 files changed, 75 insertions(+), 47 deletions(-)

Comments

Jani Nikula June 17, 2024, 2:31 p.m. UTC | #1
On Mon, 17 Jun 2024, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: drm/i915: make struct intel_frontbuffer opaque
> URL   : https://patchwork.freedesktop.org/series/134957/
> State : failure
>
> == Summary ==
>
> Error: make failed
>   CALL    scripts/checksyscalls.sh
>   DESCEND objtool
>   INSTALL libsubcmd_headers
>   CC [M]  drivers/gpu/drm/i915/gem/i915_gem_clflush.o
> In file included from ./include/linux/array_size.h:5,
>                  from ./include/linux/string.h:6,
>                  from ./include/linux/scatterlist.h:5,
>                  from ./include/drm/drm_cache.h:36,
>                  from drivers/gpu/drm/i915/gem/i915_gem_clflush.c:7:
> drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h: In function ‘i915_gem_object_flush_frontbuffer’:
> ./include/linux/rcupdate.h:463:9: error: dereferencing pointer to incomplete type ‘struct intel_frontbuffer’
>   463 |  typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \

Ugh, so rcu requires the complete type even if it's about a pointer?

*sigh*

>       |         ^
> ./include/linux/compiler.h:77:42: note: in definition of macro ‘unlikely’
>    77 | # define unlikely(x) __builtin_expect(!!(x), 0)
>       |                                          ^
> ./include/linux/rcupdate.h:582:31: note: in expansion of macro ‘__rcu_access_pointer’
>   582 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
>       |                               ^~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h:24:15: note: in expansion of macro ‘rcu_access_pointer’
>    24 |  if (unlikely(rcu_access_pointer(obj->frontbuffer)))
>       |               ^~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h: In function ‘i915_gem_object_get_frontbuffer’:
> ./include/linux/rcupdate.h:463:9: error: dereferencing pointer to incomplete type ‘struct intel_frontbuffer’
>   463 |  typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
>       |         ^
> ./include/linux/compiler.h:76:40: note: in definition of macro ‘likely’
>    76 | # define likely(x) __builtin_expect(!!(x), 1)
>       |                                        ^
> ./include/linux/rcupdate.h:582:31: note: in expansion of macro ‘__rcu_access_pointer’
>   582 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
>       |                               ^~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h:50:14: note: in expansion of macro ‘rcu_access_pointer’
>    50 |  if (likely(!rcu_access_pointer(obj->frontbuffer)))
>       |              ^~~~~~~~~~~~~~~~~~
> make[6]: *** [scripts/Makefile.build:244: drivers/gpu/drm/i915/gem/i915_gem_clflush.o] Error 1
> make[5]: *** [scripts/Makefile.build:485: drivers/gpu/drm/i915] Error 2
> make[4]: *** [scripts/Makefile.build:485: drivers/gpu/drm] Error 2
> make[3]: *** [scripts/Makefile.build:485: drivers/gpu] Error 2
> make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
> make[1]: *** [/home/kbuild/kernel/Makefile:1934: .] Error 2
> make: *** [Makefile:240: __sub-make] Error 2
> Build failed, no error log produced
>
>