add nvidia accelerant
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5451 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
SubDir OBOS_TOP src add-ons accelerants nvidia ;
|
||||||
|
|
||||||
|
UsePrivateHeaders graphics ;
|
||||||
|
UsePrivateHeaders [ FDirName graphics nvidia ] ;
|
||||||
|
UseHeaders engine ;
|
||||||
|
|
||||||
|
|
||||||
|
Addon nv.accelerant : accelerants :
|
||||||
|
Acceleration.c
|
||||||
|
Cursor.c
|
||||||
|
EngineManagment.c
|
||||||
|
GetAccelerantHook.c
|
||||||
|
GetDeviceInfo.c
|
||||||
|
GetModeInfo.c
|
||||||
|
GetTimingConstraints.c
|
||||||
|
GlobalData.c
|
||||||
|
InitAccelerant.c
|
||||||
|
Overlay.c
|
||||||
|
ProposeDisplayMode.c
|
||||||
|
SetDisplayMode.c
|
||||||
|
: false : libnvidia_engine.a
|
||||||
|
;
|
||||||
|
|
||||||
|
SubInclude OBOS_TOP src add-ons accelerants nvidia engine ;
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
Copyright 1999, Be Incorporated. All Rights Reserved.
|
||||||
|
This file may be used under the terms of the Be Sample Code License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(GENERIC_H)
|
||||||
|
#define GENERIC_H
|
||||||
|
|
||||||
|
#include <Accelerant.h>
|
||||||
|
#include "video_overlay.h"
|
||||||
|
|
||||||
|
#define DEBUG 1
|
||||||
|
|
||||||
|
status_t INIT_ACCELERANT(int fd);
|
||||||
|
ssize_t ACCELERANT_CLONE_INFO_SIZE(void);
|
||||||
|
void GET_ACCELERANT_CLONE_INFO(void *data);
|
||||||
|
status_t CLONE_ACCELERANT(void *data);
|
||||||
|
void UNINIT_ACCELERANT(void);
|
||||||
|
status_t GET_ACCELERANT_DEVICE_INFO(accelerant_device_info *adi);
|
||||||
|
sem_id ACCELERANT_RETRACE_SEMAPHORE(void);
|
||||||
|
|
||||||
|
uint32 ACCELERANT_MODE_COUNT(void);
|
||||||
|
status_t GET_MODE_LIST(display_mode *dm);
|
||||||
|
status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, const display_mode *high);
|
||||||
|
status_t SET_DISPLAY_MODE(display_mode *mode_to_set);
|
||||||
|
status_t GET_DISPLAY_MODE(display_mode *current_mode);
|
||||||
|
status_t GET_FRAME_BUFFER_CONFIG(frame_buffer_config *a_frame_buffer);
|
||||||
|
status_t GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high);
|
||||||
|
status_t MOVE_DISPLAY(uint16 h_display_start, uint16 v_display_start);
|
||||||
|
status_t GET_TIMING_CONSTRAINTS(display_timing_constraints *dtc);
|
||||||
|
void SET_INDEXED_COLORS(uint count, uint8 first, uint8 *color_data, uint32 flags);
|
||||||
|
|
||||||
|
uint32 DPMS_CAPABILITIES(void);
|
||||||
|
uint32 DPMS_MODE(void);
|
||||||
|
status_t SET_DPMS_MODE(uint32 dpms_flags);
|
||||||
|
|
||||||
|
status_t SET_CURSOR_SHAPE(uint16 width, uint16 height, uint16 hot_x, uint16 hot_y, uint8 *andMask, uint8 *xorMask);
|
||||||
|
void MOVE_CURSOR(uint16 x, uint16 y);
|
||||||
|
void SHOW_CURSOR(bool is_visible);
|
||||||
|
|
||||||
|
uint32 ACCELERANT_ENGINE_COUNT(void);
|
||||||
|
status_t ACQUIRE_ENGINE(uint32 capabilities, uint32 max_wait, sync_token *st, engine_token **et);
|
||||||
|
status_t RELEASE_ENGINE(engine_token *et, sync_token *st);
|
||||||
|
void WAIT_ENGINE_IDLE(void);
|
||||||
|
status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st);
|
||||||
|
status_t SYNC_TO_TOKEN(sync_token *st);
|
||||||
|
|
||||||
|
void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count);
|
||||||
|
void SCREEN_TO_SCREEN_TRANSPARENT_BLIT(engine_token *et, uint32 transparent_colour, blit_params *list, uint32 count);
|
||||||
|
void FILL_RECTANGLE(engine_token *et, uint32 color, fill_rect_params *list, uint32 count);
|
||||||
|
void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count);
|
||||||
|
|
||||||
|
void FILL_SPAN(engine_token *et, uint32 color, uint16 *list, uint32 count);
|
||||||
|
|
||||||
|
/* video_overlay */
|
||||||
|
uint32 OVERLAY_COUNT(const display_mode *dm);
|
||||||
|
const uint32 *OVERLAY_SUPPORTED_SPACES(const display_mode *dm);
|
||||||
|
uint32 OVERLAY_SUPPORTED_FEATURES(uint32 a_color_space);
|
||||||
|
const overlay_buffer *ALLOCATE_OVERLAY_BUFFER(color_space cs, uint16 width, uint16 height);
|
||||||
|
status_t RELEASE_OVERLAY_BUFFER(const overlay_buffer *ob);
|
||||||
|
status_t GET_OVERLAY_CONSTRAINTS(const display_mode *dm, const overlay_buffer *ob, overlay_constraints *oc);
|
||||||
|
overlay_token ALLOCATE_OVERLAY(void);
|
||||||
|
status_t RELEASE_OVERLAY(overlay_token ot);
|
||||||
|
status_t CONFIGURE_OVERLAY(overlay_token ot, const overlay_buffer *ob, const overlay_window *ow, const overlay_view *ov);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
SubDir OBOS_TOP src add-ons accelerants nvidia engine ;
|
||||||
|
|
||||||
|
UsePrivateHeaders graphics ;
|
||||||
|
UsePrivateHeaders [ FDirName graphics nvidia ] ;
|
||||||
|
UseHeaders [ FDirName $(SUBDIR) .. ] ;
|
||||||
|
|
||||||
|
StaticLibrary nvidia_engine :
|
||||||
|
nv_acc.c
|
||||||
|
nv_bes.c
|
||||||
|
nv_crtc.c
|
||||||
|
nv_crtc2.c
|
||||||
|
nv_dac.c
|
||||||
|
nv_general.c
|
||||||
|
nv_i2c.c
|
||||||
|
nv_info.c
|
||||||
|
nv_maven.c
|
||||||
|
nv_maventv.c
|
||||||
|
nv_support.c
|
||||||
|
;
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
/*general card functions*/
|
||||||
|
status_t nv_general_powerup();
|
||||||
|
status_t nv_set_cas_latency();
|
||||||
|
status_t gx50_general_output_select();
|
||||||
|
status_t nv_general_dac_select(int);
|
||||||
|
status_t nv_general_wait_retrace();
|
||||||
|
status_t nv_general_validate_pic_size (display_mode *target, uint32 *bytes_per_row);
|
||||||
|
//status_t nv_general_bios_to_powergraphics();
|
||||||
|
|
||||||
|
/* apsed: logging macros */
|
||||||
|
#define MSG(args) do { /* if needed or si->settings with si NULL */ \
|
||||||
|
nv_log args; \
|
||||||
|
} while (0)
|
||||||
|
#define LOG(level_bit, args) do { \
|
||||||
|
uint32 mod = (si->settings.logmask & 0xfffffff0) & MODULE_BIT; \
|
||||||
|
uint32 lev = (si->settings.logmask & ~0xfffffff0) & level_bit; \
|
||||||
|
if (mod && lev) nv_log args; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/*support functions*/
|
||||||
|
void delay(bigtime_t i);
|
||||||
|
void nv_log(char *format, ...);
|
||||||
|
|
||||||
|
/*i2c maven functions*/
|
||||||
|
int i2c_maven_read(unsigned char address);
|
||||||
|
void i2c_maven_write(unsigned char address, unsigned char data);
|
||||||
|
status_t i2c_init(void);
|
||||||
|
status_t i2c_maven_probe(void);
|
||||||
|
|
||||||
|
|
||||||
|
/*card info functions*/
|
||||||
|
status_t parse_pins(void);
|
||||||
|
status_t pins5_read(uint8 *pins, uint8 length);
|
||||||
|
void fake_pins(void);
|
||||||
|
void pinsnv4_fake(void);
|
||||||
|
void pinsnv5_nv5m64_fake(void);
|
||||||
|
void pinsnv6_fake(void);
|
||||||
|
void pinsnv10_arch_fake(void);
|
||||||
|
void pinsnv20_arch_fake(void);
|
||||||
|
void pinsnv30_arch_fake(void);
|
||||||
|
void getstrap_arch_nv4(void);
|
||||||
|
void getstrap_arch_nv10_20(void);
|
||||||
|
void dump_pins(void);
|
||||||
|
|
||||||
|
/*DAC functions*/
|
||||||
|
status_t nv_dac_mode(int,float);
|
||||||
|
status_t nv_dac_palette(uint8*,uint8*,uint8*);
|
||||||
|
|
||||||
|
status_t nv_dac_pix_pll_find(display_mode target,float * result,uint8 *,uint8 *,uint8 *, uint8);
|
||||||
|
status_t nv_dac_set_pix_pll(display_mode target);
|
||||||
|
|
||||||
|
status_t g400_dac_set_sys_pll();
|
||||||
|
|
||||||
|
/*MAVEN functions*/
|
||||||
|
status_t nv_maven_dpms(uint8, uint8, uint8);
|
||||||
|
status_t nv_maven_set_timing(display_mode target);
|
||||||
|
status_t nv_maven_mode(int,float);
|
||||||
|
|
||||||
|
status_t g100_g400max_maven_vid_pll_find(display_mode target,float * calc_pclk,
|
||||||
|
uint8 * m_result,uint8 * n_result,uint8 * p_result);
|
||||||
|
status_t nv_maven_set_vid_pll(display_mode target);
|
||||||
|
|
||||||
|
/*MAVENTV functions*/
|
||||||
|
status_t g100_g400max_maventv_vid_pll_find(
|
||||||
|
display_mode target, unsigned int * ht_new, unsigned int * ht_last_line,
|
||||||
|
uint8 * m_result, uint8 * n_result, uint8 * p_result);
|
||||||
|
int maventv_init(display_mode target);
|
||||||
|
|
||||||
|
/*CRTC1 functions*/
|
||||||
|
status_t nv_crtc_validate_timing(
|
||||||
|
uint16 *hd_e,uint16 *hs_s,uint16 *hs_e,uint16 *ht,
|
||||||
|
uint16 *vd_e,uint16 *vs_s,uint16 *vs_e,uint16 *vt
|
||||||
|
);
|
||||||
|
status_t nv_crtc_set_timing(display_mode target);
|
||||||
|
status_t nv_crtc_depth(int mode);
|
||||||
|
status_t nv_crtc_set_display_start(uint32 startadd,uint8 bpp);
|
||||||
|
status_t nv_crtc_set_display_pitch();
|
||||||
|
|
||||||
|
status_t nv_crtc_dpms(bool, bool, bool);
|
||||||
|
status_t nv_crtc_dpms_fetch(bool*, bool*, bool*);
|
||||||
|
status_t nv_crtc_mem_priority(uint8);
|
||||||
|
|
||||||
|
status_t nv_crtc_cursor_init(); /*Yes, cursor follows CRTC1 - not the DAC!*/
|
||||||
|
status_t nv_crtc_cursor_define(uint8*,uint8*);
|
||||||
|
status_t nv_crtc_cursor_position(uint16 x ,uint16 y);
|
||||||
|
status_t nv_crtc_cursor_show();
|
||||||
|
status_t nv_crtc_cursor_hide();
|
||||||
|
|
||||||
|
/*CRTC2 functions*/
|
||||||
|
/*XXX - validate_timing*/
|
||||||
|
status_t g400_crtc2_set_timing(display_mode target);
|
||||||
|
status_t g400_crtc2_depth(int mode);
|
||||||
|
status_t g400_crtc2_set_display_pitch();
|
||||||
|
status_t g400_crtc2_set_display_start(uint32 startadd,uint8 bpp);
|
||||||
|
|
||||||
|
status_t g400_crtc2_dpms(uint8 display,uint8 h,uint8 v);
|
||||||
|
status_t g400_crtc2_dpms_fetch(uint8 * display,uint8 * h,uint8 * v);
|
||||||
|
|
||||||
|
/*acceleration functions*/
|
||||||
|
status_t check_acc_capability(uint32 feature);
|
||||||
|
status_t nv_acc_init();
|
||||||
|
status_t nv_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
|
||||||
|
status_t nv_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
|
||||||
|
status_t nv_acc_blit(uint16,uint16,uint16, uint16,uint16,uint16 );
|
||||||
|
status_t nv_acc_transparent_blit(uint16,uint16,uint16, uint16,uint16,uint16, uint32);
|
||||||
|
status_t nv_acc_video_blit(uint16 xs,uint16 ys,uint16 ws, uint16 hs,
|
||||||
|
uint16 xd,uint16 yd,uint16 wd,uint16 hd);
|
||||||
|
status_t nv_acc_wait_idle();
|
||||||
|
|
||||||
|
/*backend scaler functions*/
|
||||||
|
status_t check_overlay_capability(uint32 feature);
|
||||||
|
status_t nv_configure_bes
|
||||||
|
(const overlay_buffer *ob, const overlay_window *ow,const overlay_view *ov, int offset);
|
||||||
|
status_t nv_release_bes();
|
||||||
|
|
||||||
|
/* I2C functions */
|
||||||
|
status_t i2c_sec_tv_adapter();
|
||||||
|
|
||||||
|
/*driver structures and enums*/
|
||||||
|
enum{BPP8=0,BPP15=1,BPP16=2,BPP24=3,BPP32DIR=4,BPP32=7};
|
||||||
|
enum{DS_CRTC1DAC_CRTC2MAVEN, DS_CRTC1MAVEN_CRTC2DAC, DS_CRTC1CON1_CRTC2CON2, DS_CRTC1CON2_CRTC2CON1};
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
extern int fd;
|
||||||
|
extern shared_info *si;
|
||||||
|
extern area_id shared_info_area;
|
||||||
|
extern area_id regs_area;
|
||||||
|
extern vuint32 *regs;
|
||||||
|
extern display_mode *my_mode_list;
|
||||||
|
extern area_id my_mode_list_area;
|
||||||
|
extern int accelerantIsClone;
|
||||||
|
|
||||||
|
extern nv_get_set_pci nv_pci_access;
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*This file can be used to define custom timing for your monitor
|
||||||
|
* The format of each line is:
|
||||||
|
* {
|
||||||
|
* pixel clock frequency (kHz)
|
||||||
|
* width
|
||||||
|
* h-sync pulse start
|
||||||
|
* h-sync pulse end
|
||||||
|
* total pixels in line
|
||||||
|
* height
|
||||||
|
* v-sync pulse start
|
||||||
|
* v-sync pulse end
|
||||||
|
* total lines in frame
|
||||||
|
* sync polarity (0 is -ve,B_POSITIVE_HYSNC,B_POSITIVE_VSYNC)
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
*To use this you must:
|
||||||
|
* Uncomment VALID MODE REQUIRED
|
||||||
|
* Fill in a number of modes that work with your display
|
||||||
|
* Change VALID MODES from three to the no. you defined
|
||||||
|
* run these commands:
|
||||||
|
* touch ProposeDisplayMode.c
|
||||||
|
* make install
|
||||||
|
*/
|
||||||
|
|
||||||
|
//#define VALID_MODE_REQUIRED 1
|
||||||
|
|
||||||
|
#define VALID_MODES 3
|
||||||
|
|
||||||
|
/*note colour depth and mode flags are ignored*/
|
||||||
|
static const display_timing valid_mode_list[] = {
|
||||||
|
{31500,640,648,744,840,480,481,500,500,0},
|
||||||
|
{49500,800,808,888,1056,600,601,620,625,B_POSITIVE_HSYNC|B_POSITIVE_VSYNC},
|
||||||
|
{78750,1024,1032,1128,1312,768,769,788,800,B_POSITIVE_HSYNC|B_POSITIVE_VSYNC}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user