SOLUTION: How do I disable the hardware cursor on a Sun GX framebuffer?

From: Alvis D. Harding Jr. (adh@news.ach.uams.edu)
Date: Sun Sep 18 1994 - 16:52:33 CDT


After a little poking around I figured out how to do it. Instead of using the
fbio ioctl routines, I opted for the Visual I/O routines. Should work the
same for either set. I've included a function that will turn off/on the
hardware cursor. This appears to work under Solaris 2.3 on a GX and a
Tech Source GXTRA/2 card.

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/visual_io.h"

#define FRAMEBUFFER_NAME "/dev/fb"
#define CURSOR_OFF 0
#define CURSOR_ON 1

int modifyCursor( char *device, int state )
{ int fd;
  struct vis_cursor cursor;

  if ((fd = open( device, O_RDWR )) < 0)
    { perror( "modifyCursor( ): open" );
      return( 1 );
    }

  cursor.set = VIS_CURSOR_SETCURSOR;
  cursor.enable = state; /* 0 = off, 1 = on */

  if (ioctl( fd, VIS_SETCURSOR, &cursor ) < 0)
    { perror( "modifyCursor( ): VIS_SETCURSOR" );
      close( fd );
      return( 1 );
    }

  close( fd );

  return( 0 );

} /* end modifyCursor( ) */

Usage:
modifyCursor( FRAMEBUFFER_NAME, CURSOR_OFF );
or
modifyCursor( FRAMEBUFFER_NAME, CURSOR_ON );

-- 
---                                                                         ---
----                                                                       ----
-----                                                                     -----
Alvis Harding Jr.                                  Arkansas Children's Hospital
adh@george.ach.uams.edu                                  Cardiac Imaging Center
                                                               800 Marshall St.
Voice - (501) 320-3613                                   Little Rock, AR  72202



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:10 CDT