From: Antonino Daplas <adaplas@pol.net>
To: "p.gilardetti@libero.it" <p.gilardetti@libero.it>
Cc: Linux Fbdev development list <linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: (no subject)
Date: 07 Feb 2003 05:55:07 +0800 [thread overview]
Message-ID: <1044568401.1327.24.camel@localhost.localdomain> (raw)
In-Reply-To: <H9W89N$BB99264CDD033C15A1E92A4E2F5E0F29@libero.it>
On Thu, 2003-02-06 at 23:27, p.gilardetti@libero.it wrote:
> Hi,
> I have a problem when I change the bpp value, here is the code:
>
> if( ioctl(fbd, FBIOGET_VSCREENINFO, &var_info) == -1){
> perror("\nError IOCTL 1");
> exit(0);
> }
> printf("\n bpp: %d", var_info.bits_per_pixel); // output is bpp: 16
> var_info.bits_per_pixel = 24;
> if( ioctl(fbd, FBIOPUT_VSCREENINFO, &var_info) == -1){
> perror("\nError IOCTL 2");
> exit(0);
> }
> The program exit with the following message error:
> Error IOCTL 2: Invalid argument
>
> How can I set the bpp value? Should I modify the file /etc/X11/XF86Config?
This will depend on the driver you are using. vesafb does not support
any change to fb_var_screeninfo. Other drivers, may not round off
invalid values: ie bpp == 24 is not supported. Also, increasing bpp
implies that more video memory will be required if var.xres_virtual and
var.yres_virtual remains the same. So try to check xres, yres,
xres_virtual and yres_virtual against fix.smem_len and
var.bits_per_pixel.
fix.smem_len >= (var.bits_per_pixel * var.xres_virtual)/8 *
var.yres_virtual.
/etc/X11/XF86Config has nothing to with fbdev.
>
> I have another problem, I try to write a simple program that reads frame from framebuffer and then creates a Divx file of a few seconds.
> I map the framebuffer to a buffer, but the program crash with a segmentation fault:
>
> screen_buffer = (char *)malloc(DIM_BUFFER * sizeof(char));
you don't need this step.
> screen_buffer = (void *)mmap(0, DIM_BUFFER, PROT_READ, MAP_SHARED, fbd, 0);
check if mmap failed, (returns -1).
>
> encFrame.image = (void *)screen_buffer; <--- causes seg fault
memcpy(encFrame.image, screen_bufer, DIM_BUFFER) is a more appropriate
step to get the contents.
Tony
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
next prev parent reply other threads:[~2003-02-06 21:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-06 15:27 (no subject) p.gilardetti
2003-02-06 21:55 ` Antonino Daplas [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-04 9:31
2007-08-17 16:47 Krzysztof Helt
2006-04-14 15:02 Javier Ruano
2006-04-14 15:28 ` Jan-Benedict Glaw
2006-04-15 5:47 ` Knut Petersen
2004-05-26 9:00 xuhaoz
2004-05-28 7:42 ` Antonino A. Daplas
2004-05-22 1:48 xuhaoz
2003-07-17 12:25 Nitin Mahajan
2003-07-07 23:37 Lia Maggioni
2002-12-10 10:59 Vincent Ivens
2002-12-10 18:31 ` James Simmons
2002-12-10 21:05 ` vivens
2002-12-13 6:33 ` Antonino Daplas
2002-08-19 9:02 Geert Uytterhoeven
2002-08-22 18:48 ` James Simmons
2002-08-06 17:37 Adam K Kirchhoff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1044568401.1327.24.camel@localhost.localdomain \
--to=adaplas@pol.net \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=p.gilardetti@libero.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).