[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Wu Fengguang
On Mon, Nov 21, 2011 at 04:47:38PM +0800, Takashi Iwai wrote:
> At Mon, 21 Nov 2011 09:58:09 +0800,
> Wu Fengguang wrote:
> > 
> > On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
> > > On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang  > > intel.com> wrote:
> > > 
> > > > However when in X, ->mode_set won't be called at all.  Only
> > > > ->get_modes and ->detect are called...
> > > 
> > > The desktop software will call mode_set when it configures the
> > > monitor. Otherwise, it's not being used (and so shouldn't have audio
> > > routed to it by default).
> > 
> > Keith, I experimented playing HDMI audio in X, and during the time
> > unplug and plug the monitor. The HDMI audio/graphics all continue to
> > work when plugged in the monitor again. Here is the dmesg showed for
> > the plug event, no ->mode_set is called at all...
> 
> Which desktop system are you using?  At hotplug/unplugging, the kernel
> drm issues a udev event, X Intel driver receives it and updates
> Xrandr.  Then it's supposed that a daemon like gnome-settings-daemon
> receives Xrandr notification and changes the modes appropriately.
> Without such a background task, there will be no mode change.

Ah I got it. I'm running debian+fluxbox w/o those fancy features...

Thanks,
Fengguang


[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Wu Fengguang
On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
> On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang  
> wrote:
> 
> > However when in X, ->mode_set won't be called at all.  Only
> > ->get_modes and ->detect are called...
> 
> The desktop software will call mode_set when it configures the
> monitor. Otherwise, it's not being used (and so shouldn't have audio
> routed to it by default).

Keith, I experimented playing HDMI audio in X, and during the time
unplug and plug the monitor. The HDMI audio/graphics all continue to
work when plugged in the monitor again. Here is the dmesg showed for
the plug event, no ->mode_set is called at all...

[ 1296.469103] [drm:drm_mode_getconnector], [CONNECTOR:5:?]
[ 1296.475442] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:5:VGA-1]
[ 1296.483649] [drm:intel_ironlake_crt_detect_hotplug], ironlake hotplug 
adpa=0x83f4, result 1
[ 1296.493417] [drm:intel_crt_detect], CRT detected via hotplug
[ 1296.562579] [drm:drm_edid_to_eld], ELD: no CEA Extension found
[ 1296.564700] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:5:VGA-1] probed modes :
[ 1296.567609] [drm:drm_mode_debug_printmodeline], Modeline 24:"1024x768" 60 
65000 1024 1048 1184 1344 768 771 777 806 0x48 0xa
[ 1296.572112] [drm:drm_mode_debug_printmodeline], Modeline 23:"1024x768" 75 
78800 1024 1040 1136 1312 768 769 772 800 0x40 0x5
[ 1296.576561] [drm:drm_mode_debug_printmodeline], Modeline 25:"800x600" 75 
49500 800 816 896 1056 600 601 604 625 0x40 0x5
[ 1296.579109] [drm:drm_mode_debug_printmodeline], Modeline 19:"800x600" 60 
4 800 840 968 1056 600 601 605 628 0x40 0x5
[ 1296.581403] [drm:drm_mode_debug_printmodeline], Modeline 20:"640x480" 75 
31500 640 656 720 840 480 481 484 500 0x40 0xa
[ 1296.584027] [drm:drm_mode_debug_printmodeline], Modeline 21:"640x480" 60 
25200 640 656 752 800 480 490 492 525 0x40 0xa
[ 1296.587294] [drm:drm_mode_debug_printmodeline], Modeline 22:"720x400" 70 
28320 720 738 846 900 400 412 414 449 0x40 0x6
[ 1296.589849] [drm:drm_mode_getconnector], [CONNECTOR:5:?]
[ 1296.593635] [drm:drm_mode_getconnector], [CONNECTOR:8:?]
[ 1296.595157] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1]
[ 1296.608219] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1] disconnected
[ 1296.610732] [drm:drm_mode_getconnector], [CONNECTOR:8:?]
[ 1296.611939] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1]
[ 1296.624882] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1] disconnected
[ 1296.627445] [drm:drm_mode_getconnector], [CONNECTOR:12:?]
[ 1296.628814] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:12:HDMI-A-2]
[ 1296.750591] [drm:drm_detect_monitor_audio], Monitor has basic audio support
[ 1296.873062] [drm:drm_edid_to_eld], ELD monitor SONY TV
[ 1296.874819] HDMI: DVI dual 0, max TMDS clock 5, latency present 0 0, video 
latency 0 81, audio latency 114 208
[ 1296.877018] [drm:drm_edid_to_eld], ELD size 8, SAD count 1
[ 1296.878468] [drm:drm_mode_debug_printmodeline], Modeline 45:"1920x1080i" 0 
74250 1920 2448 2492 2640 1080 1084 1094 1125 0x40 0x15
[ 1296.880862] [drm:drm_mode_prune_invalid], Not using 1920x1080i mode 7
[ 1296.882454] [drm:drm_mode_debug_printmodeline], Modeline 44:"1920x1080i" 0 
74250 1920 2008 2052 2200 1080 1084 1094 1125 0x40 0x15
[ 1296.885996] [drm:drm_mode_prune_invalid], Not using 1920x1080i mode 7
[ 1296.887573] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:12:HDMI-A-2] probed modes :
[ 1296.889507] [drm:drm_mode_debug_printmodeline], Modeline 37:"1920x1080" 50 
148500 1920 2448 2492 2640 1080 1084 1089 1125 0x48 0x5
[ 1296.892084] [drm:drm_mode_debug_printmodeline], Modeline 43:"1280x720" 50 
74250 1280 1720 1760 1980 720 725 730 750 0x40 0x5
[ 1296.894657] [drm:drm_mode_debug_printmodeline], Modeline 41:"1280x720" 60 
74250 1280 1390 1430 1650 720 725 730 750 0x40 0x5
[ 1296.897053] [drm:drm_mode_debug_printmodeline], Modeline 32:"720x576" 50 
27000 720 732 796 864 576 581 586 625 0x40 0xa
[ 1296.899603] [drm:drm_mode_debug_printmodeline], Modeline 29:"720x480" 60 
27000 720 736 798 858 480 489 495 525 0x40 0xa
[ 1296.901979] [drm:drm_mode_getconnector], [CONNECTOR:12:?]
[ 1296.906084] [drm:drm_mode_getconnector], [CONNECTOR:13:?]
[ 1296.907545] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:13:DP-1]
[ 1296.909659] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.913429] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.917418] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.920908] [drm:intel_dp_detect], DPCD: 
[ 1296.922663] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:13:DP-1] disconnected
[ 1296.924543] [drm:drm_mode_getconnector], [CONNECTOR:13:?]
[ 1296.925793] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:13:DP-1]
[ 1296.927920] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.931393] 

[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Takashi Iwai
At Mon, 21 Nov 2011 09:58:09 +0800,
Wu Fengguang wrote:
> 
> On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
> > On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang  > intel.com> wrote:
> > 
> > > However when in X, ->mode_set won't be called at all.  Only
> > > ->get_modes and ->detect are called...
> > 
> > The desktop software will call mode_set when it configures the
> > monitor. Otherwise, it's not being used (and so shouldn't have audio
> > routed to it by default).
> 
> Keith, I experimented playing HDMI audio in X, and during the time
> unplug and plug the monitor. The HDMI audio/graphics all continue to
> work when plugged in the monitor again. Here is the dmesg showed for
> the plug event, no ->mode_set is called at all...

Which desktop system are you using?  At hotplug/unplugging, the kernel
drm issues a udev event, X Intel driver receives it and updates
Xrandr.  Then it's supposed that a daemon like gnome-settings-daemon
receives Xrandr notification and changes the modes appropriately.
Without such a background task, there will be no mode change.


Takashi


[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Keith Packard
On Mon, 21 Nov 2011 19:05:38 +0800, Wu Fengguang  
wrote:

> Ah I got it. I'm running debian+fluxbox w/o those fancy features...

Then you can manually run the 'xrandr' command to configure the new
monitor as desired, at which point the kernel mode_set function will be
called.

-- 
keith.packard at intel.com
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: 



Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Takashi Iwai
At Mon, 21 Nov 2011 09:58:09 +0800,
Wu Fengguang wrote:
 
 On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
  On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang fengguang...@intel.com 
  wrote:
  
   However when in X, -mode_set won't be called at all.  Only
   -get_modes and -detect are called...
  
  The desktop software will call mode_set when it configures the
  monitor. Otherwise, it's not being used (and so shouldn't have audio
  routed to it by default).
 
 Keith, I experimented playing HDMI audio in X, and during the time
 unplug and plug the monitor. The HDMI audio/graphics all continue to
 work when plugged in the monitor again. Here is the dmesg showed for
 the plug event, no -mode_set is called at all...

Which desktop system are you using?  At hotplug/unplugging, the kernel
drm issues a udev event, X Intel driver receives it and updates
Xrandr.  Then it's supposed that a daemon like gnome-settings-daemon
receives Xrandr notification and changes the modes appropriately.
Without such a background task, there will be no mode change.


Takashi
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Wu Fengguang
On Mon, Nov 21, 2011 at 04:47:38PM +0800, Takashi Iwai wrote:
 At Mon, 21 Nov 2011 09:58:09 +0800,
 Wu Fengguang wrote:
  
  On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
   On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang fengguang...@intel.com 
   wrote:
   
However when in X, -mode_set won't be called at all.  Only
-get_modes and -detect are called...
   
   The desktop software will call mode_set when it configures the
   monitor. Otherwise, it's not being used (and so shouldn't have audio
   routed to it by default).
  
  Keith, I experimented playing HDMI audio in X, and during the time
  unplug and plug the monitor. The HDMI audio/graphics all continue to
  work when plugged in the monitor again. Here is the dmesg showed for
  the plug event, no -mode_set is called at all...
 
 Which desktop system are you using?  At hotplug/unplugging, the kernel
 drm issues a udev event, X Intel driver receives it and updates
 Xrandr.  Then it's supposed that a daemon like gnome-settings-daemon
 receives Xrandr notification and changes the modes appropriately.
 Without such a background task, there will be no mode change.

Ah I got it. I'm running debian+fluxbox w/o those fancy features...

Thanks,
Fengguang
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-21 Thread Keith Packard
On Mon, 21 Nov 2011 19:05:38 +0800, Wu Fengguang fengguang...@intel.com wrote:

 Ah I got it. I'm running debian+fluxbox w/o those fancy features...

Then you can manually run the 'xrandr' command to configure the new
monitor as desired, at which point the kernel mode_set function will be
called.

-- 
keith.pack...@intel.com


pgpehj0HQTyQN.pgp
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-20 Thread Wu Fengguang
On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
 On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang fengguang...@intel.com 
 wrote:
 
  However when in X, -mode_set won't be called at all.  Only
  -get_modes and -detect are called...
 
 The desktop software will call mode_set when it configures the
 monitor. Otherwise, it's not being used (and so shouldn't have audio
 routed to it by default).

Keith, I experimented playing HDMI audio in X, and during the time
unplug and plug the monitor. The HDMI audio/graphics all continue to
work when plugged in the monitor again. Here is the dmesg showed for
the plug event, no -mode_set is called at all...

[ 1296.469103] [drm:drm_mode_getconnector], [CONNECTOR:5:?]
[ 1296.475442] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:5:VGA-1]
[ 1296.483649] [drm:intel_ironlake_crt_detect_hotplug], ironlake hotplug 
adpa=0x83f4, result 1
[ 1296.493417] [drm:intel_crt_detect], CRT detected via hotplug
[ 1296.562579] [drm:drm_edid_to_eld], ELD: no CEA Extension found
[ 1296.564700] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:5:VGA-1] probed modes :
[ 1296.567609] [drm:drm_mode_debug_printmodeline], Modeline 24:1024x768 60 
65000 1024 1048 1184 1344 768 771 777 806 0x48 0xa
[ 1296.572112] [drm:drm_mode_debug_printmodeline], Modeline 23:1024x768 75 
78800 1024 1040 1136 1312 768 769 772 800 0x40 0x5
[ 1296.576561] [drm:drm_mode_debug_printmodeline], Modeline 25:800x600 75 
49500 800 816 896 1056 600 601 604 625 0x40 0x5
[ 1296.579109] [drm:drm_mode_debug_printmodeline], Modeline 19:800x600 60 
4 800 840 968 1056 600 601 605 628 0x40 0x5
[ 1296.581403] [drm:drm_mode_debug_printmodeline], Modeline 20:640x480 75 
31500 640 656 720 840 480 481 484 500 0x40 0xa
[ 1296.584027] [drm:drm_mode_debug_printmodeline], Modeline 21:640x480 60 
25200 640 656 752 800 480 490 492 525 0x40 0xa
[ 1296.587294] [drm:drm_mode_debug_printmodeline], Modeline 22:720x400 70 
28320 720 738 846 900 400 412 414 449 0x40 0x6
[ 1296.589849] [drm:drm_mode_getconnector], [CONNECTOR:5:?]
[ 1296.593635] [drm:drm_mode_getconnector], [CONNECTOR:8:?]
[ 1296.595157] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1]
[ 1296.608219] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1] disconnected
[ 1296.610732] [drm:drm_mode_getconnector], [CONNECTOR:8:?]
[ 1296.611939] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1]
[ 1296.624882] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:8:HDMI-A-1] disconnected
[ 1296.627445] [drm:drm_mode_getconnector], [CONNECTOR:12:?]
[ 1296.628814] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:12:HDMI-A-2]
[ 1296.750591] [drm:drm_detect_monitor_audio], Monitor has basic audio support
[ 1296.873062] [drm:drm_edid_to_eld], ELD monitor SONY TV
[ 1296.874819] HDMI: DVI dual 0, max TMDS clock 5, latency present 0 0, video 
latency 0 81, audio latency 114 208
[ 1296.877018] [drm:drm_edid_to_eld], ELD size 8, SAD count 1
[ 1296.878468] [drm:drm_mode_debug_printmodeline], Modeline 45:1920x1080i 0 
74250 1920 2448 2492 2640 1080 1084 1094 1125 0x40 0x15
[ 1296.880862] [drm:drm_mode_prune_invalid], Not using 1920x1080i mode 7
[ 1296.882454] [drm:drm_mode_debug_printmodeline], Modeline 44:1920x1080i 0 
74250 1920 2008 2052 2200 1080 1084 1094 1125 0x40 0x15
[ 1296.885996] [drm:drm_mode_prune_invalid], Not using 1920x1080i mode 7
[ 1296.887573] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:12:HDMI-A-2] probed modes :
[ 1296.889507] [drm:drm_mode_debug_printmodeline], Modeline 37:1920x1080 50 
148500 1920 2448 2492 2640 1080 1084 1089 1125 0x48 0x5
[ 1296.892084] [drm:drm_mode_debug_printmodeline], Modeline 43:1280x720 50 
74250 1280 1720 1760 1980 720 725 730 750 0x40 0x5
[ 1296.894657] [drm:drm_mode_debug_printmodeline], Modeline 41:1280x720 60 
74250 1280 1390 1430 1650 720 725 730 750 0x40 0x5
[ 1296.897053] [drm:drm_mode_debug_printmodeline], Modeline 32:720x576 50 
27000 720 732 796 864 576 581 586 625 0x40 0xa
[ 1296.899603] [drm:drm_mode_debug_printmodeline], Modeline 29:720x480 60 
27000 720 736 798 858 480 489 495 525 0x40 0xa
[ 1296.901979] [drm:drm_mode_getconnector], [CONNECTOR:12:?]
[ 1296.906084] [drm:drm_mode_getconnector], [CONNECTOR:13:?]
[ 1296.907545] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:13:DP-1]
[ 1296.909659] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.913429] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.917418] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.920908] [drm:intel_dp_detect], DPCD: 
[ 1296.922663] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:13:DP-1] disconnected
[ 1296.924543] [drm:drm_mode_getconnector], [CONNECTOR:13:?]
[ 1296.925793] [drm:drm_helper_probe_single_connector_modes], 
[CONNECTOR:13:DP-1]
[ 1296.927920] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x5145003e
[ 1296.931393] 

[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-19 Thread Wu Fengguang
On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
> On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang  
> wrote:
> 
> > However when in X, ->mode_set won't be called at all.  Only
> > ->get_modes and ->detect are called...
> 
> The desktop software will call mode_set when it configures the
> monitor. Otherwise, it's not being used (and so shouldn't have audio
> routed to it by default).

Thanks for the info! I'll (borrow some monitor and) double check next week.

Anyway, the first two patches are good and may be taken first.

Thanks,
Fengguang


[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-18 Thread Wu Fengguang
Update: Just tested DP and its working!

However, it's found that hot plug under X won't work...

The previous hot plug tests are done in KMS console which are all
fine: on re-inserting the monitor, ->mode_set will be called and
HDMI/DP audio will be re-enabled and ELD be transfered.

However when in X, ->mode_set won't be called at all.  Only
->get_modes and ->detect are called...

Thanks,
Fengguang

On Wed, Nov 16, 2011 at 09:35:48PM +0800, Wu Fengguang wrote:
> Sorry forgot to remove this left over chunk...
> 
> Note that I've not yet got the hardware to test the DisplayPort part
> of this patch, but should be able to do so this week.
> 
> > --- linux.orig/drivers/gpu/drm/i915/intel_drv.h 2011-11-16 
> > 20:54:27.0 +0800
> > +++ linux/drivers/gpu/drm/i915/intel_drv.h  2011-11-16 21:19:42.0 
> > +0800
> > @@ -382,6 +382,10 @@ extern void intel_fb_restore_mode(struct
> >  extern void intel_init_clock_gating(struct drm_device *dev);
> >  extern void intel_write_eld(struct drm_encoder *encoder,
> > struct drm_display_mode *mode);
> > +extern void intel_hotplug_status(struct drm_device *dev,
> > + struct drm_connector *connector,
> > + struct drm_crtc *crtc,
> > + enum drm_connector_status status);
> >  extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe);
> >  
> >  #endif /* __INTEL_DRV_H__ */


[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-18 Thread Keith Packard
On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang  
wrote:

> However when in X, ->mode_set won't be called at all.  Only
> ->get_modes and ->detect are called...

The desktop software will call mode_set when it configures the
monitor. Otherwise, it's not being used (and so shouldn't have audio
routed to it by default).

-- 
keith.packard at intel.com
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: 



Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-18 Thread Keith Packard
On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang fengguang...@intel.com wrote:

 However when in X, -mode_set won't be called at all.  Only
 -get_modes and -detect are called...

The desktop software will call mode_set when it configures the
monitor. Otherwise, it's not being used (and so shouldn't have audio
routed to it by default).

-- 
keith.pack...@intel.com


pgpXrM48veW26.pgp
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-18 Thread Wu Fengguang
On Sat, Nov 19, 2011 at 01:46:44AM +0800, Keith Packard wrote:
 On Fri, 18 Nov 2011 17:37:40 +0800, Wu Fengguang fengguang...@intel.com 
 wrote:
 
  However when in X, -mode_set won't be called at all.  Only
  -get_modes and -detect are called...
 
 The desktop software will call mode_set when it configures the
 monitor. Otherwise, it's not being used (and so shouldn't have audio
 routed to it by default).

Thanks for the info! I'll (borrow some monitor and) double check next week.

Anyway, the first two patches are good and may be taken first.

Thanks,
Fengguang
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-16 Thread Wu Fengguang
Sorry forgot to remove this left over chunk...

Note that I've not yet got the hardware to test the DisplayPort part
of this patch, but should be able to do so this week.

> --- linux.orig/drivers/gpu/drm/i915/intel_drv.h   2011-11-16 
> 20:54:27.0 +0800
> +++ linux/drivers/gpu/drm/i915/intel_drv.h2011-11-16 21:19:42.0 
> +0800
> @@ -382,6 +382,10 @@ extern void intel_fb_restore_mode(struct
>  extern void intel_init_clock_gating(struct drm_device *dev);
>  extern void intel_write_eld(struct drm_encoder *encoder,
>   struct drm_display_mode *mode);
> +extern void intel_hotplug_status(struct drm_device *dev,
> +   struct drm_connector *connector,
> +   struct drm_crtc *crtc,
> +   enum drm_connector_status status);
>  extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe);
>  
>  #endif /* __INTEL_DRV_H__ */


[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-16 Thread Wu Fengguang
An embedded and charset-unspecified text was scrubbed...
Name: eld-hot-removal
URL: 



[PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-16 Thread Wu Fengguang
On monitor hot removal:

1) clear SDVO_AUDIO_ENABLE or DP_AUDIO_OUTPUT_ENABLE
2) clear ELD Valid bit

So that the audio driver will receive hot plug events and take action to
refresh its device state and ELD contents.

cc: Wang Zhenyu zhenyu.z.w...@intel.com
Signed-off-by: Wu Fengguang fengguang...@intel.com
---
 drivers/gpu/drm/drm_crtc_helper.c |4 
 drivers/gpu/drm/i915/intel_dp.c   |   17 +
 drivers/gpu/drm/i915/intel_drv.h  |4 
 drivers/gpu/drm/i915/intel_hdmi.c |   17 +
 include/drm/drm_crtc.h|1 +
 5 files changed, 43 insertions(+)

--- linux.orig/drivers/gpu/drm/i915/intel_dp.c  2011-11-16 20:54:28.0 
+0800
+++ linux/drivers/gpu/drm/i915/intel_dp.c   2011-11-16 21:19:42.0 
+0800
@@ -1984,6 +1984,22 @@ intel_dp_detect(struct drm_connector *co
return connector_status_connected;
 }
 
+static void intel_dp_hot_remove(struct drm_connector *connector)
+{
+   struct intel_dp *intel_dp = intel_attached_dp(connector);
+   struct drm_device *dev = intel_dp-base.base.dev;
+   struct drm_i915_private *dev_priv = dev-dev_private;
+   struct drm_crtc *crtc = intel_dp-base.base.crtc;
+
+   intel_dp-DP = ~DP_AUDIO_OUTPUT_ENABLE;
+   I915_WRITE(intel_dp-output_reg, intel_dp-DP);
+   POSTING_READ(intel_dp-output_reg);
+
+   connector-eld[0] = 0;
+   if (dev_priv-display.write_eld)
+   dev_priv-display.write_eld(connector, crtc);
+}
+
 static int intel_dp_get_modes(struct drm_connector *connector)
 {
struct intel_dp *intel_dp = intel_attached_dp(connector);
@@ -2143,6 +2159,7 @@ static const struct drm_connector_funcs 
.detect = intel_dp_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.set_property = intel_dp_set_property,
+   .hot_remove = intel_dp_hot_remove,
.destroy = intel_dp_destroy,
 };
 
--- linux.orig/drivers/gpu/drm/i915/intel_drv.h 2011-11-16 20:54:27.0 
+0800
+++ linux/drivers/gpu/drm/i915/intel_drv.h  2011-11-16 21:19:42.0 
+0800
@@ -382,6 +382,10 @@ extern void intel_fb_restore_mode(struct
 extern void intel_init_clock_gating(struct drm_device *dev);
 extern void intel_write_eld(struct drm_encoder *encoder,
struct drm_display_mode *mode);
+extern void intel_hotplug_status(struct drm_device *dev,
+ struct drm_connector *connector,
+ struct drm_crtc *crtc,
+ enum drm_connector_status status);
 extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe);
 
 #endif /* __INTEL_DRV_H__ */
--- linux.orig/drivers/gpu/drm/i915/intel_hdmi.c2011-11-16 
20:55:13.0 +0800
+++ linux/drivers/gpu/drm/i915/intel_hdmi.c 2011-11-16 21:19:42.0 
+0800
@@ -350,6 +350,22 @@ intel_hdmi_detect(struct drm_connector *
return status;
 }
 
+static void intel_hdmi_hot_remove(struct drm_connector *connector)
+{
+   struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
+   struct drm_i915_private *dev_priv = connector-dev-dev_private;
+   u32 temp;
+
+   temp = I915_READ(intel_hdmi-sdvox_reg);
+   I915_WRITE(intel_hdmi-sdvox_reg, temp  ~SDVO_AUDIO_ENABLE);
+   POSTING_READ(intel_hdmi-sdvox_reg);
+
+   connector-eld[0] = 0;
+   if (dev_priv-display.write_eld)
+   dev_priv-display.write_eld(connector,
+   intel_hdmi-base.base.crtc);
+}
+
 static int intel_hdmi_get_modes(struct drm_connector *connector)
 {
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
@@ -459,6 +475,7 @@ static const struct drm_connector_funcs 
.detect = intel_hdmi_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.set_property = intel_hdmi_set_property,
+   .hot_remove = intel_hdmi_hot_remove,
.destroy = intel_hdmi_destroy,
 };
 
--- linux.orig/drivers/gpu/drm/drm_crtc_helper.c2011-11-16 
20:55:13.0 +0800
+++ linux/drivers/gpu/drm/drm_crtc_helper.c 2011-11-16 21:19:42.0 
+0800
@@ -905,6 +905,10 @@ static void output_poll_execute(struct w
  old_status, connector-status);
if (old_status != connector-status)
changed = true;
+   if (old_status == connector_status_connected 
+   connector-status == connector_status_disconnected)
+   connector-funcs-hot_remove(connector);
+
}
 
mutex_unlock(dev-mode_config.mutex);
--- linux.orig/include/drm/drm_crtc.h   2011-11-16 20:54:28.0 +0800
+++ linux/include/drm/drm_crtc.h2011-11-16 21:19:42.0 +0800
@@ -419,6 +419,7 @@ struct drm_connector_funcs {
int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, 
uint32_t max_height);
int (*set_property)(struct drm_connector *connector, struct 
drm_property 

Re: [PATCH 3/3] drm/i915: hot removal notification to HDMI audio driver

2011-11-16 Thread Wu Fengguang
Sorry forgot to remove this left over chunk...

Note that I've not yet got the hardware to test the DisplayPort part
of this patch, but should be able to do so this week.

 --- linux.orig/drivers/gpu/drm/i915/intel_drv.h   2011-11-16 
 20:54:27.0 +0800
 +++ linux/drivers/gpu/drm/i915/intel_drv.h2011-11-16 21:19:42.0 
 +0800
 @@ -382,6 +382,10 @@ extern void intel_fb_restore_mode(struct
  extern void intel_init_clock_gating(struct drm_device *dev);
  extern void intel_write_eld(struct drm_encoder *encoder,
   struct drm_display_mode *mode);
 +extern void intel_hotplug_status(struct drm_device *dev,
 +   struct drm_connector *connector,
 +   struct drm_crtc *crtc,
 +   enum drm_connector_status status);
  extern void intel_cpt_verify_modeset(struct drm_device *dev, int pipe);
  
  #endif /* __INTEL_DRV_H__ */
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel