accelerant.h revision 91f895d27453d2a92c6489a0c6b20021bf5f298d
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/* $Id$ */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/** @file
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * VBoxVideo Accelerant; Haiku Guest Additions, header.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Copyright (C) 2012 Oracle Corporation
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync *
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * available from http://www.virtualbox.org. This file is free software;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * you can redistribute it and/or modify it under the terms of the GNU
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * General Public License (GPL) as published by the Free Software
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * This code is based on:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync *
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * VirtualBox Guest Additions for Haiku.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Copyright (c) 2011 Mike Smith <mike@scgtrp.net>
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Fran�ois Revol <revol@free.fr>
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync *
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Permission is hereby granted, free of charge, to any person
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * obtaining a copy of this software and associated documentation
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * files (the "Software"), to deal in the Software without
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * restriction, including without limitation the rights to use,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * copy, modify, merge, publish, distribute, sublicense, and/or sell
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * copies of the Software, and to permit persons to whom the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Software is furnished to do so, subject to the following
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * conditions:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync *
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * The above copyright notice and this permission notice shall be
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * included in all copies or substantial portions of the Software.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync *
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * OTHER DEALINGS IN THE SOFTWARE.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#ifndef ___VBOX_ACCELERANT_H
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define ___VBOX_ACCELERANT_H
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#include <Accelerant.h>
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#include "../common/VBoxVideo_common.h"
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstruct AccelerantInfo
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync{
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /** @todo doxygen document these fields */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync int deviceFD;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync bool isClone;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync SharedInfo *sharedInfo;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync area_id sharedInfoArea;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync};
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncextern AccelerantInfo gInfo;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/* General */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_init_accelerant(int fd);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncssize_t vboxvideo_accelerant_clone_info_size(void);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_get_accelerant_clone_info(void *data);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_clone_accelerant(void *data);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_uninit_accelerant(void);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_accelerant_device_info(accelerant_device_info *adi);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncsem_id vboxvideo_accelerant_retrace_semaphore(void);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/* Modes & constraints */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncuint32 vboxvideo_accelerant_mode_count(void);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_mode_list(display_mode *dm);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_set_display_mode(display_mode *modeToSet);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_display_mode(display_mode *currentMode);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_edid_info(void *info, size_t size, uint32 *_version);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_frame_buffer_config(frame_buffer_config *config);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_pixel_clock_limits(display_mode *dm, uint32 *low, uint32 *high);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/* Cursor */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_set_cursor_shape(uint16 width, uint16 height, uint16 hotX, uint16 hotY, uint8 *andMask, uint8 *xorMask);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_move_cursor(uint16 x, uint16 y);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_show_cursor(bool is_visible);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/* Accelerant engine */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncuint32 vboxvideo_accelerant_engine_count(void);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_acquire_engine(uint32 capabilities, uint32 maxWait, sync_token *st, engine_token **et);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_release_engine(engine_token *et, sync_token *st);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_wait_engine_idle(void);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_get_sync_token(engine_token *et, sync_token *st);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncstatus_t vboxvideo_sync_to_token(sync_token *st);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/* 2D acceleration */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_screen_to_screen_blit(engine_token *et, blit_params *list, uint32 count);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_fill_rectangle(engine_token *et, uint32 color, fill_rect_params *list, uint32 count);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_invert_rectangle(engine_token *et, fill_rect_params *list, uint32 count);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncvoid vboxvideo_fill_span(engine_token *et, uint32 color, uint16 *list, uint32 count);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#endif /* ___VBOX_ACCELERANT_H */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync