mirror of
https://github.com/MiSTer-devel/Main_MiSTer.git
synced 2026-05-31 03:04:12 +00:00
* hdmi_cec * Improve HDMI CEC startup * hdmi_cec * Improve HDMI CEC startup * Use ADV7513 interrupt registers for CEC Set ADV7513 main 0xE1 to the CEC I2C map address, 0xE2 to 0x00 to power the CEC block, and 0xE3 |= 0x0E for CEC control setup. Keep HPD forced high through main 0xD6 = 0xC0 after the startup pulse, but clear main 0x94[7] so HPD does not drive the shared HDMI interrupt line. Clear main 0xA1[6] so the monitor-sense/video-active block stays powered; ADV7513 interrupt status registers 0x94-0x97 are only valid while that block is alive. Set main 0x95 = 0x07 to enable only CEC RX-ready interrupts, use main 0x97 to clear RX/TX interrupt latches, and clear 0x96/0x97 at init. Read CEC RX-ready from CEC map 0x49, keep CEC RX enabled with 0x4A = 0x08, release consumed RX slots through 0x4A, and remove fallback polling of RX length registers 0x25/0x37/0x48. Use main 0x97 bits for CEC TX done/retry/arbitration status, keep CEC TX disabled through 0x11 except while sending, and set the CEC clock divider 0x4E = 0x3D. Gate RX handling on fpga_get_hdmi_int() so normal CEC polling no longer performs DDC/CEC I2C reads unless the FPGA HDMI interrupt bit is asserted. Reply to CEC vendor/name discovery so displays can identify MiSTer after registration. --------- Co-authored-by: misteraddons <51079966+misteraddons@users.noreply.github.com>
82 lines
1.8 KiB
C
82 lines
1.8 KiB
C
#ifndef VIDEO_H
|
|
#define VIDEO_H
|
|
|
|
#define VFILTER_HORZ 0
|
|
#define VFILTER_VERT 1
|
|
#define VFILTER_SCAN 2
|
|
#define VFILTER_ILACE 3
|
|
|
|
struct VideoInfo
|
|
{
|
|
uint32_t width;
|
|
uint32_t height;
|
|
uint32_t htime;
|
|
uint32_t vtime;
|
|
uint32_t ptime;
|
|
uint32_t ctime;
|
|
uint32_t vtimeh;
|
|
uint32_t arx;
|
|
uint32_t ary;
|
|
uint32_t arxy;
|
|
uint32_t fb_en;
|
|
uint32_t fb_fmt;
|
|
uint32_t fb_width;
|
|
uint32_t fb_height;
|
|
uint32_t pixrep;
|
|
uint32_t de_h;
|
|
uint32_t de_v;
|
|
|
|
bool interlaced;
|
|
bool rotated;
|
|
};
|
|
|
|
// expose video timings for timerfd-based frame timer
|
|
extern VideoInfo current_video_info;
|
|
|
|
void video_init();
|
|
bool video_has_valid_edid();
|
|
bool video_reload_edid_mode();
|
|
|
|
int video_get_scaler_flt(int type);
|
|
void video_set_scaler_flt(int type, int n);
|
|
char* video_get_scaler_coeff(int type, int only_name = 1);
|
|
void video_set_scaler_coeff(int type, const char *name);
|
|
|
|
|
|
|
|
int video_get_gamma_en();
|
|
void video_set_gamma_en(int n);
|
|
char* video_get_gamma_curve(int only_name = 1);
|
|
void video_set_gamma_curve(const char *name);
|
|
|
|
int video_get_shadow_mask_mode();
|
|
void video_set_shadow_mask_mode(int n);
|
|
char* video_get_shadow_mask(int only_name = 1);
|
|
void video_set_shadow_mask(const char *name);
|
|
void video_loadPreset(char *name, bool save);
|
|
|
|
int video_get_rotated();
|
|
|
|
void video_cfg_reset();
|
|
|
|
void video_mode_adjust(bool force = false);
|
|
|
|
int hasAPI1_5();
|
|
|
|
void video_fb_enable(int enable, int n = 0);
|
|
int video_fb_state();
|
|
void video_menu_bg(int n, int idle = 0);
|
|
int video_bg_has_picture();
|
|
int video_chvt(int num);
|
|
void video_cmd(char *cmd);
|
|
void video_mode_cmd(char *cmd);
|
|
void video_hdmi_power(int on);
|
|
|
|
void video_core_description(char *str, size_t len);
|
|
void video_scaler_description(char *str, size_t len);
|
|
char* video_get_core_mode_name(int with_vrefresh = 1);
|
|
|
|
void dbg_draw_cursor(int x, int y);
|
|
|
|
#endif // VIDEO_H
|