kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Pi Firmware: fixed some OSD consistentency issues if mode changes while OSD active
Change-Id: I82d6c1834159ad1947a3675825af32a143107a46issue_1022
rodzic
c29ec6171e
commit
b8e5239f99
53
src/osd.c
53
src/osd.c
|
@ -28,6 +28,17 @@ static char message[80];
|
|||
|
||||
static int active = 0;
|
||||
|
||||
enum {
|
||||
IDLE,
|
||||
MANUAL,
|
||||
FEATURE,
|
||||
};
|
||||
|
||||
|
||||
static int osd_state = IDLE;
|
||||
static int param_num = 0;
|
||||
static int feature_num = 0;
|
||||
|
||||
enum {
|
||||
PALETTE_DEFAULT,
|
||||
PALETTE_INVERSE,
|
||||
|
@ -203,14 +214,6 @@ int osd_active() {
|
|||
return active;
|
||||
}
|
||||
|
||||
|
||||
enum {
|
||||
IDLE,
|
||||
MANUAL,
|
||||
FEATURE,
|
||||
};
|
||||
|
||||
|
||||
static void delay() {
|
||||
for (volatile int i = 0; i < 100000000; i++);
|
||||
}
|
||||
|
@ -307,11 +310,27 @@ static void show_feature(int num) {
|
|||
}
|
||||
}
|
||||
|
||||
void osd_key(int key) {
|
||||
static int osd_state = IDLE;
|
||||
static int param_num = 0;
|
||||
static int feature_num = 0;
|
||||
|
||||
void osd_refresh() {
|
||||
switch (osd_state) {
|
||||
|
||||
case IDLE:
|
||||
osd_clear();
|
||||
break;
|
||||
|
||||
case MANUAL:
|
||||
osd_set(0, ATTR_DOUBLE_SIZE, "Manual Calibration");
|
||||
show_param(param_num);
|
||||
break;
|
||||
|
||||
case FEATURE:
|
||||
osd_set(0, ATTR_DOUBLE_SIZE, "Feature Selection");
|
||||
show_feature(feature_num);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void osd_key(int key) {
|
||||
int value;
|
||||
param_t *params = cpld->get_params();
|
||||
|
||||
|
@ -321,15 +340,13 @@ void osd_key(int key) {
|
|||
switch (key) {
|
||||
case OSD_SW1:
|
||||
// Manual Calibration
|
||||
osd_set(0, ATTR_DOUBLE_SIZE, "Manual Calibration");
|
||||
show_param(param_num);
|
||||
osd_state = MANUAL;
|
||||
osd_refresh();
|
||||
break;
|
||||
case OSD_SW2:
|
||||
// Feature Selection
|
||||
osd_set(0, ATTR_DOUBLE_SIZE, "Feature Selection");
|
||||
show_feature(feature_num);
|
||||
osd_state = FEATURE;
|
||||
osd_refresh();
|
||||
break;
|
||||
case OSD_SW3:
|
||||
// Auto Calibration
|
||||
|
@ -346,7 +363,7 @@ void osd_key(int key) {
|
|||
case OSD_SW1:
|
||||
// exit manual configuration
|
||||
osd_state = IDLE;
|
||||
osd_clear();
|
||||
osd_refresh();
|
||||
break;
|
||||
case OSD_SW2:
|
||||
// next param
|
||||
|
@ -375,7 +392,7 @@ void osd_key(int key) {
|
|||
case OSD_SW1:
|
||||
// exit feature selection
|
||||
osd_state = IDLE;
|
||||
osd_clear();
|
||||
osd_refresh();
|
||||
break;
|
||||
case OSD_SW2:
|
||||
// next feature
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
void osd_init();
|
||||
void osd_clear();
|
||||
void osd_set(int line, int attr, char *text);
|
||||
void osd_refresh();
|
||||
|
||||
void osd_update(uint32_t *osd_base, int bytes_per_line);
|
||||
void osd_update_fast(uint32_t *osd_base, int bytes_per_line);
|
||||
int osd_active();
|
||||
|
|
|
@ -481,7 +481,7 @@ measure_vsync:
|
|||
|
||||
clear_screen:
|
||||
ldr r11, param_framebuffer
|
||||
mov r7, #0
|
||||
ldr r8, =0x88888888
|
||||
#ifdef DOUBLE_BUFFER
|
||||
ldr r5, =SCREEN_HEIGHT * 2 // double the number of active lines
|
||||
#else
|
||||
|
@ -490,6 +490,8 @@ clear_screen:
|
|||
clear_loop1:
|
||||
mov r6, r2 // r2 is bytes per line
|
||||
clear_loop2:
|
||||
ldr r7, [r11]
|
||||
and r7, r8
|
||||
str r7, [r11], #4
|
||||
subs r6, r6, #4
|
||||
bne clear_loop2
|
||||
|
|
|
@ -749,6 +749,8 @@ void rgb_to_hdmi_main() {
|
|||
|
||||
clear = BIT_CLEAR;
|
||||
|
||||
osd_refresh();
|
||||
|
||||
do {
|
||||
|
||||
log_debug("Entering rgb_to_fb");
|
||||
|
@ -773,6 +775,8 @@ void rgb_to_hdmi_main() {
|
|||
mode7 = result & BIT_MODE7;
|
||||
|
||||
} while (mode7 == last_mode7);
|
||||
|
||||
osd_clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue