diff mbox

gma500: Make VGA and HDMI connector hotpluggable

Message ID 20130331113844.GG16352@chmeee.dyndns.org (mailing list archive)
State New, archived
Headers show

Commit Message

Kero March 31, 2013, 11:38 a.m. UTC
From: Kero van Gelder <kero@chello.nl>

Both VGA and HDMI connectors are available on my Asus EeePC X101CH.
This patch will cause output to be shown on either when plugged in.
For both, it shows the leftmost 800x600, of the 1024x600 on LVDS.

Signed-off-by: Kero van Gelder <kero@chello.nl>
---

Comments

Patrik Jakobsson April 2, 2013, 12:54 p.m. UTC | #1
On Sun, Mar 31, 2013 at 1:38 PM, Kero <kero@chello.nl> wrote:
> From: Kero van Gelder <kero@chello.nl>
>
> Both VGA and HDMI connectors are available on my Asus EeePC X101CH.
> This patch will cause output to be shown on either when plugged in.
> For both, it shows the leftmost 800x600, of the 1024x600 on LVDS.
>
> Signed-off-by: Kero van Gelder <kero@chello.nl>
> ---
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c
> index 8c17534..7b8386f 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_crt.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c
> @@ -276,6 +276,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
>                 goto failed_connector;
>
>         connector = &psb_intel_connector->base;
> +       connector->polled = DRM_CONNECTOR_POLL_HPD;
>         drm_connector_init(dev, connector,
>                 &cdv_intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index e223b50..464153d 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -319,6 +319,7 @@ void cdv_hdmi_init(struct drm_device *dev,
>                 goto err_priv;
>
>         connector = &psb_intel_connector->base;
> +       connector->polled = DRM_CONNECTOR_POLL_HPD;
>         encoder = &psb_intel_encoder->base;
>         drm_connector_init(dev, connector,
>                            &cdv_hdmi_connector_funcs,
> --

Your patch has been applied to:
https://github.com/patjak/drm-gma500.git gma500-next

We might also consider polling if this causes problems for people, but for now
this is fine. No biggie, but your tabs where converted to spaces so I recommend
running checkpatch.pl before submitting.

Thanks
Patrik Jakobsson
Kero April 3, 2013, 3:21 p.m. UTC | #2
Hi,

I would not mind improving use of my Asus EeePC X101CH with Cedar View / gma3600
a bit more. But a barrier is knowledge of the hardware. Meddling with existing (initialization)
code is possible, but for point 1 and 3 below that is not going to cut, it, I expect.

Does anyone have pointers? Who should I talk to about specifications?
I know Intel is not forthcoming with documentation, yet several people have
made contributions for poulsbo and later versions of the hardware.
How did you get the required knowledge?

Things I might, in order of personal preference, in due time (after holiday), take a look at:
1) would be nice to have the full 1024x600 on the external VGA and HDMI
   I had a chance to try another monitor over HDMI, same result: only 800x600 visible.
2) booting with either VGA or HDMI plugged in, yields two black screens: both the laptop
   and the monitor. Un- + re-plugging has no visible effect.
3) the Fn keys for the backlight induce a response in the backlight, but only with
   tiny results; /sys/class/backlight/psb-bl/brightness works fine, though
4) when using modules, initialization from hibernation is not good enough:
   my screen stays black; without using modules, the kernel boots normally, and everything is fine.
5) initialization from suspend is not good enough: my Asus stays in
   some text mode (80x25?), but shows garbage (possibly data from the desired console or
   graphics mode, since sometimes there are reactions correlated to actions)
   Switching tty or using `chvt` do not improve anything.
   NB: hibernating and booting solves this.

> Your patch has been applied to:
> https://github.com/patjak/drm-gma500.git gma500-next

Thanks!

> We might also consider polling if this causes problems for people, but for now
> this is fine.

Agreed;
The Display Port was already hotpluggable; the Asus has no such connector,
but is not bothered by polling (status is and remains 'disconnected').
That makes me hopeful that hardware without VGA or HDMI connectors will not be
negatively affected. But given the 5 points above, there's no guarantee.

> No biggie, but your tabs where converted to spaces so I recommend
> running checkpatch.pl before submitting.

woops, my mistake. will run checkpatch.pl next time.

Bye,
Kero.
Patrik Jakobsson April 3, 2013, 5:28 p.m. UTC | #3
On Wed, Apr 3, 2013 at 5:21 PM, Kero <kero@chello.nl> wrote:
> Hi,
>
> I would not mind improving use of my Asus EeePC X101CH with Cedar View / gma3600
> a bit more. But a barrier is knowledge of the hardware. Meddling with existing (initialization)
> code is possible, but for point 1 and 3 below that is not going to cut, it, I expect.

It would be very useful if you could help out with cedarview. Even if it's just
by testing patches. A big problem for me is that I don't have the hardware so
it's easy to break things without even knowing about it.

>
> Does anyone have pointers? Who should I talk to about specifications?
> I know Intel is not forthcoming with documentation, yet several people have
> made contributions for poulsbo and later versions of the hardware.
> How did you get the required knowledge?

Most of the mode setting stuff are variations of Intel hardware. You can find
specifications at https://01.org/linuxgraphics/ and it's also useful to look at
the Intel i915 drm driver for reference. It is quite a mix so you need to look
at bits and pieces from several of the Intel generations and try to match them
together.

For the non-Intel parts there are some drivers that never made it into mainline
but is still available online. Some parts are open and some are closed.

There is also a fair amount of guessing and probing needed.

>
> Things I might, in order of personal preference, in due time (after holiday), take a look at:
> 1) would be nice to have the full 1024x600 on the external VGA and HDMI
>    I had a chance to try another monitor over HDMI, same result: only 800x600 visible.
> 2) booting with either VGA or HDMI plugged in, yields two black screens: both the laptop
>    and the monitor. Un- + re-plugging has no visible effect.
> 3) the Fn keys for the backlight induce a response in the backlight, but only with
>    tiny results; /sys/class/backlight/psb-bl/brightness works fine, though
> 4) when using modules, initialization from hibernation is not good enough:
>    my screen stays black; without using modules, the kernel boots normally, and everything is fine.
> 5) initialization from suspend is not good enough: my Asus stays in
>    some text mode (80x25?), but shows garbage (possibly data from the desired console or
>    graphics mode, since sometimes there are reactions correlated to actions)
>    Switching tty or using `chvt` do not improve anything.
>    NB: hibernating and booting solves this.

There are quite a few issues that needs to be addressed and code that needs to
be refactored. I suggest you just dig in and get your hands dirty.

-Patrik
Patrik Jakobsson April 7, 2013, 7:24 p.m. UTC | #4
Hi Kero

> 4) when using modules, initialization from hibernation is not good enough:
>    my screen stays black; without using modules, the kernel boots normally, and everything is fine.
> 5) initialization from suspend is not good enough: my Asus stays in
>    some text mode (80x25?), but shows garbage (possibly data from the desired console or
>    graphics mode, since sometimes there are reactions correlated to actions)
>    Switching tty or using `chvt` do not improve anything.
>    NB: hibernating and booting solves this.

I may have fixed some of your issues, could you please try the latest
gma500-next and report back.

https://github.com/patjak/drm-gma500.git gma500-next

Thanks
Patrik
Kero April 17, 2013, 5:57 p.m. UTC | #5
> > 4) when using modules, initialization from hibernation is not good enough:
> >    my screen stays black; without using modules, the kernel boots normally, and everything is fine.
> > 5) initialization from suspend is not good enough: my Asus stays in
> >    some text mode (80x25?), but shows garbage (possibly data from the desired console or
> >    graphics mode, since sometimes there are reactions correlated to actions)
> >    Switching tty or using `chvt` do not improve anything.
> >    NB: hibernating and booting solves this.
> 
> I may have fixed some of your issues, could you please try the latest
> gma500-next and report back.
> 
> https://github.com/patjak/drm-gma500.git gma500-next

Like I said, I am on vacation.
So it took a while before I had some time to spend on this experiment.
The good news, both problems seem to be solved on my hardware.

Bye,
Kero.
Patrik Jakobsson April 17, 2013, 10:19 p.m. UTC | #6
On Wed, Apr 17, 2013 at 7:57 PM, Kero <kero@chello.nl> wrote:
>> > 4) when using modules, initialization from hibernation is not good enough:
>> >    my screen stays black; without using modules, the kernel boots normally, and everything is fine.
>> > 5) initialization from suspend is not good enough: my Asus stays in
>> >    some text mode (80x25?), but shows garbage (possibly data from the desired console or
>> >    graphics mode, since sometimes there are reactions correlated to actions)
>> >    Switching tty or using `chvt` do not improve anything.
>> >    NB: hibernating and booting solves this.
>>
>> I may have fixed some of your issues, could you please try the latest
>> gma500-next and report back.
>>
>> https://github.com/patjak/drm-gma500.git gma500-next
>
> Like I said, I am on vacation.
> So it took a while before I had some time to spend on this experiment.
> The good news, both problems seem to be solved on my hardware.

Vacation is vacation... you're excused ;)

Thanks for testing, seems the biggest bumps for cdv suspend/hibernation are
gone. Feel free to look at the other issues if you have some spare time on your
hands.

-Patrik
diff mbox

Patch

diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c
index 8c17534..7b8386f 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_crt.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c
@@ -276,6 +276,7 @@  void cdv_intel_crt_init(struct drm_device *dev,
                goto failed_connector;
 
        connector = &psb_intel_connector->base;
+       connector->polled = DRM_CONNECTOR_POLL_HPD;
        drm_connector_init(dev, connector,
                &cdv_intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
 
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index e223b50..464153d 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -319,6 +319,7 @@  void cdv_hdmi_init(struct drm_device *dev,
                goto err_priv;
 
        connector = &psb_intel_connector->base;
+       connector->polled = DRM_CONNECTOR_POLL_HPD;
        encoder = &psb_intel_encoder->base;
        drm_connector_init(dev, connector,
                           &cdv_hdmi_connector_funcs,