Skip to contentSkip to conversation

"console: Properly switch consoles for screen dumps" breaks qxl screen dump

Qemu-devel Alon Levy 3 participants 4 messages Oct 11, 2011

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

Hi Jan,

I've recently found the $SUBJECT, it's commit
f81bdefb63243e82d16ce49332f7cf74d10b8f27.

I'd like to fix it without breaking anything, can you provide me with the test that your original patch fixed?

Alon

p.s. for a simple command line with a single console (not even sure how to get multiple) the following fixes my problem, I expect it doesn't introduce any problems?

console.c +4 -0
index 6dfcc47..5a709fe 100644
@@ -1067,6 +1067,10 @@ void console_select(unsigned int index)
 
     if (index >= MAX_CONSOLES)
         return;
+    if (active_console == consoles[index]) {
+        fprintf(stderr, "not changing console, not required\n");
+        return;
+    }
     if (active_console) {
         active_console->g_width = ds_get_width(active_console->ds);
         active_console->g_height = ds_get_height(active_console->ds);
#1 lore raw
Quoted 7 lines · Alon Levy

Hi Jan,

I've recently found the $SUBJECT, it's commit
f81bdefb63243e82d16ce49332f7cf74d10b8f27.

I'd like to fix it without breaking anything, can you provide me with the test that your original patch fixed?

Have monitor on virtual console, switch to monitor and trigger screen dump. So far that caused the to be dumped screen been written to the monitor console, the console was furthermore resized, but all that mess was left behind once dumping was finished. No we switch to the graphic console first and restore the monitor afterwards.

Quoted 13 lines

Alon

p.s. for a simple command line with a single console (not even sure how to get multiple) the following fixes my problem, I expect it doesn't introduce any problems?

console.c +0 -0
index 6dfcc47..5a709fe 100644

console.c void console_select(unsigned int index) · line 1076

Quoted 10 lines
console.c +4 -0
@@ -1067,6 +1067,10 @@ void console_select(unsigned int index)
 
     if (index >= MAX_CONSOLES)
         return;
+    if (active_console == consoles[index]) {
+        fprintf(stderr, "not changing console, not required\n");
+        return;
+    }
     if (active_console) {
         active_console->g_width = ds_get_width(active_console->ds);
         active_console->g_height = ds_get_height(active_console->ds);

I suspect this papers over some QXL bug. SDL has no issues when I trigger the screen dump from a monitor console that requires no switching.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
author
#2 lore raw
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Alon Levy

Hi Jan,

I've recently found the $SUBJECT, it's commit
f81bdefb63243e82d16ce49332f7cf74d10b8f27.

Quoted 8 lines
Quoted 2 lines

I'd like to fix it without breaking anything, can you provide me with the test that your original patch fixed?

Have monitor on virtual console, switch to monitor and trigger screen dump. So far that caused the to be dumped screen been written to the monitor console, the console was furthermore resized, but all that mess was left behind once dumping was finished. No we switch to the graphic console first and restore the monitor afterwards.

I don't follow. Can you provide a qemu command line? how do I run the monitor on a virtual console?

Quoted 15 lines
Quoted 15 lines

Alon

p.s. for a simple command line with a single console (not even sure how to get multiple) the following fixes my problem, I expect it doesn't introduce any problems?

console.c +0 -0
index 6dfcc47..5a709fe 100644
@@ -1067,6 +1067,10 @@ void console_select(unsigned int index)
 
Quoted 12 lines

console.c void console_select(unsigned int index) · line 1076

Quoted 9 lines
console.c +4 -0
     if (index >= MAX_CONSOLES)
         return;
+    if (active_console == consoles[index]) {
+        fprintf(stderr, "not changing console, not required\n");
+        return;
+    }
     if (active_console) {
         active_console->g_width = ds_get_width(active_console->ds);
         active_console->g_height = ds_get_height(active_console->ds);

I suspect this papers over some QXL bug. SDL has no issues when I trigger the screen dump from a monitor console that requires no switching.

You are absolutely right. So far I haven't managed to find the exact bug (I have been looking without applying this patch). So I've sent this patch anyway. the rest of console_select reallocates the surface, which is not terrible (this isn't high frequency) but still redundant.

Quoted 6 lines

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 10 lines · Alon Levy
Quoted 9 lines · Jan Kiszka
Quoted 7 lines · Alon Levy

Hi Jan,

I've recently found the $SUBJECT, it's commit
f81bdefb63243e82d16ce49332f7cf74d10b8f27.

I'd like to fix it without breaking anything, can you provide me with the test that your original patch fixed?

Quoted 8 lines
Quoted 5 lines

Have monitor on virtual console, switch to monitor and trigger screen dump. So far that caused the to be dumped screen been written to the monitor console, the console was furthermore resized, but all that mess was left behind once dumping was finished. No we switch to the graphic console first and restore the monitor afterwards.

I don't follow. Can you provide a qemu command line? how do I run the monitor on a virtual console?

It's there by default unless you specify something else via -mon[itor]. In that case you can add another one via -monitor vc.

Quoted 29 lines
Quoted 16 lines
Quoted 16 lines

Alon

p.s. for a simple command line with a single console (not even sure how to get multiple) the following fixes my problem, I expect it doesn't introduce any problems?

console.c +0 -0
index 6dfcc47..5a709fe 100644
@@ -1067,6 +1067,10 @@ void console_select(unsigned int index)
 
Quoted 12 lines

console.c void console_select(unsigned int index) · line 1076

Quoted 9 lines
console.c +4 -0
     if (index >= MAX_CONSOLES)
         return;
+    if (active_console == consoles[index]) {
+        fprintf(stderr, "not changing console, not required\n");
+        return;
+    }
     if (active_console) {
         active_console->g_width = ds_get_width(active_console->ds);
         active_console->g_height = ds_get_height(active_console->ds);

I suspect this papers over some QXL bug. SDL has no issues when I trigger the screen dump from a monitor console that requires no switching.

Quoted 4 lines

You are absolutely right. So far I haven't managed to find the exact bug (I have been looking without applying this patch). So I've sent this patch anyway. the rest of console_select reallocates the surface, which is not terrible (this isn't high frequency) but still redundant.

Yeah, I see. No concerns.

Jan