This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/xawtv3.git tree:
Subject: Fix xawtv DGA mode Author: Dmitry Butskoy <[email protected]> Date: Thu Feb 3 17:08:51 2011 -0200 v4l-conf needs a "base address". Normally it obtains it either from DGA (under X), or from frame buffer (from fbtv). In my case a call to DGA returns zero base address. Without the patch it produces black window screen. With patch applied, DGA mode works again, if V4L1 support is compiled on the drivers (as it relies on Xorg "v4l" driver that it is V4L1 only). The issue seems to be related to some problem with the X driver. The relevant code at console/v4l-conf.c is: if (-1 == ioctl(fd, VC_GETMODE, (unsigned long)&mode)) { perror("ioctl VC_GETMODE"); exit(1); } close(fd); d->width = mode.width; d->height = mode.height; d->bpp = mode.depth; d->bpl = mode.pitch; d->base = (void*)mode.fb_address; It seems that mode.pitch is not returned with a correct value for some X drivers. So, this patch is basically a workaround for a bug inside the video adapter driver. Signed-off-by: Mauro Carvalho Chehab <[email protected]> console/v4l-conf.c | 24 +++++++++++++++++++++++- man/v4l-conf.8 | 5 +++++ 2 files changed, 28 insertions(+), 1 deletions(-) --- http://git.linuxtv.org/xawtv3.git?a=commitdiff;h=d7299b931f19a989dd87e715233f1b5956b8518f diff --git a/console/v4l-conf.c b/console/v4l-conf.c index 5245bab..2544182 100644 --- a/console/v4l-conf.c +++ b/console/v4l-conf.c @@ -51,6 +51,7 @@ int verbose = 1; int yuv = 0; int user_bpp = 0; int user_shift = 0; +int user_bpl = 0; void *user_base = NULL; char *display = NULL; char *fbdev = NULL; @@ -377,7 +378,15 @@ displayinfo_v4l2(int fd, struct DISPLAYINFO *d) } if (yuv) fb.fmt.pixelformat = V4L2_PIX_FMT_YUYV; + /* Prefer an already configured bpl (if it makes sense) over our found bpl + if we did not find a base as our bpl is not very reliable when we did + not find a base */ + if (user_bpl || d->base || + fb.fmt.bytesperline < (fb.fmt.width * ((d->bpp + 7) / 8))) fb.fmt.bytesperline = d->bpl; + else + fprintf(stderr,"WARNING: keeping fbuf pitch at: %d, as no base addr was detected\n", + (int)fb.fmt.bytesperline); fb.fmt.sizeimage = fb.fmt.height * fb.fmt.bytesperline; if (NULL != d->base) fb.base = d->base; @@ -431,7 +440,7 @@ main(int argc, char *argv[]) /* parse options */ for (;;) { - if (-1 == (c = getopt(argc, argv, "hyq12d:c:b:s:fa:"))) + if (-1 == (c = getopt(argc, argv, "hyq12d:c:b:s:fa:p:"))) break; switch (c) { case 'q': @@ -468,6 +477,14 @@ main(int argc, char *argv[]) exit(1); } break; + case 'p': + if (0 == getuid()) { + sscanf(optarg,"%d",&user_bpl); + } else { + fprintf(stderr,"only root is allowed to use the -p option\n"); + exit(1); + } + break; case 'h': default: fprintf(stderr, @@ -485,6 +502,8 @@ main(int argc, char *argv[]) " -a <addr> set framebuffer address to <addr>\n" " (in hex, root only, successful autodetect\n" " will overwrite this address)\n" + " -p <pitch> set framebuffer pitch to <pitch> bytes\n" + " (decimal, root only)\n" " -1 force v4l API\n" " -2 force v4l2 API\n", argv[0], @@ -551,6 +570,9 @@ main(int argc, char *argv[]) (d.depth == 15 || d.depth == 16)) d.depth = user_bpp; + if (user_bpl) + d.bpl = user_bpl; + if (verbose) { fprintf(stderr,"mode: %dx%d, depth=%d, bpp=%d, bpl=%d, ", d.width,d.height,d.depth,d.bpp,d.bpl); diff --git a/man/v4l-conf.8 b/man/v4l-conf.8 index 3568aa6..ff36ed0 100644 --- a/man/v4l-conf.8 +++ b/man/v4l-conf.8 @@ -62,6 +62,11 @@ in hex. This option is allowed for root only. You can't overwrite the autodetected value, this switch is only useful if autodetect doesn't work because the X-Server lacks DGA support. You can put this into /etc/conf.modules, as "post-install bttv ..." for example. +.TP 4 +\fB-p\fP pitch +Set framebuffer pitch to \fBpitch\fP bytes. The value should be specified +in decimal. Allowed for root only. (Currently it is a distro-specific option +added by Fedora). .SH BUGS Hope I haven't any security flaws in there. If you find one, drop me a note. Mails with patches are preferred :-) _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
