Re: [Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c

2023-11-21 Thread kernel test robot
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/202311220447.1vw2sgej-...@intel.com/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/202311220447.1vw2sgej-...@intel.com/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 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202311220447.1vw2sgej-...@intel.com/

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.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


Re: [Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c

2023-11-21 Thread kernel test robot
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/202311220315.yzadz5tr-...@intel.com/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/202311220315.yzadz5tr-...@intel.com/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 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202311220315.yzadz5tr-...@intel.com/

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  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


[Intel-gfx] [PATCH v5 4/4] drm/i915/display: Split i915 specific code away from intel_fb.c

2023-11-21 Thread Jouni Högander
We 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

Signed-off-by: Jouni Högander 
---
 drivers/gpu/drm/i915/Makefile   |  1 +
 drivers/gpu/drm/i915/display/intel_fb.c | 69 +++--
 2 files changed, 9 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 7e5d6a39d450..c14ba1212b84 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -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 \
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c 
b/drivers/gpu/drm/i915/display/intel_fb.c
index f63f56b24b11..d5de213be2c0 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -4,7 +4,6 @@
  */
 
 #include 
-#include 
 #include 
 
 #include 
@@ -15,6 +14,7 @@
 #include "intel_display_types.h"
 #include "intel_dpt.h"
 #include "intel_fb.h"
+#include "intel_fb_bo.h"
 #include "intel_frontbuffer.h"
 
 #define check_array_bounds(i915, a, i) drm_WARN_ON(&(i915)->drm, (i) >= 
ARRAY_SIZE(a))
@@ -1985,7 +1985,6 @@ int intel_framebuffer_init(struct intel_framebuffer 
*intel_fb,
struct drm_i915_private *dev_priv = 
to_i915(intel_bo_to_drm_bo(obj)->dev);
struct drm_framebuffer *fb = _fb->base;
u32 max_stride;
-   unsigned int tiling, stride;
int ret = -EINVAL;
int i;
 
@@ -1993,32 +1992,11 @@ int intel_framebuffer_init(struct intel_framebuffer 
*intel_fb,
if (!intel_fb->frontbuffer)
return -ENOMEM;
 
-   i915_gem_object_lock(obj, NULL);
-   tiling = i915_gem_object_get_tiling(obj);
-   stride = i915_gem_object_get_stride(obj);
-   i915_gem_object_unlock(obj);
-
-   if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
-   /*
-* If there's a fence, enforce that
-* the fb modifier and tiling mode match.
-*/
-   if (tiling != I915_TILING_NONE &&
-   tiling != 
intel_fb_modifier_to_tiling(mode_cmd->modifier[0])) {
-   drm_dbg_kms(_priv->drm,
-   "tiling_mode doesn't match fb modifier\n");
-   goto err;
-   }
-   } else {
-   if (tiling == I915_TILING_X) {
-   mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
-   } else if (tiling == I915_TILING_Y) {
-   drm_dbg_kms(_priv->drm,
-   "No Y tiling for legacy addfb\n");
-   goto err;
-   }
-   }
+   ret = intel_fb_bo_framebuffer_init(intel_fb, obj, mode_cmd);
+   if (ret)
+   goto err;
 
+   ret = -EINVAL;
if (!drm_any_plane_has_format(_priv->drm,
  mode_cmd->pixel_format,
  mode_cmd->modifier[0])) {
@@ -2028,17 +2006,6 @@ int intel_framebuffer_init(struct intel_framebuffer 
*intel_fb,
goto err;
}
 
-   /*
-* gen2/3 display engine uses the fence if present,
-* so the tiling mode must match the fb modifier exactly.
-*/
-   if (DISPLAY_VER(dev_priv) < 4 &&
-   tiling != intel_fb_modifier_to_tiling(mode_cmd->modifier[0])) {
-   drm_dbg_kms(_priv->drm,
-   "tiling_mode must match fb modifier exactly on 
gen2/3\n");
-   goto err;
-   }
-
max_stride = intel_fb_max_stride(dev_priv, mode_cmd->pixel_format,
 mode_cmd->modifier[0]);
if (mode_cmd->pitches[0] > max_stride) {
@@ -2050,17 +2017,6 @@ int intel_framebuffer_init(struct intel_framebuffer 
*intel_fb,
goto err;
}
 
-   /*
-* If there's a fence, enforce that
-* the fb pitch and fence stride match.
-*/
-   if (tiling != I915_TILING_NONE && mode_cmd->pitches[0] != stride) {
-   drm_dbg_kms(_priv->drm,
-   "pitch (%d) must match tiling stride (%d)\n",
-   mode_cmd->pitches[0], stride);
-   goto err;
-   }
-
/* FIXME need to adjust LINOFF/TILEOFF accordingly. */
if (mode_cmd->offsets[0] != 0) {
drm_dbg_kms(_priv->drm,
@@ -2144,21 +2100,12 @@ intel_user_framebuffer_create(struct