Skip to content

Commit 378965c

Browse files
Taos: properly handle color mode changes.
1 parent 40b5377 commit 378965c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

devices/video/taos.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ void TaosVideo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int s
120120
this->row_words = value;
121121
break;
122122
case COLOR_MODE:
123-
this->color_mode = value;
123+
if (this->color_mode != value) {
124+
this->color_mode = value;
125+
enable_display();
126+
}
124127
break;
125128
case VIDEO_MODE:
126129
this->video_mode = value >> 30;
@@ -129,6 +132,8 @@ void TaosVideo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int s
129132
if (bit_changed(this->crt_ctrl, value, ENABLE_VIDEO_OUT)) {
130133
if (bit_set(value, ENABLE_VIDEO_OUT))
131134
enable_display();
135+
else
136+
disable_display();
132137
}
133138
this->crt_ctrl = value;
134139
break;
@@ -218,7 +223,15 @@ void TaosVideo::enable_display() {
218223
this->start_refresh_task();
219224

220225
this->blank_on = false;
221-
this->crtc_on = true;
226+
this->crtc_on = true;
227+
}
228+
229+
void TaosVideo::disable_display() {
230+
this->stop_refresh_task();
231+
this->blank_display();
232+
233+
this->blank_on = true;
234+
this->crtc_on = false;
222235
}
223236

224237
void TaosVideo::convert_frame_15bpp_indexed(uint8_t *dst_buf, int dst_pitch) {

devices/video/taos.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class TaosVideo : public VideoCtrlBase, public MMIODevice {
174174

175175
private:
176176
void enable_display();
177+
void disable_display();
177178
void convert_frame_15bpp_indexed(uint8_t *dst_buf, int dst_pitch);
178179

179180
std::unique_ptr<AthensClocks> clk_gen = nullptr;

0 commit comments

Comments
 (0)