1117N/A/*
1368N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1117N/A *
1117N/A * Permission is hereby granted, free of charge, to any person obtaining a
1117N/A * copy of this software and associated documentation files (the "Software"),
1117N/A * to deal in the Software without restriction, including without limitation
1117N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1117N/A * and/or sell copies of the Software, and to permit persons to whom the
1117N/A * Software is furnished to do so, subject to the following conditions:
1117N/A *
1117N/A * The above copyright notice and this permission notice (including the next
1117N/A * paragraph) shall be included in all copies or substantial portions of the
1117N/A * Software.
1117N/A *
1117N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1117N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1117N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1117N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1117N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1117N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1117N/A * DEALINGS IN THE SOFTWARE.
1117N/A */
1117N/A
1117N/A#ifndef _LIBVTSSUNWEFB_H
1117N/A#define _LIBVTSSUNWEFB_H
1117N/A
1368N/A#include <sys/types.h>
1368N/A#include <sys/param.h> /* MAXPATHLEN */
1368N/A#include <errno.h>
1368N/A#include <memory.h>
1368N/A#include <signal.h>
1368N/A#include <stdio.h>
1368N/A#include <stdlib.h>
1368N/A#include <string.h>
1368N/A#include <unistd.h>
1368N/A#include <setjmp.h>
1368N/A#include <stropts.h> /* ioctl() */
1368N/A#include <sys/fbio.h>
1368N/A#include <sys/mman.h>
1368N/A#include <sys/systeminfo.h> /* sysinfo() */
1368N/A#include <sys/pci.h>
1368N/A#include <sys/time.h>
1368N/A#include <sys/visual_io.h>
1368N/A#include <X11/Xmd.h>
1368N/A#include <X11/Xlib.h>
1368N/A#include <X11/Xutil.h>
1368N/A#include <X11/extensions/dpms.h>
1117N/A#include "libvtsSUNWxfb.h" /* Common VTS library definitions */
1368N/A#undef Status
1368N/A#define Status pciStatus
1368N/A#include "gfx_common.h"
1368N/A#undef Status
1368N/A#define Status int
1368N/A#include "graphicstest.h"
1368N/A#include "gfx_vts.h"
1117N/A
1368N/Atypedef struct efb_info {
1368N/A char const *efb_name;
1368N/A int efb_fd;
1368N/A uint16_t efb_vendor;
1368N/A uint16_t efb_device;
1368N/A uint_t efb_width;
1368N/A uint_t efb_height;
1368N/A uint_t efb_depth;
1368N/A uint_t efb_pixelsize;
1368N/A uint_t efb_linesize;
1368N/A offset_t efb_fb_addr;
1368N/A size_t efb_fb_size;
1368N/A uchar_t *efb_fb_ptr;
1368N/A offset_t efb_mmio_addr;
1368N/A size_t efb_mmio_size;
1368N/A uchar_t *efb_mmio_ptr;
1368N/A int efb_palet_changed;
1368N/A uint32_t efb_palet[256];
1368N/A } efb_info_t;
1117N/A
1368N/Atypedef struct efb_xw_struct {
1368N/A sigset_t xw_procmask;
1368N/A sigjmp_buf xw_sigjmpbuf;
1368N/A char const *xw_dispname;
1368N/A Display *xw_display;
1368N/A int xw_screen;
1368N/A Window xw_window;
1368N/A Cursor xw_cursor;
1368N/A Bool xw_grab_server;
1368N/A Bool xw_grab_keyboard;
1368N/A Bool xw_grab_pointer;
1368N/A Bool xw_ss_saved;
1368N/A Bool xw_ss_disabled;
1368N/A int xw_ss_timeout;
1368N/A int xw_ss_interval;
1368N/A int xw_ss_prefer_blanking;
1368N/A int xw_ss_allow_exposures;
1368N/A Status xw_dpms_saved;
1368N/A CARD16 xw_dpms_power;
1368N/A BOOL xw_dpms_state;
1368N/A Bool xw_dpms_disabled;
1368N/A } efb_xw_t;
1368N/A
1368N/A#ifdef __cplusplus
1368N/Aextern "C" {
1368N/A#endif
1368N/A
1368N/A/* chip.c */
1368N/A
1368N/Aextern return_packet *efb_test_chip(
1368N/A int const fd);
1368N/A
1368N/Aextern int chip_test(
1368N/A return_packet *const rp,
1368N/A int const fd);
1368N/A
1368N/Aextern int draw_lines(
1368N/A uint_t const width,
1368N/A uint_t const height);
1368N/A
1368N/Aextern int draw_cascaded_box(
1368N/A uint_t const width,
1368N/A uint_t const height);
1368N/A
1368N/A/* mapper.c */
1117N/A
1368N/Aextern return_packet *efb_test_open(
1368N/A int const fd);
1368N/A
1368N/Aextern int map_me(
1368N/A return_packet *const rp,
1368N/A int const fd);
1368N/A
1368N/Aextern int efb_test_semaphore(
1368N/A return_packet *const rp,
1368N/A int const test);
1368N/A
1368N/A/* memory.c */
1368N/A
1368N/Aextern return_packet *efb_test_memory(
1368N/A int const fd);
1368N/A
1368N/Aextern int memory_test(
1368N/A return_packet *const rp,
1368N/A int const fd);
1368N/A
1368N/Aextern void check_plane(
1368N/A int const num_planes,
1368N/A int const access_mode,
1368N/A int const fb_pitch,
1368N/A int const fb_height,
1368N/A int const fb_width,
1368N/A int const bytepp,
1368N/A caddr_t const base);
1368N/A
1368N/Aextern void init_data(
1368N/A int const num_planes);
1368N/A
1368N/Aextern uint_t test_data(
1368N/A void);
1368N/A
1368N/Aextern boolean_t write_read(
1368N/A int const xoff,
1368N/A int const yoff,
1368N/A boolean_t const complement,
1368N/A int const access_mode,
1368N/A boolean_t const pass,
1368N/A int const fb_pitch,
1368N/A int const bytepp,
1368N/A caddr_t const base);
1368N/A
1368N/A/* tools.c */
1117N/A
1368N/Aextern int efb_map_mem(
1368N/A return_packet *const rp,
1368N/A int const test);
1368N/A
1368N/Aextern int efb_get_pci_info(
1368N/A void);
1368N/A
1368N/Aextern int efb_map_mmio(
1368N/A void);
1368N/A
1368N/Aextern int efb_map_fb(
1368N/A void);
1368N/A
1368N/Aextern int efb_init_info(
1368N/A return_packet *const rp,
1368N/A int const test);
1368N/A
1368N/Aextern int efb_unmap_mem(
1368N/A return_packet *const rp,
1368N/A int const test);
1368N/A
1368N/Aextern int efb_unmap_fb(
1368N/A void);
1368N/A
1368N/Aextern int efb_unmap_mmio(
1368N/A void);
1368N/A
1368N/Aextern int efb_init_graphics(
1368N/A void);
1368N/A
1368N/Aextern void efb_save_palet(
1368N/A void);
1368N/A
1368N/Aextern int efb_set_palet(
1368N/A void);
1117N/A
1368N/Aextern int efb_restore_palet(
1368N/A void);
1368N/A
1368N/Aextern uint_t efb_color(
1368N/A uint_t const red,
1368N/A uint_t const green,
1368N/A uint_t const blue);
1368N/A
1368N/Aextern int efb_fill_solid_rect(
1368N/A uint_t const x1,
1368N/A uint_t const y1,
1368N/A uint_t const x2,
1368N/A uint_t const y2,
1368N/A uint_t const fg);
1368N/A
1368N/Aextern int efb_draw_solid_line(
1368N/A uint_t const x1,
1368N/A uint_t const y1,
1368N/A uint_t const x2,
1368N/A uint_t const y2,
1368N/A uint_t const fg);
1368N/A
1368N/Aextern int efb_flush_pixel_cache(
1368N/A void);
1368N/A
1368N/Aextern void efb_reset_engine(
1368N/A void);
1368N/A
1368N/Aextern int efb_wait_fifo(
1368N/A int const c);
1368N/A
1368N/Aextern int efb_wait_idle(
1368N/A void);
1368N/A
1368N/A/* libvtsSUNWefb.c */
1368N/A
1368N/Aextern efb_info_t efb_info;
1117N/A
1368N/Aextern efb_xw_t efb_xw;
1368N/A
1368N/Aextern void efb_block_signals(
1368N/A void);
1368N/A
1368N/Aextern void efb_restore_signals(
1368N/A void);
1368N/A
1368N/Aextern int efb_lock_display(
1368N/A void);
1368N/A
1368N/Aextern int efb_unlock_display(
1368N/A void);
1368N/A
1368N/Aextern int efb_open_display(
1368N/A void);
1368N/A
1368N/Aextern int efb_create_cursor(
1368N/A void);
1368N/A
1368N/Aextern int efb_create_window(
1368N/A void);
1368N/A
1368N/Aextern int efb_grab_server(
1368N/A void);
1368N/A
1368N/Aextern int efb_ungrab_server(
1368N/A void);
1368N/A
1368N/Aextern int efb_grab_keyboard(
1368N/A void);
1368N/A
1368N/Aextern int efb_ungrab_keyboard(
1368N/A void);
1117N/A
1368N/Aextern int efb_grab_pointer(
1368N/A void);
1368N/A
1368N/Aextern int efb_ungrab_pointer(
1368N/A void);
1368N/A
1368N/Aextern int efb_disable_screensaver(
1368N/A void);
1368N/A
1368N/Aextern int efb_restore_screensaver(
1368N/A void);
1368N/A
1368N/Aextern int efb_disable_dpms(
1368N/A void);
1368N/A
1368N/Aextern int efb_restore_dpms(
1368N/A void);
1117N/A
1368N/Aextern int efb_sleep(
1368N/A uint_t const seconds);
1368N/A
1368N/Aextern void efb_signal_routine(
1368N/A int const signo);
1368N/A
1368N/Aextern int efb_check_for_interrupt(
1368N/A void);
1368N/A
1368N/Aextern void graphicstest_finish(
1368N/A int const flag);
1368N/A
1368N/A/* dma.c */
1368N/A
1368N/Aextern return_packet *efb_test_dma(
1368N/A int const fd);
1368N/A
1368N/A#ifdef __cplusplus
1368N/A}
1368N/A#endif
1117N/A
1117N/A#endif /* _LIBVTSSUNWEFB_H */
1117N/A
1117N/A/* End of libvtsSUNWefb.h */