View Single Post
Old 09-03-2019, 12:15 PM   #12
schuhumi
Member
schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.
 
Posts: 17
Karma: 222284
Join Date: Jul 2018
Device: PW3
Quote:
Originally Posted by NiLuJe View Post
I have no experience (at all) with X drivers, but, technically, yeah, once you have a rectangle's coordinates/dimensions, you're only an fbink_refresh() away .
Cool

Quote:
Originally Posted by knc1 View Post
If you are writing about your PW3 ...
All series 5.x firmware devices are running native X11.
Plus, the 'diags' firmware of the K4 is also running X11.
So there are your X11 drivers for each device, Amazon/Lab126 already ships them.
I'm aware that it runs X11, what I meant was using X11 from Alpine without that abomination of windowmanager-tied refresh scripts. And I briefly tried compiling the driver Amazon provides, but since Amazon ships xorg-server 1.8.2 and Alpine is at 1.20.5, it seems like it actually fails due to changed driver ABI, for example:
Code:
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:50:54: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
 extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
                                          ~~~~~~~~~~~~^~~~~
imx_display.c:961:2: error: too many arguments to function 'fbdevHWAdjustFrame'
  fbdevHWAdjustFrame(scrnIndex,0,0,0);
  ^~~~~~~~~~~~~~~~~~
Full output for anyone interested:
Spoiler:
Code:
[alpine@kindle xf86-video-imx_2011-04-11]$ make
make  all-recursive
make[1]: Entering directory '/home/alpine/xf86-video-imx_2011-04-11'
Making all in src
make[2]: Entering directory '/home/alpine/xf86-video-imx_2011-04-11/src'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I/usr/include/xorg -fvisibility=hidden -I/usr/include/pixman-1 -I/usr/include/X11/dri -I/usr/include/libdrm  -DRENDER -DCOMPOSITE -DMITSHM -DIMX_XVIDEO_ENABLE=0 -g -O2 -MT imx_display.lo -MD -MP -MF .deps/imx_display.Tpo -c -o imx_display.lo imx_display.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/xorg -fvisibility=hidden -I/usr/include/pixman-1 -I/usr/include/X11/dri -I/usr/include/libdrm -DRENDER -DCOMPOSITE -DMITSHM -DIMX_XVIDEO_ENABLE=0 -g -O2 -MT imx_display.lo -MD -MP -MF .deps/imx_display.Tpo -c imx_display.c  -fPIC -DPIC -o .libs/imx_display.o
imx_display.c: In function 'imxDisplayPointerMoved':
imx_display.c:135:32: warning: passing argument 1 of 'fPtr->prevPointerMovedProc' makes pointer from integer without a cast [-Wint-conversion]
  (*fPtr->prevPointerMovedProc)(index, newX, newY);
                                ^~~~~
imx_display.c:135:32: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
imx_display.c: In function 'imxDisplaySetCurrentMode':
imx_display.c:383:12: warning: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration]
  if (-1 == write(fd, validModeName, strlen(validModeName))) {
            ^~~~~
            fwrite
imx_display.c:391:2: warning: implicit declaration of function 'close'; did you mean 'Fclose'? [-Wimplicit-function-declaration]
  close(fd);
  ^~~~~
  Fclose
imx_display.c: In function 'imxDisplayGetCurrentMode':
imx_display.c:439:12: warning: implicit declaration of function 'ioctl'; did you mean 'iscntrl'? [-Wimplicit-function-declaration]
  if (-1 == ioctl(fd, FBIOGET_VSCREENINFO, &fbVarScreenInfo)) {
            ^~~~~
            iscntrl
imx_display.c:448:24: warning: implicit declaration of function 'xalloc'; did you mean 'valloc'? [-Wimplicit-function-declaration]
  DisplayModePtr mode = xalloc(sizeof(DisplayModeRec));
                        ^~~~~~
                        valloc
imx_display.c:448:24: warning: initialization of 'DisplayModePtr' {aka 'struct _DisplayModeRec *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
imx_display.c: In function 'imxDisplayDeleteModes':
imx_display.c:581:4: warning: implicit declaration of function 'xfree'; did you mean 'free'? [-Wimplicit-function-declaration]
    xfree(mode->name);
    ^~~~~
    free
imx_display.c: In function 'imxDisplayPreInit':
imx_display.c:855:27: warning: implicit declaration of function 'xcalloc'; did you mean 'calloc'? [-Wimplicit-function-declaration]
  imxPtr->displayPrivate = xcalloc(sizeof(ImxDisplayRec), 1);
                           ^~~~~~~
                           calloc
imx_display.c:855:25: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  imxPtr->displayPrivate = xcalloc(sizeof(ImxDisplayRec), 1);
                         ^
imx_display.c: In function 'imxDisplayStartScreenInit':
imx_display.c:961:21: warning: passing argument 1 of 'fbdevHWAdjustFrame' makes pointer from integer without a cast [-Wint-conversion]
  fbdevHWAdjustFrame(scrnIndex,0,0,0);
                     ^~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:50:54: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
 extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
                                          ~~~~~~~~~~~~^~~~~
imx_display.c:961:2: error: too many arguments to function 'fbdevHWAdjustFrame'
  fbdevHWAdjustFrame(scrnIndex,0,0,0);
  ^~~~~~~~~~~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:50:23: note: declared here
 extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
                       ^~~~~~~~~~~~~~~~~~
imx_display.c: In function 'imxDisplaySwitchMode':
imx_display.c:1008:27: warning: passing argument 1 of 'fbdevHWSwitchMode' makes pointer from integer without a cast [-Wint-conversion]
  return fbdevHWSwitchMode(scrnIndex, mode, flags);
                           ^~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:49:53: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
 extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
                                         ~~~~~~~~~~~~^~~~~
imx_display.c:1008:9: error: too many arguments to function 'fbdevHWSwitchMode'
  return fbdevHWSwitchMode(scrnIndex, mode, flags);
         ^~~~~~~~~~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:49:23: note: declared here
 extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
                       ^~~~~~~~~~~~~~~~~
imx_display.c: In function 'imxDisplayAdjustFrame':
imx_display.c:1020:2: warning: implicit declaration of function 'fbdevHWAdjustframe'; did you mean 'fbdevHWAdjustFrame'? [-Wimplicit-function-declaration]
  fbdevHWAdjustframe(scrnIndex, x, y, flags);
  ^~~~~~~~~~~~~~~~~~
  fbdevHWAdjustFrame
imx_display.c: In function 'imxDisplayEnterVT':
imx_display.c:1034:24: warning: passing argument 1 of 'fbdevHWEnterVT' makes pointer from integer without a cast [-Wint-conversion]
  return fbdevHWEnterVT(scrnIndex, flags);
                        ^~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:51:50: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
 extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn);
                                      ~~~~~~~~~~~~^~~~~
imx_display.c:1034:9: error: too many arguments to function 'fbdevHWEnterVT'
  return fbdevHWEnterVT(scrnIndex, flags);
         ^~~~~~~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:51:23: note: declared here
 extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn);
                       ^~~~~~~~~~~~~~
imx_display.c: In function 'imxDisplayLeaveVT':
imx_display.c:1046:17: warning: passing argument 1 of 'fbdevHWLeaveVT' makes pointer from integer without a cast [-Wint-conversion]
  fbdevHWLeaveVT(scrnIndex, flags);
                 ^~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:52:50: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
 extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn);
                                      ~~~~~~~~~~~~^~~~~
imx_display.c:1046:2: error: too many arguments to function 'fbdevHWLeaveVT'
  fbdevHWLeaveVT(scrnIndex, flags);
  ^~~~~~~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:52:23: note: declared here
 extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn);
                       ^~~~~~~~~~~~~~
imx_display.c: In function 'imxDisplayValidMode':
imx_display.c:1060:26: warning: passing argument 1 of 'fbdevHWValidMode' makes pointer from integer without a cast [-Wint-conversion]
  return fbdevHWValidMode(scrnIndex, mode, verbose, flags);
                          ^~~~~~~~~
In file included from imx_display.c:39:
/usr/include/xorg/fbdevhw.h:47:58: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
 extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
                                              ~~~~~~~~~~~~^~~~~
imx_display.c: In function 'xf86SwitchModePriv':
imx_display.c:1162:31: warning: passing argument 2 of 'miPointerSetPosition' makes integer from pointer without a cast [-Wint-conversion]
     miPointerSetPosition(dev, &px, &py);
                               ^~~
In file included from /usr/include/xorg/xf86Cursor.h:6,
                 from /usr/include/xorg/xf86Crtc.h:29,
                 from imx_display.c:37:
/usr/include/xorg/mipointer.h:106:45: note: expected 'int' but argument is of type 'int *'
 miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
                                         ~~~~^~~~
imx_display.c:1162:36: warning: passing argument 3 of 'miPointerSetPosition' from incompatible pointer type [-Wincompatible-pointer-types]
     miPointerSetPosition(dev, &px, &py);
                                    ^~~
In file included from /usr/include/xorg/xf86Cursor.h:6,
                 from /usr/include/xorg/xf86Crtc.h:29,
                 from imx_display.c:37:
/usr/include/xorg/mipointer.h:106:59: note: expected 'double *' but argument is of type 'int *'
 miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
                                                   ~~~~~~~~^
imx_display.c:1162:5: error: too few arguments to function 'miPointerSetPosition'
     miPointerSetPosition(dev, &px, &py);
     ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/xorg/xf86Cursor.h:6,
                 from /usr/include/xorg/xf86Crtc.h:29,
                 from imx_display.c:37:
/usr/include/xorg/mipointer.h:106:1: note: declared here
 miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
 ^~~~~~~~~~~~~~~~~~~~
imx_display.c: In function 'privSendConfigNotify':
imx_display.c:1197:22: error: 'WindowTable' undeclared (first use in this function); did you mean 'WindowDrawable'?
     WindowPtr pWin = WindowTable[pScreen->myNum];
                      ^~~~~~~~~~~
                      WindowDrawable
imx_display.c:1197:22: note: each undeclared identifier is reported only once for each function it appears in
imx_display.c: In function 'imxDisplayChangeFrameBufferRotateEPDC':
imx_display.c:1402:31: warning: passing argument 1 of 'pScrn->EnableDisableFBAccess' makes pointer from integer without a cast [-Wint-conversion]
  pScrn->EnableDisableFBAccess(scrnIndex, FALSE);
                               ^~~~~~~~~
imx_display.c:1402:31: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
imx_display.c:1474:10: error: 'struct _ScrnInfoRec' has no member named 'pixmapPrivate'; did you mean 'driverPrivate'?
   pScrn->pixmapPrivate = pScreenPixmap->devPrivate;
          ^~~~~~~~~~~~~
          driverPrivate
imx_display.c:1480:31: warning: passing argument 1 of 'pScrn->EnableDisableFBAccess' makes pointer from integer without a cast [-Wint-conversion]
  pScrn->EnableDisableFBAccess(scrnIndex, TRUE);
                               ^~~~~~~~~
imx_display.c:1480:31: note: expected 'ScrnInfoPtr' {aka 'struct _ScrnInfoRec *'} but argument is of type 'int'
make[2]: *** [Makefile:359: imx_display.lo] Error 1
make[2]: Leaving directory '/home/alpine/xf86-video-imx_2011-04-11/src'
make[1]: *** [Makefile:319: all-recursive] Error 1
make[1]: Leaving directory '/home/alpine/xf86-video-imx_2011-04-11'
make: *** [Makefile:248: all] Error 2
[alpine@kindle xf86-video-imx_2011-04-11]$


I think the options are:
  1. Use the existing xserver with customized refresh. Pro: Driver works Con: Put work into an obsolete piece of software outside the Alpine ecosystem
  2. Search for a newer imx xorg driver. Pro: Can use Alpine's xserver Con: I have no idea yet whether the imx video driver has dependencies in the kernel, that could be a dealbreaker
  3. Port driver from Amazon to newer xserver: Pro: compatible with kernel for sure Con: Probably more work than fixing a handful function parameters / pointers whatever
I just need to do some more research..
schuhumi is offline   Reply With Quote