Prepare intel_fb for Xe
Subsystems (3)
v5 cover Prepare intel_fb for Xe
Intel fb creation is differing between Xe and i915 due to different implementations of backing object. This patch set is splitting i915 specific code into it's own source file. Similar source files will be introduced for Xe as well.
Also use intel_bo_to_drm_bo instead of directly referring i915_gem_object->base. One i915_gem_object_put is changed to drm_gem_object_put.
v5:
- Keep drm_any_plane_has_format check in intel_fb.c
- Use mode_cmd instead of user_mode_cmd for intel_fb_bo_lookup_valid_bo
- Use lookup_modifier_or_null in intel_fb_modifier_to_tiling and handle null value
v4: Move drm_any_plane_has_format check into intel_fb_bo.c
v3: Fix failure handling in intel_framebuffer_init
v2: Couple of fixes to error value handling
Jouni Högander (4):
drm/i915/display: use intel_bo_to_drm_bo in intel_fb.c drm/i915/display: Convert intel_fb_modifier_to_tiling as non-static drm/i915/display: Handle invalid fb_modifier in
intel_fb_modifier_to_tiling
drm/i915/display: Split i915 specific code away from intel_fb.c
drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_fb.c | 128 ++++++++---------------- drivers/gpu/drm/i915/display/intel_fb.h | 2 + 3 files changed, 44 insertions(+), 87 deletions(-)
Signature · 1 line
2.34.1
PATCH v5 1/4 drm/i915/display: use intel_bo_to_drm_bo in intel_fb.c
We are preparing for Xe driver. I915 and Xe object implementation are differing. Do not use i915_gem_object->base directly. Instead use intel_bo_to_drm_bo.
Also use drm_gem_object_put instead of i915_gem_object_put. This should be
ok as i915_gem_object_put is really just doing __drm_gem_object_put.
--- drivers/gpu/drm/i915/display/intel_fb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/display/intel_fb.c +6 -6
@@ -1657,10 +1657,10 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer * max_size =max (max_size, offset + size); } -if (mul_u32_u32 (max_size, tile_size) > obj->base.size) { +if (mul_u32_u32 (max_size, tile_size) >intel_bo_to_drm_bo (obj)->size) {drm_dbg_kms (&i915->drm,"fb too big for bo (need %llu bytes, have %zu bytes)\n" , -mul_u32_u32 (max_size, tile_size), obj->base.size); +mul_u32_u32 (max_size, tile_size),intel_bo_to_drm_bo (obj)->size);return -EINVAL ; }
@@ -1889,7 +1889,7 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb, unsigned int *handle) {struct drm_i915_gem_object *obj =intel_fb_obj (fb); -struct drm_i915_private *i915 =to_i915 (obj->base.dev); +struct drm_i915_private *i915 =to_i915 (intel_bo_to_drm_bo (obj)->dev);if (i915_gem_object_is_userptr (obj)) { drm_dbg(&i915->drm,
@@ -1897,7 +1897,7 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,return -EINVAL ; } -return drm_gem_handle_create (file, &obj->base, handle); +return drm_gem_handle_create (file,intel_bo_to_drm_bo (obj), handle); }struct frontbuffer_fence_cb {
@@ -1975,7 +1975,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,struct drm_i915_gem_object *obj, struct drm_mode_fb_cmd2 *mode_cmd) { - struct drm_i915_private *dev_priv = to_i915(obj->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_bo_to_drm_bo(obj)->dev);struct drm_framebuffer *fb = &intel_fb->base;u32 max_stride;unsigned int tiling, stride;
@@ -2153,7 +2153,7 @@ intel_user_framebuffer_create(struct drm_device *dev, } fb =intel_framebuffer_create (obj, &mode_cmd); -i915_gem_object_put (obj); +drm_gem_object_put (intel_bo_to_drm_bo (obj));return fb; }
Signature · 1 line
2.34.1
PATCH v5 2/4 drm/i915/display: Convert intel_fb_modifier_to_tiling as non-static
In reply to Jouni HöganderWe are about to split i915 specific code from intel_fb.c. Convert intel_fb_modifier_to_tiling as non-static to allow calling it from split code.
--- drivers/gpu/drm/i915/display/intel_fb.c | 40 ++++++++++++------------- drivers/gpu/drm/i915/display/intel_fb.h | 2 ++ 2 files changed, 22 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/display/intel_fb.c +20 -20
@@ -301,6 +301,26 @@ lookup_format_info(const struct drm_format_info formats[],return NULL ; } +unsigned int intel_fb_modifier_to_tiling (u64 fb_modifier) +{ +u8 tiling_caps =lookup_modifier (fb_modifier)->plane_caps & +INTEL_PLANE_CAP_TILING_MASK ; + +switch (tiling_caps) { +case INTEL_PLANE_CAP_TILING_Y : +return I915_TILING_Y ; +case INTEL_PLANE_CAP_TILING_X : +return I915_TILING_X ; +case INTEL_PLANE_CAP_TILING_4 : +case INTEL_PLANE_CAP_TILING_Yf: +case INTEL_PLANE_CAP_TILING_NONE : +return I915_TILING_NONE ; +default : +MISSING_CASE (tiling_caps); +return I915_TILING_NONE ; + } +} +/** * intel_fb_get_format_info: Get a modifier specific format information * @cmd: FB add command structure
@@ -737,26 +757,6 @@ intel_fb_align_height(const struct drm_framebuffer *fb,return ALIGN (height, tile_height); } -static unsigned int intel_fb_modifier_to_tiling (u64 fb_modifier) -{ -u8 tiling_caps =lookup_modifier (fb_modifier)->plane_caps & -INTEL_PLANE_CAP_TILING_MASK ; - -switch (tiling_caps) { -case INTEL_PLANE_CAP_TILING_Y : -return I915_TILING_Y ; -case INTEL_PLANE_CAP_TILING_X : -return I915_TILING_X ; -case INTEL_PLANE_CAP_TILING_4 : -case INTEL_PLANE_CAP_TILING_Yf: -case INTEL_PLANE_CAP_TILING_NONE : -return I915_TILING_NONE ; -default : -MISSING_CASE (tiling_caps); -return I915_TILING_NONE ; - } -} -bool intel_fb_modifier_uses_dpt (struct drm_i915_private *i915,u64 modifier) {return HAS_DPT (i915) && modifier !=DRM_FORMAT_MOD_LINEAR ;
drivers/gpu/drm/i915/display/intel_fb.h +2 -0
@@ -95,4 +95,6 @@ intel_user_framebuffer_create(struct drm_device *dev,bool intel_fb_modifier_uses_dpt (struct drm_i915_private *i915,u64 modifier);bool intel_fb_uses_dpt (const struct drm_framebuffer *fb); +unsigned int intel_fb_modifier_to_tiling (u64 fb_modifier); +#endif /* __INTEL_FB_H__ */
Signature · 1 line
2.34.1
PATCH v5 3/4 drm/i915/display: Handle invalid fb_modifier in intel_fb_modifier_to_tiling
In reply to Jouni HöganderLookup_modifier is returning INTEL_PLANE_CAP_TILING_4 on invalid fb_modifier value. Use lookup_modifier_or_null in intel_fb_modifier_to_tiling and return I915_TILING_NONE in case lookup_modifier_or_null returns null.
--- drivers/gpu/drm/i915/display/intel_fb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_fb.c +8 -1
@@ -303,7 +303,14 @@ lookup_format_info(const struct drm_format_info formats[],unsigned int intel_fb_modifier_to_tiling (u64 fb_modifier) { -u8 tiling_caps =lookup_modifier (fb_modifier)->plane_caps & +const struct intel_modifier_desc *md; +u8 tiling_caps; + + md =lookup_modifier_or_null (fb_modifier); +if (!md) +return I915_TILING_NONE ; + + tiling_caps =lookup_modifier_or_null (fb_modifier)->plane_caps &INTEL_PLANE_CAP_TILING_MASK ;switch (tiling_caps) {
Signature · 1 line
2.34.1
PATCH v5 4/4 drm/i915/display: Split i915 specific code away from intel_fb.c
In reply to Jouni HöganderWe are preparing for Xe driver. Backing object implementation is differing between i915 and Xe. Split i915 specific code into separate source file built only for i915.
v5:
- Keep drm_any_plane_has_format check in intel_fb.c
- Use mode_cmd instead of user_mode_cmd for intel_fb_bo_lookup_valid_bo
v4: Move drm_any_plane_has_format check into intel_fb_bo.c
v3: Fix failure handling in intel_framebuffer_init
v2: Couple of fixes to error value handling
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_fb.c | 69 +++---------------------- 2 files changed, 9 insertions(+), 61 deletions(-)
drivers/gpu/drm/i915/Makefile +1 -0
@@ -279,6 +279,7 @@ i915-y += \ display/intel_dsb.o \ display/intel_dsb_buffer.o \ display/intel_fb.o \ + display/intel_fb_bo.o \ display/intel_fb_pin.o \ display/intel_fbc.o \ display/intel_fdi.o \
drivers/gpu/drm/i915/display/intel_fb.c +8 -61
115 lines not on this page · raw message
Signature · 1 line
2.34.1
kernel test robot
build botRe: [Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c
kernel test robot noticed the following build errors:
Hi Jouni,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-tip/drm-tip]
url: https://github.com/intel-lab-lkp/linux/commits/Jouni-H-gander/drm-i915-display-use-intel_bo_to_drm_bo-in-intel_fb-c/20231121-193155 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip patch link: https://lore.kernel.org/r/20231121112729.4191245-5-jouni.hogander%40intel.com patch subject: [Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231122/[email protected]/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231122/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> make[7]: *** No rule to make target 'drivers/gpu/drm/i915/display/intel_fb_bo.o', needed by 'drivers/gpu/drm/i915/built-in.a'.
make[7]: *** [scripts/Makefile.build:243: drivers/gpu/drm/i915/display/intel_fb.o] Error 1
make[7]: Target 'drivers/gpu/drm/i915/' not remade because of errors.
--
>> drivers/gpu/drm/i915/display/intel_fb.c:17:10: fatal error: 'intel_fb_bo.h' file not found
#include "intel_fb_bo.h"
^~~~~~~~~~~~~~~1 error generated.
vim +17 drivers/gpu/drm/i915/display/intel_fb.c
11
12 #include "i915_drv.h"
13 #include "intel_display.h"
14 #include "intel_display_types.h"
15 #include "intel_dpt.h"
16 #include "intel_fb.h"
> 17 #include "intel_fb_bo.h" 18 #include "intel_frontbuffer.h"
19
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c
In reply to Jouni Höganderkernel test robot noticed the following build errors:
Hi Jouni,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-tip/drm-tip]
url: https://github.com/intel-lab-lkp/linux/commits/Jouni-H-gander/drm-i915-display-use-intel_bo_to_drm_bo-in-intel_fb-c/20231121-193155 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip patch link: https://lore.kernel.org/r/20231121112729.4191245-5-jouni.hogander%40intel.com patch subject: [Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20231122/[email protected]/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231122/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> make[7]: *** No rule to make target 'drivers/gpu/drm/i915/display/intel_fb_bo.o', needed by 'drivers/gpu/drm/i915/i915.o'.
make[7]: *** [scripts/Makefile.build:243: drivers/gpu/drm/i915/display/intel_fb.o] Error 1 make[7]: Target 'drivers/gpu/drm/i915/' not remade because of errors.
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for Prepare intel_fb for Xe (rev6)
In reply to Jouni Högander== Series Details ==
== Series Details ==
Series: Prepare intel_fb for Xe (rev6)
URL : https://patchwork.freedesktop.org/series/126507/
State : failure
== Summary ==
Error: make failed
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CC [M] drivers/gpu/drm/i915/display/intel_fb.odrivers/gpu/drm/i915/display/intel_fb.c:17:10: fatal error: intel_fb_bo.h: No such file or directory
17 | #include "intel_fb_bo.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
make[6]: *** [scripts/Makefile.build:243: drivers/gpu/drm/i915/display/intel_fb.o] Error 1 make[5]: *** [scripts/Makefile.build:480: drivers/gpu/drm/i915] Error 2 make[4]: *** [scripts/Makefile.build:480: drivers/gpu/drm] Error 2
make[3]: *** [scripts/Makefile.build:480: drivers/gpu] Error 2
make[2]: *** [scripts/Makefile.build:480: drivers] Error 2
make[1]: *** [/home/kbuild2/kernel/Makefile:1911: .] Error 2
make: *** [Makefile:234: __sub-make] Error 2
Build failed, no error log produced