From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FDE3C35247 for ; Tue, 4 Feb 2020 15:11:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A73820730 for ; Tue, 4 Feb 2020 15:11:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A73820730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98D116E846; Tue, 4 Feb 2020 15:11:54 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 341CF6E846 for ; Tue, 4 Feb 2020 15:11:53 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 07:11:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,402,1574150400"; d="scan'208";a="341648157" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 04 Feb 2020 07:11:50 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 04 Feb 2020 17:11:50 +0200 Date: Tue, 4 Feb 2020 17:11:50 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Jani Nikula Message-ID: <20200204151149.GX13686@intel.com> References: <49a456dcf0de7c799dcbab77e830fcc367d6ed9f.1580823606.git.jani.nikula@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <49a456dcf0de7c799dcbab77e830fcc367d6ed9f.1580823606.git.jani.nikula@intel.com> X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH 8/9] drm/i915: move more display related probe/remove stuff to display X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Feb 04, 2020 at 03:42:27PM +0200, Jani Nikula wrote: > With the intel_display_* prove/remove functions clarified, we can "probe", though I wouldn't mind functions that prove the display code/hw works ;) > continue with moving more related calls to the right layer: > = > - drm_vblank_init() > - intel_bios_init() and intel_bios_driver_remove() > - intel_vga_register() and intel_vga_unregister() > - intel_csr_ucode_init() and intel_csr_ucode_fini() > = > Unfortunately, for the time being, we also need to move a call to the > *wrong* layer: the power domain init. > = > v2: move probe failure while at it, power domain init > = > Cc: Ville Syrj=E4l=E4 > Signed-off-by: Jani Nikula > --- > drivers/gpu/drm/i915/display/intel_display.c | 31 ++++++++++++++++ > drivers/gpu/drm/i915/i915_drv.c | 39 +------------------- > 2 files changed, 32 insertions(+), 38 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/d= rm/i915/display/intel_display.c > index 39c12a608103..bf99964d8e4c 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -66,6 +66,7 @@ > #include "intel_bw.h" > #include "intel_cdclk.h" > #include "intel_color.h" > +#include "intel_csr.h" > #include "intel_display_types.h" > #include "intel_dp_link_training.h" > #include "intel_fbc.h" > @@ -17859,6 +17860,27 @@ int intel_modeset_init_noirq(struct drm_i915_pri= vate *i915) > { > int ret; > = > + if (i915_inject_probe_failure(i915)) > + return -ENODEV; > + > + if (HAS_DISPLAY(i915) && INTEL_DISPLAY_ENABLED(i915)) { > + ret =3D drm_vblank_init(&i915->drm, > + INTEL_NUM_PIPES(i915)); > + if (ret) > + goto out; > + } > + > + intel_bios_init(i915); > + > + ret =3D intel_vga_register(i915); > + if (ret) > + goto out; > + > + /* FIXME: completely on the wrong abstraction layer */ > + intel_power_domains_init_hw(i915, false); > + > + intel_csr_ucode_init(i915); > + > i915->modeset_wq =3D alloc_ordered_workqueue("i915_modeset", 0); > i915->flip_wq =3D alloc_workqueue("i915_flip", WQ_HIGHPRI | > WQ_UNBOUND, WQ_UNBOUND_MAX_ACTIVE); > @@ -17882,6 +17904,9 @@ int intel_modeset_init_noirq(struct drm_i915_priv= ate *i915) > intel_fbc_init(i915); > = > return 0; > + > +out: > + return ret; Empty label seems a bit pointless. But I guess we're at least missing a intel_bios_driver_remove() call here. Hmm, the remove doesn't seem to be the reverse of this either. Oh well. Reviewed-by: Ville Syrj=E4l=E4 > } > = > /* part #2: call after irq install, but before gem init */ > @@ -18905,6 +18930,12 @@ void intel_modeset_driver_remove_noirq(struct dr= m_i915_private *i915) > destroy_workqueue(i915->modeset_wq); > = > intel_fbc_cleanup_cfb(i915); > + > + intel_bios_driver_remove(i915); > + > + intel_vga_unregister(i915); > + > + intel_csr_ucode_fini(i915); > } > = > #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR) > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_= drv.c > index 21f07709dc9e..fca693ad6cd7 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -275,38 +275,7 @@ intel_teardown_mchbar(struct drm_i915_private *dev_p= riv) > /* part #1: call before irq install */ > static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915) > { > - int ret; > - > - if (i915_inject_probe_failure(i915)) > - return -ENODEV; > - > - if (HAS_DISPLAY(i915) && INTEL_DISPLAY_ENABLED(i915)) { > - ret =3D drm_vblank_init(&i915->drm, > - INTEL_NUM_PIPES(i915)); > - if (ret) > - goto out; > - } > - > - intel_bios_init(i915); > - > - ret =3D intel_vga_register(i915); > - if (ret) > - goto out; > - > - intel_power_domains_init_hw(i915, false); > - > - intel_csr_ucode_init(i915); > - > - ret =3D intel_modeset_init_noirq(i915); > - if (ret) > - goto cleanup_vga_client; > - > - return 0; > - > -cleanup_vga_client: > - intel_vga_unregister(i915); > -out: > - return ret; > + return intel_modeset_init_noirq(i915); > } > = > /* part #2: call after irq install */ > @@ -353,12 +322,6 @@ static void i915_driver_modeset_remove(struct drm_i9= 15_private *i915) > static void i915_driver_modeset_remove_noirq(struct drm_i915_private *i9= 15) > { > intel_modeset_driver_remove_noirq(i915); > - > - intel_bios_driver_remove(i915); > - > - intel_vga_unregister(i915); > - > - intel_csr_ucode_fini(i915); > } > = > static void intel_init_dpio(struct drm_i915_private *dev_priv) > -- = > 2.20.1 -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx