Hi,

I'm using the NatSemi GX1 processor with its companion, the CS5530A. I'm
having a problem opening an Xv window with a source that's wider than
472 pixels. I'll try to explain what I see, although it's a little bit
difficult. If I try to display an image 476 or 480 pixels wide, the
image itself looks as if the lines are too long (each line starts a
little bit to the right of the line above it), and from time to time the
image just twitches, kind of jerks on the screen and returns right back
to its previous state. If I'm trying to use an even wider image, it's
completely garbled, and it just flickers and twitches all the time.

The height of the image doesn't matter -- the above results are the same
with any image height (tried from 20 to 1024). Which makes me believe
it's not a problem of lack of video RAM for the overlay buffer.

I've tried to disable the HW cursor, but it has no effect. I've also
disabled compression.

And last bu not least: it happens both with the nsc driver in the latest
XFree86 snapshot, and with the driver that I downloaded from
national.com and compiled myself for XFree86 4.2.0.

I'm attaching a small test program that I'm using to test it; it
receives two arguments which are going to be the X and Y sizes of the
window, and it sends a single XV image which is just a test pattern.

Any idea at all what's wrong? The specs for the chip say that it can
display overlays up to 1024x1024. And I couldn't find anything in the
driver that would limit the image size this way either. Can someone with
the same chip please run the test program and see if he gets the same
results?

If there's any other info that I should supply that might be helpful,
please tell.

Thanks!


-- 
Alex Shnitman <[EMAIL PROTECTED]>
http://www.hectic.net/   UIN 188956
PGP 0xEC5D619D / E1 F2 7B 6C A0 31 80 28  63 B8 02 BA 65 C7 8B BA
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/io.h>

#define GUID_YVYU_PACKED 0x55595659

void main(int argc, char *argv[])
{
	Display *dpy;
	Window window;
	XSetWindowAttributes xswa;
	XVisualInfo vinfo;
	int screen;
	XEvent event;
	unsigned int p_version, p_release, p_request_base,
		p_event_base, p_error_base;
	XvAdaptorInfo *ai;
	int xv_port, num, ret, i, j;
	GC gc;
	XvImage *yuv_image;
	int frame_xsize, frame_ysize;

	if(argc < 3) {
		printf("Please supply window size\n");
		exit(1);
	}
	frame_xsize = atoi(argv[1]);
	frame_ysize = atoi(argv[2]);
	printf("Opening a %dx%d window\n", frame_xsize, frame_ysize);

	dpy = XOpenDisplay(NULL);
	if(dpy == NULL) {
		printf("Can't open display\n");
		exit(1);
	}
	screen = DefaultScreen(dpy);
	if(!XMatchVisualInfo(dpy, screen, 16, TrueColor, &vinfo)) {
		printf("Can't find visual\n");
		exit(1);
	}

	xswa.background_pixel = 0;
	xswa.border_pixel = 0;
	xswa.event_mask = StructureNotifyMask | ExposureMask;
	window = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0,
						   frame_xsize, frame_ysize, 0, vinfo.depth,
						   InputOutput, vinfo.visual,
						   CWBackPixel | CWBorderPixel | CWEventMask, &xswa);
	XMapWindow(dpy, window);
	do {
		XNextEvent(dpy, &event);
	} while(event.type != MapNotify || event.xmap.event != window);

	ret = XvQueryExtension(dpy, &p_version, &p_release, &p_request_base,
						   &p_event_base, &p_error_base);
	if(ret != Success) {
		printf("Error: problem with Xv extension (QueryExtension)\n");
		exit(1);
	}

	ret = XvQueryAdaptors(dpy, DefaultRootWindow(dpy), &num, &ai);
	if(ret != Success) {
		printf("Error: problem with Xv extension (QueryAdaptors)\n");
		exit(1);
	}
	xv_port = ai[0].base_id;
	XvFreeAdaptorInfo(ai);

	gc = XCreateGC(dpy, window, 0, 0);
	yuv_image = XvCreateImage(dpy, xv_port, GUID_YVYU_PACKED, 0,
							  frame_xsize, frame_ysize);
	yuv_image->data = malloc(yuv_image->data_size);
	for(i=0; i<frame_ysize; i++)
		for(j=0; j<frame_xsize*2; j++)
			yuv_image->data[i*frame_xsize*2 + j] = i*j;
	XvPutImage(dpy, xv_port, window, gc, yuv_image, 0, 0,
			   frame_xsize, frame_ysize, 0, 0, frame_xsize, frame_ysize);

	pause();
}

Reply via email to