diff mbox series

[1/1] sandbox: make SDL window resizable

Message ID 20200929011116.174644-1-xypron.glpk@gmx.de
State Superseded
Delegated to: Simon Glass
Headers show
Series [1/1] sandbox: make SDL window resizable | expand

Commit Message

Heinrich Schuchardt Sept. 29, 2020, 1:11 a.m. UTC
Without resizing the SDL window showed by

    ./u-boot -D -l

is not legible on a high resolution screen.

Start with a maximized window and allow resizing.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 arch/sandbox/cpu/sdl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.28.0

Comments

Simon Glass Oct. 5, 2020, 1:41 a.m. UTC | #1
Hi Heinrich,

On Mon, 28 Sep 2020 at 19:11, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Without resizing the SDL window showed by
>
>     ./u-boot -D -l
>
> is not legible on a high resolution screen.
>
> Start with a maximized window and allow resizing.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/sandbox/cpu/sdl.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Have you troubled the --double_lcd option?

Does this have any effect on performance?

I actually don't like this as it makes the text hard to read, and full
screen is annoying. I wonder if this should be a flag?

> diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
> index 7dc3dab32e..911247123f 100644
> --- a/arch/sandbox/cpu/sdl.c
> +++ b/arch/sandbox/cpu/sdl.c
> @@ -127,7 +127,9 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
>         sdl.pitch = sdl.width * sdl.depth / 8;
>         SDL_Window *screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
>                                               SDL_WINDOWPOS_UNDEFINED,
> -                                             sdl.vis_width, sdl.vis_height, 0);
> +                                             sdl.vis_width, sdl.vis_height,
> +                                             SDL_WINDOW_MAXIMIZED |
> +                                             SDL_WINDOW_RESIZABLE);
>         if (!screen) {
>                 printf("Unable to initialise SDL screen: %s\n",
>                        SDL_GetError());
> --
> 2.28.0
>

Regards,
Simon
Heinrich Schuchardt Oct. 8, 2020, 9:46 a.m. UTC | #2
On 05.10.20 03:41, Simon Glass wrote:
> Hi Heinrich,
>
> On Mon, 28 Sep 2020 at 19:11, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> Without resizing the SDL window showed by
>>
>>     ./u-boot -D -l
>>
>> is not legible on a high resolution screen.
>>
>> Start with a maximized window and allow resizing.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  arch/sandbox/cpu/sdl.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>
> Have you troubled the --double_lcd option?

That looks better.

This option is not documented in doc/arch/sandbox.rst.

>
> Does this have any effect on performance?

With --double_lcd you are already doing a resize operation. I could not
observe any performance loss for a maximized window. The BitBlt
operations in X11 are well accelerated by current GPUs.

>
> I actually don't like this as it makes the text hard to read, and full
> screen is annoying. I wonder if this should be a flag?

I understand that you do not want the window maximized. But is anything
wrong about making the window resizable (SDL_WINDOW_RESIZABLE)?

Shall I update the patch accordingly?

Best regards

Heinrich

>
>> diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
>> index 7dc3dab32e..911247123f 100644
>> --- a/arch/sandbox/cpu/sdl.c
>> +++ b/arch/sandbox/cpu/sdl.c
>> @@ -127,7 +127,9 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
>>         sdl.pitch = sdl.width * sdl.depth / 8;
>>         SDL_Window *screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
>>                                               SDL_WINDOWPOS_UNDEFINED,
>> -                                             sdl.vis_width, sdl.vis_height, 0);
>> +                                             sdl.vis_width, sdl.vis_height,
>> +                                             SDL_WINDOW_MAXIMIZED |
>> +                                             SDL_WINDOW_RESIZABLE);
>>         if (!screen) {
>>                 printf("Unable to initialise SDL screen: %s\n",
>>                        SDL_GetError());
>> --
>> 2.28.0
>>
>
> Regards,
> Simon
>
Simon Glass Oct. 9, 2020, 5:23 p.m. UTC | #3
Hi Heinrich,

On Thu, 8 Oct 2020 at 03:46, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 05.10.20 03:41, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Mon, 28 Sep 2020 at 19:11, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >>
> >> Without resizing the SDL window showed by
> >>
> >>     ./u-boot -D -l
> >>
> >> is not legible on a high resolution screen.
> >>
> >> Start with a maximized window and allow resizing.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>  arch/sandbox/cpu/sdl.c | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >
> > Have you troubled the --double_lcd option?
>
> That looks better.
>
> This option is not documented in doc/arch/sandbox.rst.
>
> >
> > Does this have any effect on performance?
>
> With --double_lcd you are already doing a resize operation. I could not
> observe any performance loss for a maximized window. The BitBlt
> operations in X11 are well accelerated by current GPUs.
>
> >
> > I actually don't like this as it makes the text hard to read, and full
> > screen is annoying. I wonder if this should be a flag?
>
> I understand that you do not want the window maximized. But is anything
> wrong about making the window resizable (SDL_WINDOW_RESIZABLE)?
>
> Shall I update the patch accordingly?

I think that is OK...does it mean that the window has scroll bars, etc?

Regards,
Simon
Heinrich Schuchardt Oct. 9, 2020, 9:43 p.m. UTC | #4
On 09.10.20 19:23, Simon Glass wrote:
> Hi Heinrich,
>
> On Thu, 8 Oct 2020 at 03:46, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> On 05.10.20 03:41, Simon Glass wrote:
>>> Hi Heinrich,
>>>
>>> On Mon, 28 Sep 2020 at 19:11, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>>>
>>>> Without resizing the SDL window showed by
>>>>
>>>>     ./u-boot -D -l
>>>>
>>>> is not legible on a high resolution screen.
>>>>
>>>> Start with a maximized window and allow resizing.
>>>>
>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>> ---
>>>>  arch/sandbox/cpu/sdl.c | 4 +++-
>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>
>>> Have you troubled the --double_lcd option?
>>
>> That looks better.
>>
>> This option is not documented in doc/arch/sandbox.rst.
>>
>>>
>>> Does this have any effect on performance?
>>
>> With --double_lcd you are already doing a resize operation. I could not
>> observe any performance loss for a maximized window. The BitBlt
>> operations in X11 are well accelerated by current GPUs.
>>
>>>
>>> I actually don't like this as it makes the text hard to read, and full
>>> screen is annoying. I wonder if this should be a flag?
>>
>> I understand that you do not want the window maximized. But is anything
>> wrong about making the window resizable (SDL_WINDOW_RESIZABLE)?
>>
>> Shall I update the patch accordingly?
>
> I think that is OK...does it mean that the window has scroll bars, etc?

No, it will only have dragable edges and a maximize button.

Best regards

Heinrich
diff mbox series

Patch

diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
index 7dc3dab32e..911247123f 100644
--- a/arch/sandbox/cpu/sdl.c
+++ b/arch/sandbox/cpu/sdl.c
@@ -127,7 +127,9 @@  int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 	sdl.pitch = sdl.width * sdl.depth / 8;
 	SDL_Window *screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
 					      SDL_WINDOWPOS_UNDEFINED,
-					      sdl.vis_width, sdl.vis_height, 0);
+					      sdl.vis_width, sdl.vis_height,
+					      SDL_WINDOW_MAXIMIZED |
+					      SDL_WINDOW_RESIZABLE);
 	if (!screen) {
 		printf("Unable to initialise SDL screen: %s\n",
 		       SDL_GetError());