xref: /haiku/src/add-ons/accelerants/neomagic/engine/nm_proto.h (revision 77680cef2a516c2ae69ec6cbf9c11e8c212da886)
1 /*general card functions*/
2 status_t mn_general_powerup();
3 status_t nm_set_cas_latency();
4 status_t nm_general_output_select();
5 uint8 nm_general_output_read();
6 status_t mn_general_dac_select(int);
7 status_t mn_general_wait_retrace();
8 status_t mn_general_validate_pic_size (display_mode *target, uint32 *bytes_per_row);
9 //status_t mn_general_bios_to_powergraphics();
10 
11 /* apsed: logging macros */
12 #define MSG(args) do { /* if needed or si->settings with si NULL */ \
13 	nm_log args; \
14 } while (0)
15 #define LOG(level_bit, args) do { \
16 	uint32 mod = (si->settings.logmask &  0xfffffff0) & MODULE_BIT; \
17 	uint32 lev = (si->settings.logmask & ~0xfffffff0) & level_bit; \
18 	if (mod && lev) nm_log args; \
19 } while (0)
20 
21 /*support functions*/
22 void delay(bigtime_t i);
23 void nm_log(char *format, ...);
24 
25 /*card info functions*/
26 void set_specs(void);
27 void dump_specs(void);
28 
29 /*DAC functions*/
30 status_t mn_dac_mode(int,float);
31 status_t mn_dac_palette(uint8*,uint8*,uint8*, uint16);
32 status_t mn_dac_pix_pll_find(display_mode target,float * result,uint8 *,uint8 *,uint8 *);
33 status_t mn_dac_set_pix_pll(display_mode target);
34 
35 /*CRTC1 functions*/
36 status_t mn_crtc_validate_timing(
37 	uint16 *hd_e,uint16 *hs_s,uint16 *hs_e,uint16 *ht,
38 	uint16 *vd_e,uint16 *vs_s,uint16 *vs_e,uint16 *vt
39 );
40 status_t mn_crtc_set_timing(display_mode target, bool crt_only);
41 status_t mn_crtc_depth(int mode);
42 status_t mn_crtc_set_display_start(uint32 startadd,uint8 bpp);
43 status_t mn_crtc_set_display_pitch();
44 status_t mn_crtc_center(display_mode target);
45 
46 status_t mn_crtc_dpms(bool, bool, bool);
47 status_t mn_crtc_dpms_fetch(bool*, bool*, bool*);
48 status_t mn_crtc_mem_priority(uint8);
49 
50 status_t mn_crtc_cursor_init(); /*Yes, cursor follows CRTC1 - not the DAC!*/
51 status_t mn_crtc_cursor_define(uint8*,uint8*);
52 status_t mn_crtc_cursor_position(uint16 x ,uint16 y);
53 status_t mn_crtc_cursor_show();
54 status_t mn_crtc_cursor_hide();
55 
56 /*acceleration functions*/
57 status_t check_acc_capability(uint32 feature);
58 status_t mn_acc_init();
59 status_t mn_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
60 status_t mn_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
61 status_t mn_acc_blit(uint16,uint16,uint16, uint16,uint16,uint16 );
62 status_t mn_acc_transparent_blit(uint16,uint16,uint16, uint16,uint16,uint16, uint32);
63 status_t mn_acc_video_blit(uint16 xs,uint16 ys,uint16 ws, uint16 hs,
64 	uint16 xd,uint16 yd,uint16 wd,uint16 hd);
65 status_t mn_acc_wait_idle();
66 
67 /*backend scaler functions*/
68 status_t check_overlay_capability(uint32 feature);
69 status_t mn_configure_bes
70 	(const overlay_buffer *ob, const overlay_window *ow,const overlay_view *ov, int offset);
71 status_t mn_release_bes();
72 
73 /*driver structures and enums*/
74 enum{BPP8=0,BPP15=1,BPP16=2,BPP24=3};
75 enum{DS_CRTC1DAC_CRTC2MAVEN, DS_CRTC1MAVEN_CRTC2DAC, DS_CRTC1CON1_CRTC2CON2, DS_CRTC1CON2_CRTC2CON1};
76