Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests and build for kernels >= 4.15.0 #121

Closed
wants to merge 4 commits into from

Conversation

jtdoepke
Copy link

This is basically a duplicate of #118, but with @xblitz's comment applied. Fixes #117. Also gets Travis-CI tests passing.

I'm a little uncertain about my test fixes; this is the first time I've worked with anything Linux kernel-related.

@@ -19,9 +19,13 @@

extern unsigned int evdi_loglevel;

// This definition is to get checkpatch.pl to stop complaining.
// TODO: Refactor all this to use pr_<level> and dev_dbg and stuff.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be wildly off base with this TODO?

@rgarcia89
Copy link

Worked for me. Thanks a lot

@enricoT
Copy link

enricoT commented Mar 2, 2018

I compiled but i get an error on linux-ck-ivy kernel

DKMS: install completed.
:: Running post-transaction hooks...
(1/2) Install DKMS modules
==> dkms install evdi/1.5.0.r11.ga73092d -k 4.15.7-1-ARCH
Error! Bad return status for module build on kernel: 4.15.7-1-ARCH (x86_64)
Consult /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/make.log for more information.
==> dkms install evdi/1.5.0.r11.ga73092d -k 4.14.23-1-lts
==> dkms install evdi/1.5.0.r11.ga73092d -k 4.15.7-1-ck-ivybridge
Error! Bad return status for module build on kernel: 4.15.7-1-ck-ivybridge (x86_64)
Consult /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/make.log for more information.
(2/2) Arming ConditionNeedsUpdate...

@jtdoepke
Copy link
Author

jtdoepke commented Mar 2, 2018

I suspect your error is unrelated to this PR, but what's in the /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/make.log log it speaks of?

@enricoT
Copy link

enricoT commented Mar 3, 2018

[code]
/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c: In function ‘evdi_best_single_encoder’:
/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c:91:6: warning: passing argument 2 of ‘drm_encoder_find’ makes pointer from integer without a cast [-Wint-conversion]
enc_id);
^~~~~~
In file included from ./include/drm/drm_modeset_helper_vtables.h:33:0,
from ./include/drm/drm_crtc_helper.h:43,
from /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c:16:
./include/drm/drm_encoder.h:217:35: note: expected ‘struct drm_file *’ but argument is of type ‘int’
static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev,
^~~~~~~~~~~~~~~~
/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c:87:9: error: too few arguments to function ‘drm_encoder_find’
return drm_encoder_find(connector->dev,
^~~~~~~~~~~~~~~~
In file included from ./include/drm/drm_modeset_helper_vtables.h:33:0,
from ./include/drm/drm_crtc_helper.h:43,
from /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c:16:
./include/drm/drm_encoder.h:217:35: note: declared here
static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev,
^~~~~~~~~~~~~~~~
/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c:92:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make[2]: *** [scripts/Makefile.build:316: /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.o] Error 1
make[2]: *** Waiting for unfinished jobs....
if [ "-pg" = "-pg" ]; then if [ /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_modeset.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_modeset.o"; fi; fi;
./tools/objtool/objtool orc generate --no-fp "/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/.tmp_evdi_drv.o";
./tools/objtool/objtool orc generate --no-fp "/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/.tmp_evdi_encoder.o";
if [ "-pg" = "-pg" ]; then if [ /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_drv.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_drv.o"; fi; fi;
if [ "-pg" = "-pg" ]; then if [ /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_encoder.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_encoder.o"; fi; fi;
make[1]: *** [Makefile:1515: module/var/lib/dkms/evdi/1.5.0.r11.ga73092d/build] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.15.7-1-ck-ivybridge/build'
make: *** [Makefile:22: all] Error 2
[/code]
Sorry if this is not what you need, is the end of log

@jtdoepke
Copy link
Author

jtdoepke commented Mar 3, 2018

Ok, that does sound related. Can you look at /var/lib/dkms/evdi/1.5.0.r11.ga73092d/build/evdi_connector.c and make sure there's a function evdi_best_single_encoder that looks like this:

static struct drm_encoder *evdi_best_single_encoder(struct drm_connector
                                                    *connector)
{
        int enc_id = connector->encoder_ids[0];

        return drm_encoder_find(connector->dev,
#if KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE
                                 NULL,
#endif
                                 enc_id);
}

Linux now has some uninitialized struct fields.
EVDI will fail to build if this is treated as an error.

```
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/travis/build/mintel/evdi/module/evdi.mod.o
/home/travis/build/mintel/evdi/module/evdi.mod.c:15:2: error: missing initializer for field ‘num_orcs’ of ‘struct mod_arch_specific’ [-Werror=missing-field-initializers]
  .arch = MODULE_ARCH_INIT,
  ^
In file included from ./include/linux/module.h:24:0,
                 from /home/travis/build/mintel/evdi/module/evdi.mod.c:1:
./arch/x86/include/asm/module.h:10:15: note: ‘num_orcs’ declared here
  unsigned int num_orcs;
               ^
```
checkpatch.pl has several checks related to `printk`.
Use printk via macro to get around them.
@stormwulfren
Copy link

Any idea when this will enter a release? It's been sat here for ages ... I'd really like to update my kernel without my displays breaking :/

@jtdoepke
Copy link
Author

jtdoepke commented Apr 5, 2018

@displaylink-mlukaszek any chance you could take a look at this?

@jtdoepke
Copy link
Author

jtdoepke commented Apr 9, 2018

This seems to have been fixed in v1.5.0.2... somehow. My commit that actually makes the fix seems to be gone, so I'm guessing history editing is involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux 4.15 already ships the drm_file*
4 participants