driver can now run without (useable) INT assigned: VBlank semaphore automatically enabled/disabled upon findings.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15103 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2005-11-24 11:19:21 +00:00
parent c484bc2197
commit 8fe19e2fbc
4 changed files with 35 additions and 23 deletions
+5 -2
View File
@@ -4,7 +4,7 @@
Other authors: Other authors:
Mark Watson Mark Watson
Rudolf Cornelissen 9-11/2002 Rudolf Cornelissen 9-11/2005
*/ */
#define MODULE_BIT 0x02000000 #define MODULE_BIT 0x02000000
@@ -140,5 +140,8 @@ status_t GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high)
/* Return the semaphore id that will be used to signal a vertical sync occured. */ /* Return the semaphore id that will be used to signal a vertical sync occured. */
sem_id ACCELERANT_RETRACE_SEMAPHORE(void) sem_id ACCELERANT_RETRACE_SEMAPHORE(void)
{ {
return si->vblank; if (si->ps.int_assigned)
return si->vblank;
else
return B_ERROR;
} }
@@ -378,6 +378,12 @@ status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, con
} }
} }
/* if not dualhead capable card clear dualhead flags */
if (!(target->flags & DUALHEAD_CAPABLE))
{
target->flags &= ~DUALHEAD_BITS;
}
/* set TV_CAPABLE if suitable: pixelclock is not important (defined by TVstandard) */ /* set TV_CAPABLE if suitable: pixelclock is not important (defined by TVstandard) */
switch (si->ps.card_type) switch (si->ps.card_type)
{ {
@@ -412,6 +418,12 @@ status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, con
break; break;
} }
/* if not TVout capable card clear TVout flags */
if (!(target->flags & TV_CAPABLE))
{
target->flags &= ~TV_BITS;
}
/* fixme: currently the matrox driver can only do secondary TVout */ /* fixme: currently the matrox driver can only do secondary TVout */
target->flags &= ~TV_PRIMARY; target->flags &= ~TV_PRIMARY;
@@ -423,7 +435,7 @@ status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, con
if (si->ps.card_type >= G200) if (si->ps.card_type >= G200)
target->flags |= B_SUPPORTS_OVERLAYS; target->flags |= B_SUPPORTS_OVERLAYS;
LOG(1, ("PROPOSEMODE: validated status modeflags: $%08x\n", target->flags)); LOG(1, ("PROPOSEMODE: validated modeflags: $%08x\n", target->flags));
/* overrule timing command flags to be (fixed) blank_pedestal = 0.0IRE, /* overrule timing command flags to be (fixed) blank_pedestal = 0.0IRE,
* progressive scan (fixed), and setup sync_on_green flag according to * progressive scan (fixed), and setup sync_on_green flag according to
@@ -5,7 +5,7 @@
Other authors: Other authors:
Mark Watson, Mark Watson,
Apsed, Apsed,
Rudolf Cornelissen 11/2002-2/2004 Rudolf Cornelissen 11/2002-11/2005
*/ */
#define MODULE_BIT 0x00200000 #define MODULE_BIT 0x00200000
@@ -20,11 +20,14 @@ static void interrupt_enable(bool flag) {
status_t result; status_t result;
gx00_set_bool_state sbs; gx00_set_bool_state sbs;
/* set the magic number so the driver knows we're for real */ if (si->ps.int_assigned)
sbs.magic = GX00_PRIVATE_DATA_MAGIC; {
sbs.do_it = flag; /* set the magic number so the driver knows we're for real */
/* contact driver and get a pointer to the registers and shared data */ sbs.magic = GX00_PRIVATE_DATA_MAGIC;
result = ioctl(fd, GX00_RUN_INTERRUPTS, &sbs, sizeof(sbs)); sbs.do_it = flag;
/* contact driver and get a pointer to the registers and shared data */
result = ioctl(fd, GX00_RUN_INTERRUPTS, &sbs, sizeof(sbs));
}
} }
/* First validate the mode, then call lots of bit banging stuff to set the mode(s)! */ /* First validate the mode, then call lots of bit banging stuff to set the mode(s)! */
@@ -63,18 +66,6 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
/* See BOUNDS WARNING above... */ /* See BOUNDS WARNING above... */
if (PROPOSE_DISPLAY_MODE(&target, &target, &target) == B_ERROR) return B_ERROR; if (PROPOSE_DISPLAY_MODE(&target, &target, &target) == B_ERROR) return B_ERROR;
/* if not dualhead capable card clear dualhead flags */
if (!(target.flags & DUALHEAD_CAPABLE))
{
target.flags &= ~DUALHEAD_BITS;
}
/* if not TVout capable card clear TVout flags */
if (!(target.flags & TV_CAPABLE))
{
target.flags &= ~TV_BITS;
}
LOG(1, ("SETMODE: (CONT.) validated command modeflags: $%08x\n", target.flags));
/* overlay engine, cursor and MOVE_DISPLAY need to know the status even when /* overlay engine, cursor and MOVE_DISPLAY need to know the status even when
* in singlehead mode */ * in singlehead mode */
si->switched_crtcs = false; si->switched_crtcs = false;
@@ -1,7 +1,7 @@
/* Authors: /* Authors:
Mark Watson 12/1999, Mark Watson 12/1999,
Apsed, Apsed,
Rudolf Cornelissen 10/2002-3/2004 Rudolf Cornelissen 10/2002-11/2005
*/ */
#define MODULE_BIT 0x00008000 #define MODULE_BIT 0x00008000
@@ -54,7 +54,13 @@ status_t gx00_general_powerup()
status_t status; status_t status;
uint32 card_class; uint32 card_class;
LOG(1,("POWERUP: Haiku Matrox Accelerant 0.23 running.\n")); LOG(1,("POWERUP: Haiku Matrox Accelerant 0.24 running.\n"));
/* log VBLANK INT usability status */
if (si->ps.int_assigned)
LOG(4,("POWERUP: Usable INT assigned to HW; Vblank semaphore enabled\n"));
else
LOG(4,("POWERUP: No (usable) INT assigned to HW; Vblank semaphore disabled\n"));
/* detect card type and power it up */ /* detect card type and power it up */
switch(CFGR(DEVID)) switch(CFGR(DEVID))