Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6393

Compile a driver made for a newer linux kernel in an older kernel

$
0
0

There is a panel driver committed in the kernel 5 of linux kernel. I have a kernel 4.4.

I tried to copy the .c of the new kernel and paste it in my old kernel. Also the Kconfig and Makefile modifications to include it.

But when compiles, it fails in this exact driver, as I saw, the new driver uses different headers apparently the new headers.

The question is whether compiling this driver, for an old kernel, it is something feasible or am I wasting my time?

I attached the compile logs maybe I am missing something. I tried to modify headers too without success, it stills fail compiling.

include/drm/drm_modes.h:103:25: error: field 'base' has incomplete type  struct drm_mode_object base;                         ^~~~include/drm/drm_modes.h:105:12: error: 'DRM_DISPLAY_MODE_LEN' undeclared here (not in a function)  char name[DRM_DISPLAY_MODE_LEN];            ^~~~~~~~~~~~~~~~~~~~include/drm/drm_modes.h:150:27: error: field 'picture_aspect_ratio' has incomplete type  enum hdmi_picture_aspect picture_aspect_ratio;                           ^~~~~~~~~~~~~~~~~~~~include/drm/drm_modes.h:165:27: error: field 'force' has incomplete type  enum drm_connector_force force;                           ^~~~~include/drm/drm_modes.h: In function 'drm_mode_is_stereo':include/drm/drm_modes.h:178:23: error: 'DRM_MODE_FLAG_3D_MASK' undeclared (first use in this function)  return mode->flags & DRM_MODE_FLAG_3D_MASK;                       ^~~~~~~~~~~~~~~~~~~~~include/drm/drm_modes.h:178:23: note: each undeclared identifier is reported only once for each function it appears ininclude/drm/drm_modes.h: At top level:include/drm/drm_modes.h:185:49: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:185 struct drm_display_mode *drm_mode_create(struct drm_device *dev);                                                 ^~~~~~~~~~include/drm/drm_modes.h:186:30: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:186 void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);                              ^~~~~~~~~~include/drm/drm_modes.h:187:39: warning: 'struct drm_mode_modeinfo' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:187 void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,                                       ^~~~~~~~~~~~~~~~~include/drm/drm_modes.h:190:20: warning: 'struct drm_mode_modeinfo' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:190       const struct drm_mode_modeinfo *in);                    ^~~~~~~~~~~~~~~~~include/drm/drm_modes.h:200:46: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:200 struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,                                              ^~~~~~~~~~include/drm/drm_modes.h:204:46: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:204 struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,                                              ^~~~~~~~~~include/drm/drm_modes.h:207:54: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:207 struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,                                                      ^~~~~~~~~~include/drm/drm_modes.h:213:51: warning: 'struct videomode' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:213 void drm_display_mode_from_videomode(const struct videomode *vm,                                                   ^~~~~~~~~include/drm/drm_modes.h:216:15: warning: 'struct videomode' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:216        struct videomode *vm);               ^~~~~~~~~include/drm/drm_modes.h:229:52: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:229 struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,                                                    ^~~~~~~~~~include/drm/drm_modes.h:245:36: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:245 void drm_mode_prune_invalid(struct drm_device *dev,                                    ^~~~~~~~~~include/drm/drm_modes.h:256:42: warning: 'struct drm_device' declared inside parameter list will not be visible outside of this definition or declarationerror, forbidden warning:drm_modes.h:256 drm_mode_create_from_cmdline_mode(struct drm_device *dev,                                          ^~~~~~~~~~drivers/gpu/drm/panel/panel-sitronix-st7701.c: In function 'st7701_get_modes':drivers/gpu/drm/panel/panel-sitronix-st7701.c:269:37: error: dereferencing pointer to incomplete type 'struct drm_connector'  mode = drm_mode_duplicate(connector->dev, desc_mode);                                     ^~drivers/gpu/drm/panel/panel-sitronix-st7701.c: At top level:drivers/gpu/drm/panel/panel-sitronix-st7701.c:291:15: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]error, forbidden warning:panel-sitronix-st7701.c:291  .get_modes = st7701_get_modes,               ^~~~~~~~~~~~~~~~drivers/gpu/drm/panel/panel-sitronix-st7701.c:291:15: note: (near initialization for 'st7701_funcs.get_modes')drivers/gpu/drm/panel/panel-sitronix-st7701.c:310:10: error: 'DRM_MODE_TYPE_DRIVER' undeclared here (not in a function)  .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,          ^~~~~~~~~~~~~~~~~~~~drivers/gpu/drm/panel/panel-sitronix-st7701.c:310:33: error: 'DRM_MODE_TYPE_PREFERRED' undeclared here (not in a function)  .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,                                 ^~~~~~~~~~~~~~~~~~~~~~~drivers/gpu/drm/panel/panel-sitronix-st7701.c: In function 'st7701_dsi_probe':drivers/gpu/drm/panel/panel-sitronix-st7701.c:364:10: error: 'DRM_MODE_CONNECTOR_DSI' undeclared (first use in this function)          DRM_MODE_CONNECTOR_DSI);          ^~~~~~~~~~~~~~~~~~~~~~drivers/gpu/drm/panel/panel-sitronix-st7701.c:363:2: error: too many arguments to function 'drm_panel_init'  drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs,  ^~~~~~~~~~~~~~In file included from drivers/gpu/drm/panel/panel-sitronix-st7701.c:9:0:include/drm/drm_panel.h:138:6: note: declared here void drm_panel_init(struct drm_panel *panel);      ^~~~~~~~~~~~~~drivers/gpu/drm/panel/panel-sitronix-st7701.c:377:8: error: implicit declaration of function 'drm_panel_of_backlight' [-Werror=implicit-function-declaration]  ret = drm_panel_of_backlight(&st7701->panel);        ^~~~~~~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors```

Viewing all articles
Browse latest Browse all 6393

Trending Articles