Jesse Barnes написав(ла):
[...]
With all the changes in DRM master I think things broke recently. In the
drm-next relative patch I posted I fixed a few issues like this so hopefully
that will work for you, let me know if they don't.
i tested against *drm-next* with *drm-next-vblank-rework-2.patch* but
satiation did not changed - still no interrupts generated from board
(read to bottom):
[EMAIL PROTECTED] vblank]# cat /proc/interrupts
CPU0 CPU1
[...]
15: 0 0 IO-APIC-edge ata_piix
16: 0 0 IO-APIC-fasteoi [EMAIL PROTECTED]:0000:00:02.0
18: 1 0 IO-APIC-fasteoi yenta
[...]
for testing i did simple program (source code attached) that call:
vbl.request.type = DRM_VBLANK_RELATIVE;
vbl.request.sequence = 1;
r = drmWaitVBlank(fd, &vbl);
and result is EBUSY.
drm initialization is fine, but i get message about disabled pipe:
[...]
[drm] Initialized drm 1.1.0 20060810
pci 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
pci 0000:00:02.0: setting latency timer to 64
[drm] Initialized i915 1.6.0 20060119 on minor 0
[drm:i915_get_vblank_counter] *ERROR* trying to get vblank count for
disabled pipe 0
[...]
its comes from i915_irq.c:
[...]
u32 i915_get_vblank_counter(struct drm_device *dev, int plane)
[...]
if (!i915_pipe_enabled(dev, pipe)) {
DRM_ERROR("trying to get vblank count for disabled pipe
%d\n", pipe);
return 0;
[...]
it disabled because of xorg re-connect output to pipe B (IMHO):
/var/log/ Xorg.0.log
[...]
(--) intel(0): IO registers at addr 0xF0400000
(II) intel(0): 2 display pipes available.
(==) intel(0): Using EXA for acceleration
[...]
(II) intel(0): Output configuration:
(II) intel(0): Pipe A is off
(II) intel(0): Display plane A is now disabled and connected to pipe A.
(II) intel(0): Pipe B is on
(II) intel(0): Display plane B is now enabled and connected to pipe B.
(II) intel(0): Output VGA is connected to pipe none
(II) intel(0): Output LVDS is connected to pipe B
(II) intel(0): Output TV is connected to pipe none
(II) intel(0): [drm] dma control initialized, using IRQ 16
(II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled
message.
(II) intel(0): Selecting standard 18 bit TMDS pixel format.
(II) intel(0): DPMS enabled
(II) intel(0): Set up textured video
(II) intel(0): Set up overlay video
(II) intel(0): direct rendering: Enabled
[...]
So if i have no external monitor i have an error *EBUSY* for
*drmWaitVBlank* because of it wants count vblanks for wrong pipe (IMHO).
If i connect external VGA monitor, Xorg.0.log says:
[...]
(II) intel(0): Output configuration:
(II) intel(0): Pipe A is on
(II) intel(0): Display plane A is now enabled and connected to pipe A.
(II) intel(0): Pipe B is on
(II) intel(0): Display plane B is now enabled and connected to pipe B.
(II) intel(0): Output VGA is connected to pipe A
(II) intel(0): Output LVDS is connected to pipe B
(II) intel(0): Output TV is connected to pipe none
(II) intel(0): [drm] dma control initialized, using IRQ 16
(II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled
message.
(II) intel(0): Selecting standard 18 bit TMDS pixel format.
(II) intel(0): DPMS enabled
(II) intel(0): Set up textured video
(II) intel(0): Set up overlay video
(II) intel(0): direct rendering: Enabled
[...]
and my test program works fine and interrupts counter is grows:
[EMAIL PROTECTED] vblank]# cat /proc/interrupts
CPU0 CPU1
[...]
16: 31057 0 IO-APIC-fasteoi [EMAIL PROTECTED]:0000:00:02.0
18: 1 0 IO-APIC-fasteoi yenta
[...]
so the current problem for me is how to ensure drm to count vblanks for
currently only active pipe B if only LVDS is used for current configuration?
--
________________________________________
Maksym Veremeyenko
/*
* use command line to compile:
* gcc -o vblank-test vblank-test.c -ldrm -I/usr/include/drm
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <xf86drm.h>
#include <errno.h>
static unsigned long long timeGetTime()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return
((unsigned long long)tv.tv_sec)*1000LL
+
((unsigned long long)tv.tv_usec)/1000LL;
};
#define VBLANKS_COUNT 300
#define DRI_DEV "/dev/dri/card0"
int main(int argc, char** argv)
{
int i, r, fd;
drmVBlank vbl;
unsigned long long A, B, D;
/* open device */
fd = open(DRI_DEV, O_RDWR);
if(-1 == fd)
{
fprintf(stderr, "ERROR: failed to open '%s', r=%d\n", DRI_DEV, errno);
return 1;
};
A = timeGetTime();
for(r = 0, i = 0; (i < VBLANKS_COUNT) && (0 == r); i++)
{
vbl.request.type = DRM_VBLANK_RELATIVE;
vbl.request.sequence = 1;
r = drmWaitVBlank(fd, &vbl);
};
B = timeGetTime();
if(0 != r)
fprintf(stderr, "ERROR: drmWaitVBlank failed, r=%d\n", errno);
else
{
D = (B - A) / VBLANKS_COUNT;
if(0 != D) D = 1000LL / D;
fprintf(stderr, "framerate is approx %lld fps\n", D);
};
close(fd);
return 0;
};
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel