New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 723525 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

kernel 4.4 build broken for 'chromiumos-arm64' configuration

Reported by vpalatin@chromium.org, May 17 2017

Issue description

When trying to build the kernel 4.4 with the 'chromiumos-arm64' configuration,
the compilation fails on the Mediatek DRM driver due to drm_gem_object_lookup() signature (see [1]).

e.g. doing emerge-arm64-llvmpipe chromeos-kernel-4_4
see this trybot :
https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/compile_only_pre_cq/builds/26061/steps/BuildPackages/logs/stdio


[1] build failure:
  CC      drivers/gpu/drm/mediatek/mtk_drm_drv.o
  CC      drivers/gpu/drm/mediatek/mtk_drm_fb.o
  CC      drivers/gpu/drm/mediatek/mtk_drm_gem.o
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c: In function 'mtk_drm_mode_fb_create':
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c:141:30: error: passing argument 1 of 'drm_gem_object_lookup' from incompatible pointer type [-Werror]
  gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
                              ^
In file included from /mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c:17:0:
/mnt/host/source/src/third_party/kernel/v4.4/include/drm/drm_gem.h:181:24: note: expected 'struct drm_file *' but argument is of type 'struct drm_device *'
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                        ^
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c:141:35: error: passing argument 2 of 'drm_gem_object_lookup' makes integer from pointer without a cast [-Werror]
  gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
                                   ^
In file included from /mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c:17:0:
/mnt/host/source/src/third_party/kernel/v4.4/include/drm/drm_gem.h:181:24: note: expected 'u32' but argument is of type 'struct drm_file *'
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                        ^
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c:141:8: error: too many arguments to function 'drm_gem_object_lookup'
  gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
        ^
In file included from /mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_fb.c:17:0:
/mnt/host/source/src/third_party/kernel/v4.4/include/drm/drm_gem.h:181:24: note: declared here
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                        ^
cc1: all warnings being treated as errors
make[5]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:266: drivers/gpu/drm/mediatek/mtk_drm_fb.o] Error 1
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c: In function 'mtk_drm_gem_dumb_map_offset':
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c:143:30: error: passing argument 1 of 'drm_gem_object_lookup' from incompatible pointer type [-Werror]
  obj = drm_gem_object_lookup(dev, file_priv, handle);
                              ^
In file included from /mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c:15:0:
/mnt/host/source/src/third_party/kernel/v4.4/include/drm/drm_gem.h:181:24: note: expected 'struct drm_file *' but argument is of type 'struct drm_device *'
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                        ^
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c:143:35: error: passing argument 2 of 'drm_gem_object_lookup' makes integer from pointer without a cast [-Werror]
  obj = drm_gem_object_lookup(dev, file_priv, handle);
                                   ^
In file included from /mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c:15:0:
/mnt/host/source/src/third_party/kernel/v4.4/include/drm/drm_gem.h:181:24: note: expected 'u32' but argument is of type 'struct drm_file *'
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                        ^
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c:143:8: error: too many arguments to function 'drm_gem_object_lookup'
  obj = drm_gem_object_lookup(dev, file_priv, handle);
        ^
In file included from /mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_gem.c:15:0:
/mnt/host/source/src/third_party/kernel/v4.4/include/drm/drm_gem.h:181:24: note: declared here
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle);
                        ^
cc1: all warnings being treated as errors
make[5]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:266: drivers/gpu/drm/mediatek/mtk_drm_gem.o] Error 1
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_drv.c: In function 'mtk_atomic_crtc_mask':
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_drv.c:99:27: error: incompatible types when initializing type 'struct drm_crtc *' using type 'struct __drm_crtcs_state'
   struct drm_crtc *crtc = state->crtcs[i];
                           ^
make[5]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:266: drivers/gpu/drm/mediatek/mtk_drm_drv.o] Error 1
make[5]: Target '__build' not remade because of errors.
make[4]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:411: drivers/gpu/drm/mediatek] Error 2
make[4]: Target '__build' not remade because of errors.
make[3]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:411: drivers/gpu/drm] Error 2
make[3]: Target '__build' not remade because of errors.
make[2]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:411: drivers/gpu] Error 2
make[2]: Target '__build' not remade because of errors.
make[1]: *** [/mnt/host/source/src/third_party/kernel/v4.4/Makefile:984: drivers] Error 2
make[1]: Target '_all' not remade because of errors.
make[1]: Leaving directory '/build/arm64-llvmpipe/var/cache/portage/sys-kernel/chromeos-kernel-4_4'
make: *** [Makefile:150: sub-make] Error 2
make: Target '_all' not remade because of errors.

 
Cc: tarun.v...@intel.com seanpaul@chromium.org wayne.bo...@intel.com
This patch fixes the drm_gem_object_lookup() signature:
https://chromium-review.googlesource.com/c/505221/

The following failure is remaining :
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_drv.c: In function 'mtk_atomic_crtc_mask':
/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/mediatek/mtk_drm_drv.c:99:27: error: incompatible types when initializing type 'struct drm_crtc *' using type 'struct __drm_crtcs_state'
   struct drm_crtc *crtc = state->crtcs[i];

That was broken 3 days ago when we have backported the following patch changing the field 'crtcs' in 'struct drm_atomic_state' :
https://chromium-review.googlesource.com/c/460101

My uninformed fix would be:
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -96,7 +96,7 @@ static uint32_t mtk_atomic_crtc_mask(struct drm_device *drm,
        int i;
 
        for (i = 0, crtc_mask = 0; i < drm->mode_config.num_crtc; i++) {
-               struct drm_crtc *crtc = state->crtcs[i];
+               struct drm_crtc *crtc = state->crtcs[i].ptr;
 
                if (!crtc)
                        continue;

Cc: djkurtz@chromium.org
Cc: oak-mtk@chromium.org
Owner: djkurtz@chromium.org
Status: WontFix (was: Untriaged)
Duplicate of b/38355967

Fixes are:
https://chromium-review.googlesource.com/508368 UPSTREAM: drm: mediatek: fixup drm_gem_object_lookup API change
https://chromium-review.googlesource.com/508369 CHROMIUM: drm/mediatek: fix usage of crtcs array in drm_atomic_state

Sign in to add a comment