All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging/gma500: get control from firmware framebuffer if conflicts
@ 2011-05-27  7:04 Michael Chang
  2011-05-27  8:56 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Chang @ 2011-05-27  7:04 UTC (permalink / raw)
  To: Greg KH; +Cc: alan, error27, justinmattock, devel, linux-kernel

Many Linux distributions would enable vesafb in order to display
early stage boot splash. In this case, we will get garbled X
Window screen if running X fbdev on psbfb.

This is because fb0 is occupied by vesafb while psbfb is on fb1.
They tried to drive the same pieces of hardware at the same
time. With unmodified X start-up, it would try to use default
fb0 framebuffer device and unfortunately it is now broken
becaues fb1 supersedes it.

We should let psbfb takeover framebuffer control from vesafb
to get around this problem.

See also commit : 4410f3910947dcea8672280b3adecd
53cec4e85e

Signed-off-by: Michael Chang <mchang@novell.com>
---
 drivers/staging/gma500/psb_fb.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/gma500/psb_fb.c b/drivers/staging/gma500/psb_fb.c
index 99c03a2..259596c 100644
--- a/drivers/staging/gma500/psb_fb.c
+++ b/drivers/staging/gma500/psb_fb.c
@@ -441,6 +441,14 @@ static int psbfb_create(struct psb_fbdev *fbdev,
       info->screen_size = size;
       memset(info->screen_base, 0, size);

+       info->apertures = alloc_apertures(1);
+       if (!info->apertures) {
+               ret = -ENOMEM;
+               goto out_err0;
+       }
+       info->apertures->ranges[0].base = dev->mode_config.fb_base;
+       info->apertures->ranges[0].size = dev_priv->pg->stolen_size;
+
       drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
       drm_fb_helper_fill_var(info, &fbdev->psb_fb_helper,
                               sizes->fb_width, sizes->fb_height);
--
1.7.3.4

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

* Re: [PATCH] staging/gma500: get control from firmware framebuffer if conflicts
  2011-05-27  7:04 [PATCH] staging/gma500: get control from firmware framebuffer if conflicts Michael Chang
@ 2011-05-27  8:56 ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2011-05-27  8:56 UTC (permalink / raw)
  To: Michael Chang; +Cc: Greg KH, error27, justinmattock, devel, linux-kernel

> We should let psbfb takeover framebuffer control from vesafb
> to get around this problem.

Looks good to me assuming we have stolen memory. This maybe wants to
test

	if (pg->stolen_size)

although I'm not sure that adding a zero size aperture would do harm
any way ? The devices without stolen ram also won't have vesa.

Alan

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

* Re: [PATCH] staging/gma500: get control from firmware framebuffer if conflicts
  2011-05-27  9:16 Michael Chang
@ 2011-05-27  9:32 ` Michael Chang
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Chang @ 2011-05-27  9:32 UTC (permalink / raw)
  To: gregkh; +Cc: alan, error27, justinmattock, devel, linux-kernel, Michael Chang

Sorry the first patch is problematic, it may not work if you try to
apply it, because it was sent from my gmail webmail. I have problem in
setting the git send-email that time and now it just get fixed. I
resend the patch again with git send-email.

Please use new patch. Thanks.

Regards,
Michael Chang

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

* [PATCH] staging/gma500: get control from firmware framebuffer if conflicts
@ 2011-05-27  9:16 Michael Chang
  2011-05-27  9:32 ` Michael Chang
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Chang @ 2011-05-27  9:16 UTC (permalink / raw)
  To: gregkh; +Cc: alan, error27, justinmattock, devel, linux-kernel, Michael Chang

Many Linux distributions would enable vesafb in order to display
early stage boot splash. In this case, we will get garbled X
Window screen if running X fbdev on psbfb.

This is because fb0 is occupied by vesafb while psbfb is on fb1.
They tried to drive the same pieces of hardware at the same
time. With unmodified X start-up, it would try to use default
fb0 framebuffer device and unfortunately it is now broken
becaues fb1 supersedes it.

We should let psbfb takeover framebuffer control from vesafb
to get around this problem.

See also commit : 4410f3910947dcea8672280b3adecd53cec4e85e

Signed-off-by: Michael Chang <mchang@novell.com>
---
 drivers/staging/gma500/psb_fb.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/gma500/psb_fb.c b/drivers/staging/gma500/psb_fb.c
index 99c03a2..259596c 100644
--- a/drivers/staging/gma500/psb_fb.c
+++ b/drivers/staging/gma500/psb_fb.c
@@ -441,6 +441,14 @@ static int psbfb_create(struct psb_fbdev *fbdev,
 	info->screen_size = size;
 	memset(info->screen_base, 0, size);
 
+	info->apertures = alloc_apertures(1);
+	if (!info->apertures) {
+		ret = -ENOMEM;
+		goto out_err0;
+	}
+	info->apertures->ranges[0].base = dev->mode_config.fb_base;
+	info->apertures->ranges[0].size = dev_priv->pg->stolen_size;
+
 	drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
 	drm_fb_helper_fill_var(info, &fbdev->psb_fb_helper,
 				sizes->fb_width, sizes->fb_height);
-- 
1.7.3.4


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

end of thread, other threads:[~2011-05-27  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27  7:04 [PATCH] staging/gma500: get control from firmware framebuffer if conflicts Michael Chang
2011-05-27  8:56 ` Alan Cox
2011-05-27  9:16 Michael Chang
2011-05-27  9:32 ` Michael Chang

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.