public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Re: omapfb: help from userspace
@ 2008-10-08 18:36 Nathan Monson
  2008-10-08 20:21 ` Nathan Monson
  0 siblings, 1 reply; 22+ messages in thread
From: Nathan Monson @ 2008-10-08 18:36 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org List

"Felipe Contreras" <felipe.contreras@gmail.com> writes:
> Now I'm getting a bunch of these errors apparently when shuffling
> memory too fast:
> irq -33, desc: c0335cf8, depth: 0, count: 0, unhandled: 0
> ->handle_irq():  c00744e0, handle_bad_irq+0x0/0x22c
> ->chip(): 00000000, 0x0
> ->action(): 00000000

I've had this problem regularly while using linux-omap .26 and .27 on
the BeagleBoard.  I turned off framebuffer support after seeing your
message and it seemed to help.  (Hard to tell since it is random.)

Now I'm using DSP Bridge and the problem is back.  In fact, the
problem occurs within a minute or two of running code on the DSP.

On the BeagleBoard list, Pratheesh Gangadhar said that mapping I/O
regions as Strongly Ordered suppresses this problem:
http://groups.google.com/group/beagleboard/browse_thread/thread/23e1c95b4bfb09b5/70d12dca569ca503?show_docid=70d12dca569ca503

> This proves that these spurious interrupts are side effect of using posted
> writes to acknowledge/clear the interrupt status in the peripheral.

Is there anyone who knows their way around mmu.c that could create a
quick and dirty patch to use Strongly Ordered I/O on OMAP3?  I'd like
to test it with the DSP.

- Nathan

^ permalink raw reply	[flat|nested] 22+ messages in thread
* omapfb: help from userspace
@ 2008-09-15 14:38 Felipe Contreras
  2008-09-15 20:24 ` Felipe Contreras
  0 siblings, 1 reply; 22+ messages in thread
From: Felipe Contreras @ 2008-09-15 14:38 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Hi,

I've been trying to get the yuv overlay to work, but without success.
I'm trying to do what Mans Rullgard is doing on omapfbplay[1], but I
don't see anything happening.

The normal RGB plane is working fine, I'm attaching a test that writes
data to the whole framebuffer.

This is the output:
# /tmp/fb_test
main: size=720x400, 16bpp
overlay: size=720x400, 16bpp
panel: enabled=0
panel: 0x0 - 720x400
# /tmp/fb_test
main: size=720x400, 16bpp
overlay: size=720x400, 16bpp
panel: enabled=1
panel: 0x0 - 720x400

Best regards.

[1] http://git.mansr.com/?p=omapfbplay

-- 
Felipe Contreras

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fb_test.c --]
[-- Type: text/x-csrc; name=fb_test.c, Size: 4027 bytes --]

#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/mman.h>

#include <mach/omapfb.h>

#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>

#define MIN(a, b) (((a) < (b)) ? (a) : (b))

static int main_fb;
static int overlay_fb;

static struct fb_var_screeninfo main_screen_info;
static struct fb_var_screeninfo overlay_screen_info;
static struct omapfb_mem_info mem_info;
static struct omapfb_plane_info plane_info;

uint8_t *overlay_mem;

unsigned int input_width = 640;
unsigned int input_height = 480;

static void
log_helper (const char *type,
            const char *file,
            const char *function,
            unsigned int line,
            const char *fmt,
            ...)
{
    char *tmp = NULL;
    va_list args;

    va_start (args, fmt);

    vasprintf (&tmp, fmt, args);

    fprintf (stderr, "%s %s:%d:%s() %s\n",
             type,
             file, line, function,
             tmp);

    free (tmp);

    va_end (args);
}

#define log_error(...) log_helper ("error", __FILE__, __func__, __LINE__, __VA_ARGS__);

void
set_screen (void)
{
#if 0
    overlay_screen_info.xres = MIN (main_screen_info.xres, input_width) & ~15;
    overlay_screen_info.yres = MIN (main_screen_info.yres, input_height) & ~15;
    overlay_screen_info.xoffset = 0;
    overlay_screen_info.yoffset = 0;
#else
    overlay_screen_info.xres = main_screen_info.xres;
    overlay_screen_info.yres = main_screen_info.yres;
#endif
    overlay_screen_info.nonstd = OMAPFB_COLOR_YUY422;

    {
        int err;
        err = ioctl (overlay_fb, FBIOPUT_VSCREENINFO, &overlay_screen_info);
        if (err != 0)
        {
            log_error ("overlay set");
            return;
        }
    }
}

void
set_plane (void)
{
    plane_info.enabled = 1;
#if 0
    plane_info.pos_x = 0;
    plane_info.pos_y = 0;
    plane_info.out_width = main_screen_info.xres;
    plane_info.out_height = main_screen_info.yres;
#endif

    {
        int err;
        err = ioctl (overlay_fb, OMAPFB_SETUP_PLANE, &plane_info);
        if (err != 0)
        {
            log_error ("error=%i", err);
            return;
        }
    }
}

void
clean_omap (void)
{
    unsigned int i;
    for (i = 0; i < mem_info.size / 4; i++)
        ((uint32_t *) overlay_mem)[i] = 0xFFFFAAAA;
}

int
main (void)
{
    int err;
    main_fb = -1;
    overlay_fb = -1;

    main_fb = open ("/dev/fb0", O_RDWR);

    if (main_fb == -1)
    {
        log_error ("/dev/fb0");
        return 1;
    }

    if (ioctl (main_fb, FBIOGET_VSCREENINFO, &main_screen_info))
    {
        log_error ("main screen");
        goto leave;
    }

    overlay_fb = open ("/dev/fb1", O_RDWR);

    if (overlay_fb == -1)
    {
        log_error ("/dev/fb1");
        return 1;
    }

    if (ioctl (overlay_fb, FBIOGET_VSCREENINFO, &overlay_screen_info))
    {
        log_error ("overlay screen");
        goto leave;
    }

    if (ioctl (overlay_fb, OMAPFB_QUERY_PLANE, &plane_info))
    {
        log_error ("omap pane");
        goto leave;
    }

    if (ioctl (overlay_fb, OMAPFB_QUERY_MEM, &mem_info))
    {
        log_error ("omap mem");
        goto leave;
    }

    printf ("main: size=%ix%i, %ibpp\n", main_screen_info.xres, main_screen_info.yres, main_screen_info.bits_per_pixel);
    printf ("overlay: size=%ix%i, %ibpp\n", overlay_screen_info.xres, overlay_screen_info.yres, overlay_screen_info.bits_per_pixel);

    /* omap */
    printf ("panel: enabled=%u\n", plane_info.enabled);
    printf ("panel: %ux%u - %ux%u\n", plane_info.pos_x, plane_info.pos_y,
            plane_info.out_width, plane_info.out_height);

    /* map the framebuffer */
    overlay_mem = mmap (NULL, mem_info.size, PROT_WRITE, MAP_SHARED, overlay_fb, 0);
    if (overlay_mem == MAP_FAILED)
    {
        log_error ("mmap");
        goto leave;
    }

    clean_omap ();
    set_screen ();
    set_plane ();

leave:
    munmap (overlay_mem, mem_info.size);

    if (overlay_fb)
        close (overlay_fb);

    if (main_fb)
        close (main_fb);

    return 0;
}

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-10-17  0:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 18:36 omapfb: help from userspace Nathan Monson
2008-10-08 20:21 ` Nathan Monson
2008-10-08 20:37   ` Woodruff, Richard
2008-10-09  6:20     ` TK, Pratheesh Gangadhar
2008-10-09 12:43       ` Tony Lindgren
2008-10-09 17:55         ` Nathan Monson
2008-10-15 11:57           ` Paul Walmsley
2008-10-15 12:04             ` Lauri Leukkunen
2008-10-16  6:49             ` Nathan Monson
2008-10-16 20:57               ` Tony Lindgren
2008-10-16 22:07                 ` Nathan Monson
2008-10-16 22:10                   ` Tony Lindgren
2008-10-16 22:15                     ` Nathan Monson
2008-10-16 22:52                       ` Tony Lindgren
2008-10-16 22:59                         ` Tony Lindgren
2008-10-16 23:02                           ` Tony Lindgren
2008-10-16 23:20                             ` Nathan Monson
2008-10-16 23:24                               ` Tony Lindgren
2008-10-17  0:17   ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-09-15 14:38 Felipe Contreras
2008-09-15 20:24 ` Felipe Contreras
2008-09-15 20:46   ` Måns Rullgård

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox