Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Sep 2007 06:35 AM by  jdr
Running Xorg
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages
jdr
New Member
New Member
Posts:


--
21 Sep 2007 11:24 AM
    Hi,

    I have a i.MX31 Lite kit running with Debian for arm-eabi. The framebuffer
    device seem to be working fine, I see a nice Penguin at startup. Also
    video output through video4linux works.
    Now I would like to run some userinterface stuff, maybe a file browser.
    The most off the shelf thing I can think about is running Xorg and GPE
    or something like that on top (like it is being done on any linux enabled PDA).

    But Xorg does not work, either using the fbdev or v4l driver.
    The fbdev fails because the display configuration gets tampered while
    doing a query. Xorg is picky and rejects doing anything.
    I'm still trying to find the ioctl call where the framebuffer driver
    messes with the display setup...

    (II) v4l driver for Video4Linux
    (II) FBDEV: driver for framebuffer: fbdev
    (II) v4l: V4LProbe called.
    (II) v4l: About to call xf86XVRegisterGenericAdaptorDriver().
    (II) Loading sub module "fbdevhw"
    (II) LoadModule: "fbdevhw"
    (II) Loading /usr/lib/xorg/modules/linux//libfbdevhw.so
    (II) Module fbdevhw: vendor="X.Org Foundation"
    compiled for 1.4.0, module version = 0.0.2
    ABI class: X.Org Video Driver, version 2.0
    (II) FBDEV(0): using default device
    (II) Running in FRAMEBUFFER Mode
    (**) FBDEV(0): Depth 16, (--) framebuffer bpp 16
    (==) FBDEV(0): RGB weight 565
    (==) FBDEV(0): Default visual is TrueColor
    (==) FBDEV(0): Using gamma correction (1.0, 1.0, 1.0)
    (II) FBDEV(0): hardware: DISP3 BG (video memory: 300kB)
    (II) FBDEV(0): checking modes against framebuffer device...
    (II) FBDEV(0): mode "240x320" test failed
    (II) FBDEV(0): checking modes against monitor...
    (--) FBDEV(0): Virtual size is 240x320 (pitch 240)
    (**) FBDEV(0): Built-in mode "current": 15.6 MHz, 41.6 kHz, 126.4 Hz
    (II) FBDEV(0): Modeline "current"x0.0 15.55 240 300 314 374 320 323 325 329
    -hsync +vsync -csync (41.6 kHz)
    (==) FBDEV(0): DPI set to (75, 75)
    (II) Loading sub module "fb"
    (II) LoadModule: "fb"
    (II) Loading /usr/lib/xorg/modules//libfb.so
    (II) Module fb: vendor="X.Org Foundation"
    compiled for 1.4.0, module version = 1.0.0
    ABI class: X.Org ANSI C Emulation, version 0.3
    (**) FBDEV(0): using shadow framebuffer
    (II) Loading sub module "shadow"
    (II) LoadModule: "shadow"
    (II) Loading /usr/lib/xorg/modules//libshadow.so
    (II) Module shadow: vendor="X.Org Foundation"
    compiled for 1.4.0, module version = 1.1.0
    ABI class: X.Org ANSI C Emulation, version 0.3
    (EE) FBDEV(0): FBIOPUT_VSCREENINFO succeeded but modified mode
    (EE) FBDEV(0): mode initialization failed

    With v4l driver, Xorg does not seem to find any device. For some strange
    reason the probe v4l driver call is never called. The v4l has some device
    selection code inside, but for some reason the core of the xserver decides
    that there is no device, before leting the driver to do any probing.
    Does anybody know why is this ? Is there duplicated probing code and I'm
    just too stupid to find it ?

    Well, any hint on getting Xorg running either using fbdev or v4l would be appreciated.

    Thanks in advance,
    jdr
    jdr
    New Member
    New Member
    Posts:


    --
    24 Sep 2007 05:53 AM
    Hi,

    I just got Xorg showing its very known characteristic background and
    pointing device X.

    The problem was in file hw/xfree86/fbdevhw/fbdevhw.c, that the
    "sync" field of the fbdev mode is being used in some boogie fashion
    by the framebuffer kernel driver, and thus get modified unexpectedly.
    The change checking occurs at about line 246. I just commented the
    "sync" field difference checking out, and it seems to work.

    Now the question is, who got it right ? Is it the kernel modules fault or Xorg
    fault ? Maybe somebody involved in the mxc framebuffer driver can say
    something about ?

    Best Regards,
    jdr
    jdr
    New Member
    New Member
    Posts:


    --
    25 Sep 2007 06:35 AM
    Hi,

    I found out that either the current mxc_ts driver and the evtouch input
    driver from xorg does not allow any kind of touchscreen calibration at all.
    The xorg evtouch input driver claims to support calibration, but is only
    a sort of boundary restrict thing. No linear scaling or offset

    I added some module options to the mxc_ts driver in order to allow lineaer
    scaling and offset calibration. The values are passed to the driver through
    module parameters.

    The code snippet from mxc_ts.c:

    #include <asm/arch/pmic_adc.h>

    #define MXC_TS_NAME "mxc_ts"

    static int xmax = 908;
    module_param(xmax, uint, 0);
    MODULE_PARM_DESC(xmax, "Max x val");

    static int xmin = 120;
    module_param(xmin, uint, 0);
    MODULE_PARM_DESC(xmin, "Min x val");

    static int ymax = 928;
    module_param(ymax, uint, 0);
    MODULE_PARM_DESC(ymax, "Max y val");

    static int ymin = 120;
    module_param(ymin, uint, 0);
    MODULE_PARM_DESC(ymin, "Min y val");

    static int xres = 240;
    module_param(xres, uint, 0);
    MODULE_PARM_DESC(xres, "xres");
    static int yres = 320;
    module_param(yres, uint, 0);
    MODULE_PARM_DESC(xres, "yres");


    static struct input_dev *mxc_inputdev = NULL;
    static u32 input_ts_installed;

    static int ts_thread(void *arg)
    {
    t_touch_screen ts_sample;
    s32 wait = 0;
    daemonize("mxc_ts");
    while (input_ts_installed) {
    try_to_freeze();
    memset(&ts_sample, 0, sizeof(t_touch_screen));
    pmic_adc_get_touch_sample(&ts_sample, !wait);

    {
    int x, y;
    x = (ts_sample.x_position-xmin)*xres/(xmax-xmin);
    y = (ts_sample.y_position-ymin)*yres/(ymax-ymin);
    if (ts_sample.x_position<xmin)
    x = 0;
    if (ts_sample.x_position>xmax)
    x = xres;
    if (ts_sample.y_position<ymin)
    y = 0;
    if (ts_sample.y_position>ymax)
    y = yres;
    input_report_abs(mxc_inputdev, ABS_X, x);
    input_report_abs(mxc_inputdev, ABS_Y, y);
    input_report_abs(mxc_inputdev, ABS_PRESSURE,
    ts_sample.contact_resistance);
    }
    input_sync(mxc_inputdev);

    wait = ts_sample.contact_resistance;
    msleep(20);
    }

    return 0;
    }


    Best Regards,
    jdr
    You are not authorized to post a reply.