All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes.
@ 2014-10-17 14:28 ` Daniel Thompson
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2014-10-17 14:28 UTC (permalink / raw)
  To: David Airlie
  Cc: Daniel Thompson, dri-devel, linux-kernel, patches, linaro-kernel,
	Rob Clark

Currently forcing the video mode from the kernel command line (for example
video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
per pixel. This is due to a rather aggressive override in
msm_fbdev_create(). This is a particular problem for Android bring up
because the software EGL fallbacks don't support 32bpp.

This problem could be trivially fixed by removing the override completely.
However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to
XR24 rather than AR24") this patch continues to override the depth if
there are 32 bits per pixel.

Change was tested by dd'ing a test image to /dev/fb0 with no video=
(still 32bpp, DBG() message observed), video=1920x1080-32@60 (message
observed), video=1920x1080-24@60 and video=1920x1080-16@60 .

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Rob Clark <robdclark@gmail.com>
---
 drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ab5bfd2..ed0171d 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
 	uint32_t paddr;
 	int ret, size;

-	sizes->surface_bpp = 32;
-	sizes->surface_depth = 24;
+	if (sizes->surface_bpp == 32) {
+		DBG("forcing surface depth to 24\n");
+		sizes->surface_depth = 24;
+	}

 	DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
 			sizes->surface_height, sizes->surface_bpp,
--
1.9.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes.
@ 2014-10-17 14:28 ` Daniel Thompson
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2014-10-17 14:28 UTC (permalink / raw)
  To: David Airlie; +Cc: linaro-kernel, patches, linux-kernel, dri-devel

Currently forcing the video mode from the kernel command line (for example
video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
per pixel. This is due to a rather aggressive override in
msm_fbdev_create(). This is a particular problem for Android bring up
because the software EGL fallbacks don't support 32bpp.

This problem could be trivially fixed by removing the override completely.
However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to
XR24 rather than AR24") this patch continues to override the depth if
there are 32 bits per pixel.

Change was tested by dd'ing a test image to /dev/fb0 with no video=
(still 32bpp, DBG() message observed), video=1920x1080-32@60 (message
observed), video=1920x1080-24@60 and video=1920x1080-16@60 .

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Rob Clark <robdclark@gmail.com>
---
 drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ab5bfd2..ed0171d 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
 	uint32_t paddr;
 	int ret, size;

-	sizes->surface_bpp = 32;
-	sizes->surface_depth = 24;
+	if (sizes->surface_bpp == 32) {
+		DBG("forcing surface depth to 24\n");
+		sizes->surface_depth = 24;
+	}

 	DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
 			sizes->surface_height, sizes->surface_bpp,
--
1.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes.
  2014-10-17 14:28 ` Daniel Thompson
@ 2014-10-17 14:43   ` Rob Clark
  -1 siblings, 0 replies; 8+ messages in thread
From: Rob Clark @ 2014-10-17 14:43 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: David Airlie, dri-devel, Linux Kernel Mailing List, patches,
	linaro-kernel

On Fri, Oct 17, 2014 at 10:28 AM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:
> Currently forcing the video mode from the kernel command line (for example
> video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
> per pixel. This is due to a rather aggressive override in
> msm_fbdev_create(). This is a particular problem for Android bring up
> because the software EGL fallbacks don't support 32bpp.
>
> This problem could be trivially fixed by removing the override completely.
> However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to
> XR24 rather than AR24") this patch continues to override the depth if
> there are 32 bits per pixel.
>
> Change was tested by dd'ing a test image to /dev/fb0 with no video=
> (still 32bpp, DBG() message observed), video=1920x1080-32@60 (message
> observed), video=1920x1080-24@60 and video=1920x1080-16@60 .
>
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Rob Clark <robdclark@gmail.com>
> ---
>  drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
> index ab5bfd2..ed0171d 100644
> --- a/drivers/gpu/drm/msm/msm_fbdev.c
> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
> @@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>         uint32_t paddr;
>         int ret, size;
>
> -       sizes->surface_bpp = 32;
> -       sizes->surface_depth = 24;
> +       if (sizes->surface_bpp == 32) {
> +               DBG("forcing surface depth to 24\n");
> +               sizes->surface_depth = 24;
> +       }

Thanks.. we could probably even drop this forcing depth to 24.. from a
quick check in drm_fb_helper_single_fb_probe() the default is 24/32
which should be enough for the "flicker-free" handover from splash
screen to X.

Not really sure why I was forcing the depth/bpp.. I think copy/paste
of a hack from another driver to do video 'underlays' ;-)

BR,
-R

>
>         DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
>                         sizes->surface_height, sizes->surface_bpp,
> --
> 1.9.3
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes.
@ 2014-10-17 14:43   ` Rob Clark
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Clark @ 2014-10-17 14:43 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: linaro-kernel, Linux Kernel Mailing List, dri-devel, patches

On Fri, Oct 17, 2014 at 10:28 AM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:
> Currently forcing the video mode from the kernel command line (for example
> video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
> per pixel. This is due to a rather aggressive override in
> msm_fbdev_create(). This is a particular problem for Android bring up
> because the software EGL fallbacks don't support 32bpp.
>
> This problem could be trivially fixed by removing the override completely.
> However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to
> XR24 rather than AR24") this patch continues to override the depth if
> there are 32 bits per pixel.
>
> Change was tested by dd'ing a test image to /dev/fb0 with no video=
> (still 32bpp, DBG() message observed), video=1920x1080-32@60 (message
> observed), video=1920x1080-24@60 and video=1920x1080-16@60 .
>
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Rob Clark <robdclark@gmail.com>
> ---
>  drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
> index ab5bfd2..ed0171d 100644
> --- a/drivers/gpu/drm/msm/msm_fbdev.c
> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
> @@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>         uint32_t paddr;
>         int ret, size;
>
> -       sizes->surface_bpp = 32;
> -       sizes->surface_depth = 24;
> +       if (sizes->surface_bpp == 32) {
> +               DBG("forcing surface depth to 24\n");
> +               sizes->surface_depth = 24;
> +       }

Thanks.. we could probably even drop this forcing depth to 24.. from a
quick check in drm_fb_helper_single_fb_probe() the default is 24/32
which should be enough for the "flicker-free" handover from splash
screen to X.

Not really sure why I was forcing the depth/bpp.. I think copy/paste
of a hack from another driver to do video 'underlays' ;-)

BR,
-R

>
>         DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
>                         sizes->surface_height, sizes->surface_bpp,
> --
> 1.9.3
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes.
  2014-10-17 14:43   ` Rob Clark
@ 2014-10-17 14:47     ` Daniel Thompson
  -1 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2014-10-17 14:47 UTC (permalink / raw)
  To: Rob Clark
  Cc: David Airlie, dri-devel, Linux Kernel Mailing List, patches,
	linaro-kernel

On 17/10/14 15:43, Rob Clark wrote:
> On Fri, Oct 17, 2014 at 10:28 AM, Daniel Thompson
> <daniel.thompson@linaro.org> wrote:
>> Currently forcing the video mode from the kernel command line (for example
>> video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
>> per pixel. This is due to a rather aggressive override in
>> msm_fbdev_create(). This is a particular problem for Android bring up
>> because the software EGL fallbacks don't support 32bpp.
>>
>> This problem could be trivially fixed by removing the override completely.
>> However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to
>> XR24 rather than AR24") this patch continues to override the depth if
>> there are 32 bits per pixel.
>>
>> Change was tested by dd'ing a test image to /dev/fb0 with no video=
>> (still 32bpp, DBG() message observed), video=1920x1080-32@60 (message
>> observed), video=1920x1080-24@60 and video=1920x1080-16@60 .
>>
>> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Rob Clark <robdclark@gmail.com>
>> ---
>>  drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
>> index ab5bfd2..ed0171d 100644
>> --- a/drivers/gpu/drm/msm/msm_fbdev.c
>> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
>> @@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>>         uint32_t paddr;
>>         int ret, size;
>>
>> -       sizes->surface_bpp = 32;
>> -       sizes->surface_depth = 24;
>> +       if (sizes->surface_bpp == 32) {
>> +               DBG("forcing surface depth to 24\n");
>> +               sizes->surface_depth = 24;
>> +       }
> 
> Thanks.. we could probably even drop this forcing depth to 24.. from a
> quick check in drm_fb_helper_single_fb_probe() the default is 24/32
> which should be enough for the "flicker-free" handover from splash
> screen to X.

Interesting...

I probably should have checked that myself. "git blame" told me that the
change to surface_depth came a long time after forcing the surface_bpp
so I figured it was needed.

v2 may be forthcoming shortly.



> Not really sure why I was forcing the depth/bpp.. I think copy/paste
> of a hack from another driver to do video 'underlays' ;-)
> 
> BR,
> -R
> 
>>
>>         DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
>>                         sizes->surface_height, sizes->surface_bpp,
>> --
>> 1.9.3
>>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes.
@ 2014-10-17 14:47     ` Daniel Thompson
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2014-10-17 14:47 UTC (permalink / raw)
  To: Rob Clark; +Cc: linaro-kernel, Linux Kernel Mailing List, dri-devel, patches

On 17/10/14 15:43, Rob Clark wrote:
> On Fri, Oct 17, 2014 at 10:28 AM, Daniel Thompson
> <daniel.thompson@linaro.org> wrote:
>> Currently forcing the video mode from the kernel command line (for example
>> video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
>> per pixel. This is due to a rather aggressive override in
>> msm_fbdev_create(). This is a particular problem for Android bring up
>> because the software EGL fallbacks don't support 32bpp.
>>
>> This problem could be trivially fixed by removing the override completely.
>> However to avoid regressing commit 96673ecbd7f6 ("drm/msm: default to
>> XR24 rather than AR24") this patch continues to override the depth if
>> there are 32 bits per pixel.
>>
>> Change was tested by dd'ing a test image to /dev/fb0 with no video=
>> (still 32bpp, DBG() message observed), video=1920x1080-32@60 (message
>> observed), video=1920x1080-24@60 and video=1920x1080-16@60 .
>>
>> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Rob Clark <robdclark@gmail.com>
>> ---
>>  drivers/gpu/drm/msm/msm_fbdev.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
>> index ab5bfd2..ed0171d 100644
>> --- a/drivers/gpu/drm/msm/msm_fbdev.c
>> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
>> @@ -93,8 +93,10 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>>         uint32_t paddr;
>>         int ret, size;
>>
>> -       sizes->surface_bpp = 32;
>> -       sizes->surface_depth = 24;
>> +       if (sizes->surface_bpp == 32) {
>> +               DBG("forcing surface depth to 24\n");
>> +               sizes->surface_depth = 24;
>> +       }
> 
> Thanks.. we could probably even drop this forcing depth to 24.. from a
> quick check in drm_fb_helper_single_fb_probe() the default is 24/32
> which should be enough for the "flicker-free" handover from splash
> screen to X.

Interesting...

I probably should have checked that myself. "git blame" told me that the
change to surface_depth came a long time after forcing the surface_bpp
so I figured it was needed.

v2 may be forthcoming shortly.



> Not really sure why I was forcing the depth/bpp.. I think copy/paste
> of a hack from another driver to do video 'underlays' ;-)
> 
> BR,
> -R
> 
>>
>>         DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
>>                         sizes->surface_height, sizes->surface_bpp,
>> --
>> 1.9.3
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3.17 v2] drm/msm: Fix fbdev for 16- and 24-bit modes.
  2014-10-17 14:28 ` Daniel Thompson
@ 2014-10-17 15:48   ` Daniel Thompson
  -1 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2014-10-17 15:48 UTC (permalink / raw)
  To: David Airlie
  Cc: Daniel Thompson, dri-devel, linux-kernel, patches, linaro-kernel,
	Rob Clark

Currently forcing the video mode from the kernel command line (for example
video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
per pixel. This is due to a rather aggressive override in
msm_fbdev_create(). This is a particular problem for Android bring up
because the software EGL fallbacks don't support 32bpp.

Since the overrides are actually the default values anyway then this
problem can be trivially fixed by removing the overrides completely.

Change was tested by dd'ing a test image to /dev/fb0 with no video=
(still 32bpp), video=1920x1080-32@60, video=1920x1080-24@60 and
video=1920x1080-16@60 .

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Rob Clark <robdclark@gmail.com>
---
 drivers/gpu/drm/msm/msm_fbdev.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ab5bfd2..94d55e5 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -93,9 +93,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
 	uint32_t paddr;
 	int ret, size;

-	sizes->surface_bpp = 32;
-	sizes->surface_depth = 24;
-
 	DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
 			sizes->surface_height, sizes->surface_bpp,
 			sizes->fb_width, sizes->fb_height);
--
1.9.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3.17 v2] drm/msm: Fix fbdev for 16- and 24-bit modes.
@ 2014-10-17 15:48   ` Daniel Thompson
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2014-10-17 15:48 UTC (permalink / raw)
  To: David Airlie; +Cc: linaro-kernel, patches, linux-kernel, dri-devel

Currently forcing the video mode from the kernel command line (for example
video=HDMI-A-1:1280x720-16@60) does not correctly set the number of bits
per pixel. This is due to a rather aggressive override in
msm_fbdev_create(). This is a particular problem for Android bring up
because the software EGL fallbacks don't support 32bpp.

Since the overrides are actually the default values anyway then this
problem can be trivially fixed by removing the overrides completely.

Change was tested by dd'ing a test image to /dev/fb0 with no video=
(still 32bpp), video=1920x1080-32@60, video=1920x1080-24@60 and
video=1920x1080-16@60 .

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Rob Clark <robdclark@gmail.com>
---
 drivers/gpu/drm/msm/msm_fbdev.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ab5bfd2..94d55e5 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -93,9 +93,6 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
 	uint32_t paddr;
 	int ret, size;

-	sizes->surface_bpp = 32;
-	sizes->surface_depth = 24;
-
 	DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
 			sizes->surface_height, sizes->surface_bpp,
 			sizes->fb_width, sizes->fb_height);
--
1.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-10-17 15:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17 14:28 [PATCH 3.17] drm/msm: Fix fbdev for 16- and 24-bit modes Daniel Thompson
2014-10-17 14:28 ` Daniel Thompson
2014-10-17 14:43 ` Rob Clark
2014-10-17 14:43   ` Rob Clark
2014-10-17 14:47   ` Daniel Thompson
2014-10-17 14:47     ` Daniel Thompson
2014-10-17 15:48 ` [PATCH 3.17 v2] " Daniel Thompson
2014-10-17 15:48   ` Daniel Thompson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.