From: Zhenyu Wang Subject: Re: [PATCH V3 3/3] i915: introduce modeset_on_resume Date: Fri, 25 Jan 2013 09:59:20 +0800 Message-ID: <20130125015920.GP14671@zhen-devel.sh.intel.com> References: <1359027830-2542-1-git-send-email-rui.zhang@intel.com> <1359027830-2542-3-git-send-email-rui.zhang@intel.com> <1359028180.2299.4.camel@rzhang1-mobl4> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1047441805==" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id DAFE1E6D14 for ; Thu, 24 Jan 2013 18:00:29 -0800 (PST) In-Reply-To: <1359028180.2299.4.camel@rzhang1-mobl4> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Zhang Rui Cc: acpi@linux.intel.com, intel-gfx , rafael.j.wysocki@intel.com, arjan@linux.intel.com List-Id: intel-gfx@lists.freedesktop.org --===============1047441805== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SuSGaIqs99hP22V3" Content-Disposition: inline --SuSGaIqs99hP22V3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013.01.24 19:49:40 +0800, Zhang Rui wrote: > I need some graphics experts' comments before sending it out. >=20 Please send to intel-gfx@lists.freedesktop.org for i915 specific issue. > On Thu, 2013-01-24 at 19:43 +0800, Zhang Rui wrote: > > i915 driver needs to do modeset when > > 1. system resumes from sleep > > 2. lid is opened > >=20 > > When resuming from PM_SUSPEND_MEM state, all the GPEs are cleared, > > thus it is the i915_resume code does the modeset rather than intel_lid_= notify(). > >=20 > > But when in FREEZE state, system is still resposive to the lid events. > > 1. i915_suspend() clears modeset_on_lid. > > 2. When we close the lid, intel_lid_notify() sets modeset_on_lid. > > 3. When we reopen the lid, intel_lid_notify() will do a modeset, > > before the system is resumed. > >=20 > > here is the error log I got, > >=20 > > [92146.548074] WARNING: at drivers/gpu/drm/i915/intel_display.c:1028 in= tel_wait_for_pipe_off+0x184/0x190 [i915]() > > [92146.548076] Hardware name: VGN-Z540N > > [92146.548078] pipe_off wait timed out > > [92146.548167] Modules linked in: hid_generic usbhid hid snd_hda_codec_= realtek snd_hda_intel snd_hda_codec parport_pc snd_hwdep ppdev snd_pcm_oss = i915 snd_mixer_oss snd_pcm arc4 iwldvm snd_seq_dummy mac80211 snd_seq_oss s= nd_seq_midi fbcon tileblit font bitblit softcursor drm_kms_helper snd_rawmi= di snd_seq_midi_event coretemp drm snd_seq kvm btusb bluetooth snd_timer iw= lwifi pcmcia tpm_infineon i2c_algo_bit joydev snd_seq_device intel_agp cfg8= 0211 snd intel_gtt yenta_socket pcmcia_rsrc sony_laptop agpgart microcode p= smouse tpm_tis serio_raw mxm_wmi soundcore snd_page_alloc tpm acpi_cpufreq = lpc_ich pcmcia_core tpm_bios mperf processor lp parport firewire_ohci firew= ire_core crc_itu_t sdhci_pci sdhci thermal e1000e > > [92146.548173] Pid: 4304, comm: kworker/0:0 Tainted: G W 3.8.= 0-rc3-s0i3-v3-test+ #9 > > [92146.548175] Call Trace: > > [92146.548189] [] warn_slowpath_common+0x72/0xa0 > > [92146.548227] [] ? intel_wait_for_pipe_off+0x184/0x190 [i91= 5] > > [92146.548263] [] ? intel_wait_for_pipe_off+0x184/0x190 [i91= 5] > > [92146.548270] [] warn_slowpath_fmt+0x33/0x40 > > [92146.548307] [] intel_wait_for_pipe_off+0x184/0x190 [i915] > > [92146.548344] [] intel_disable_pipe+0x102/0x190 [i915] > > [92146.548380] [] ? intel_disable_plane+0x64/0x80 [i915] > > [92146.548417] [] i9xx_crtc_disable+0xbc/0x150 [i915] > > [92146.548456] [] intel_crtc_update_dpms+0x5e/0x90 [i915] > > [92146.548493] [] intel_modeset_setup_hw_state+0x42f/0x8f0 [= i915] > > [92146.548535] [] intel_lid_notify+0x9b/0xc0 [i915] > > [92146.548543] [] notifier_call_chain+0x43/0x60 > > [92146.548550] [] __blocking_notifier_call_chain+0x41/0x80 > > [92146.548556] [] blocking_notifier_call_chain+0x1f/0x30 > > [92146.548563] [] acpi_lid_send_state+0x78/0xa4 > > [92146.548569] [] acpi_button_notify+0x3b/0xf1 > > [92146.548577] [] ? acpi_os_execute+0x17/0x19 > > [92146.548582] [] ? acpi_ec_sync_query+0xa5/0xbc > > [92146.548589] [] acpi_device_notify+0x16/0x18 > > [92146.548595] [] acpi_ev_notify_dispatch+0x38/0x4f > > [92146.548600] [] acpi_os_execute_deferred+0x20/0x2b > > [92146.548607] [] process_one_work+0x128/0x3f0 > > [92146.548613] [] ? common_interrupt+0x33/0x38 > > [92146.548618] [] ? wake_up_worker+0x30/0x30 > > [92146.548624] [] ? acpi_os_wait_events_complete+0x1e/0x1e > > [92146.548629] [] worker_thread+0x119/0x3b0 > > [92146.548634] [] ? manage_workers+0x240/0x240 > > [92146.548640] [] kthread+0x94/0xa0 > > [92146.548647] [] ? ftrace_raw_output_sched_stat_runtime+0x7= 0/0xf0 > > [92146.548652] [] ret_from_kernel_thread+0x1b/0x28 > > [92146.548658] [] ? kthread_create_on_node+0xc0/0xc0 > >=20 > > Introduce a new flag modeset_on_resume to ignore the lid events during = suspend. > >=20 > > Signed-off-by: Zhang Rui > > --- > > drivers/gpu/drm/i915/i915_drv.c | 2 ++ > > drivers/gpu/drm/i915/i915_drv.h | 1 + > > drivers/gpu/drm/i915/intel_lvds.c | 2 ++ > > 3 files changed, 5 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i91= 5_drv.c > > index 1172658..0f990e1 100644 > > --- a/drivers/gpu/drm/i915/i915_drv.c > > +++ b/drivers/gpu/drm/i915/i915_drv.c > > @@ -494,6 +494,7 @@ static int i915_drm_freeze(struct drm_device *dev) > > =20 > > /* Modeset on resume, not lid events */ > > dev_priv->modeset_on_lid =3D 0; > > + dev_priv->modeset_on_resume =3D 1; > > =20 > > console_lock(); > > intel_fbdev_set_suspend(dev, 1); > > @@ -570,6 +571,7 @@ static int __i915_drm_thaw(struct drm_device *dev) > > intel_opregion_init(dev); > > =20 > > dev_priv->modeset_on_lid =3D 0; > > + dev_priv->modeset_on_resume =3D 0; > > =20 > > /* > > * The console lock can be pretty contented on resume due > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i91= 5_drv.h > > index ed30595..a32daeb 100644 > > --- a/drivers/gpu/drm/i915/i915_drv.h > > +++ b/drivers/gpu/drm/i915/i915_drv.h > > @@ -749,6 +749,7 @@ typedef struct drm_i915_private { > > =20 > > /* Register state */ > > bool modeset_on_lid; > > + bool modeset_on_resume; > > =20 > > struct { > > /** Bridge to intel-gtt-ko */ > > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/i= ntel_lvds.c > > index 17aee74..61fbe07 100644 > > --- a/drivers/gpu/drm/i915/intel_lvds.c > > +++ b/drivers/gpu/drm/i915/intel_lvds.c > > @@ -512,6 +512,8 @@ static int intel_lid_notify(struct notifier_block *= nb, unsigned long val, > > if (dev->switch_power_state !=3D DRM_SWITCH_POWER_ON) > > return NOTIFY_OK; > > =20 > > + if (dev_priv->modeset_on_resume) > > + return NOTIFY_OK; > > /* > > * check and update the status of LVDS connector after receiving > > * the LID nofication event. >=20 >=20 --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --SuSGaIqs99hP22V3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlEB5vgACgkQsQQaM014GCdw8gCdEur0MqB0z3IE0xkF9D04cFp5 J4oAn1LbTDm9gaHcXsgzBewVE/c0lvSU =YC08 -----END PGP SIGNATURE----- --SuSGaIqs99hP22V3-- --===============1047441805== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1047441805==--