* [PATCH] drm/i915: Provide a parameter to disable loading
@ 2014-01-16 16:33 Damien Lespiau
2014-01-16 17:07 ` Ville Syrjälä
0 siblings, 1 reply; 4+ messages in thread
From: Damien Lespiau @ 2014-01-16 16:33 UTC (permalink / raw)
To: intel-gfx
It can be handy at times to forbid i915 from loading at startup to
modprobe it later.
In particular, when trying to debug a problem that occurs at startup,
it's usually easier to boot into a working machine and modprobe the
driver at a more convenient time.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 61fb9fc..d80e47e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -38,6 +38,12 @@
#include <linux/module.h>
#include <drm/drm_crtc_helper.h>
+static int i915_fail __read_mostly = 0;
+module_param_named(fail, i915_fail, int, 0400);
+MODULE_PARM_DESC(fail,
+ "Allow a user to skip loading the i915 driver, "
+ "0=load i915 as usual [default], 1=don't load");
+
static int i915_modeset __read_mostly = -1;
module_param_named(modeset, i915_modeset, int, 0400);
MODULE_PARM_DESC(modeset,
@@ -823,6 +829,11 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct intel_device_info *intel_info =
(struct intel_device_info *) ent->driver_data;
+ if (i915_fail) {
+ DRM_INFO("i915 disabled by module parameter\n");
+ return -ENODEV;
+ }
+
if (IS_PRELIMINARY_HW(intel_info) && !i915_preliminary_hw_support) {
DRM_INFO("This hardware requires preliminary hardware support.\n"
"See CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT, and/or modparam preliminary_hw_support\n");
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm/i915: Provide a parameter to disable loading
2014-01-16 16:33 [PATCH] drm/i915: Provide a parameter to disable loading Damien Lespiau
@ 2014-01-16 17:07 ` Ville Syrjälä
2014-01-16 17:11 ` Damien Lespiau
0 siblings, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2014-01-16 17:07 UTC (permalink / raw)
To: Damien Lespiau; +Cc: intel-gfx
On Thu, Jan 16, 2014 at 04:33:26PM +0000, Damien Lespiau wrote:
> It can be handy at times to forbid i915 from loading at startup to
> modprobe it later.
modprobe.blacklist=i915
>
> In particular, when trying to debug a problem that occurs at startup,
> it's usually easier to boot into a working machine and modprobe the
> driver at a more convenient time.
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 61fb9fc..d80e47e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -38,6 +38,12 @@
> #include <linux/module.h>
> #include <drm/drm_crtc_helper.h>
>
> +static int i915_fail __read_mostly = 0;
> +module_param_named(fail, i915_fail, int, 0400);
> +MODULE_PARM_DESC(fail,
> + "Allow a user to skip loading the i915 driver, "
> + "0=load i915 as usual [default], 1=don't load");
> +
> static int i915_modeset __read_mostly = -1;
> module_param_named(modeset, i915_modeset, int, 0400);
> MODULE_PARM_DESC(modeset,
> @@ -823,6 +829,11 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> struct intel_device_info *intel_info =
> (struct intel_device_info *) ent->driver_data;
>
> + if (i915_fail) {
> + DRM_INFO("i915 disabled by module parameter\n");
> + return -ENODEV;
> + }
> +
> if (IS_PRELIMINARY_HW(intel_info) && !i915_preliminary_hw_support) {
> DRM_INFO("This hardware requires preliminary hardware support.\n"
> "See CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT, and/or modparam preliminary_hw_support\n");
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/i915: Provide a parameter to disable loading
2014-01-16 17:07 ` Ville Syrjälä
@ 2014-01-16 17:11 ` Damien Lespiau
2014-06-02 14:16 ` Jani Nikula
0 siblings, 1 reply; 4+ messages in thread
From: Damien Lespiau @ 2014-01-16 17:11 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
On Thu, Jan 16, 2014 at 07:07:09PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 16, 2014 at 04:33:26PM +0000, Damien Lespiau wrote:
> > It can be handy at times to forbid i915 from loading at startup to
> > modprobe it later.
>
> modprobe.blacklist=i915
Ah, yeah, that works.
--
Damien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Provide a parameter to disable loading
2014-01-16 17:11 ` Damien Lespiau
@ 2014-06-02 14:16 ` Jani Nikula
0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2014-06-02 14:16 UTC (permalink / raw)
To: Damien Lespiau, Ville Syrjälä; +Cc: intel-gfx
On Thu, 16 Jan 2014, Damien Lespiau <damien.lespiau@intel.com> wrote:
> On Thu, Jan 16, 2014 at 07:07:09PM +0200, Ville Syrjälä wrote:
>> On Thu, Jan 16, 2014 at 04:33:26PM +0000, Damien Lespiau wrote:
>> > It can be handy at times to forbid i915 from loading at startup to
>> > modprobe it later.
>>
>> modprobe.blacklist=i915
>
> Ah, yeah, that works.
Except when it doesn't, e.g. when a distro explicitly modprobes at boot.
Damien, care to resurrect the patch please?
BR,
Jani.
>
> --
> Damien
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-02 14:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 16:33 [PATCH] drm/i915: Provide a parameter to disable loading Damien Lespiau
2014-01-16 17:07 ` Ville Syrjälä
2014-01-16 17:11 ` Damien Lespiau
2014-06-02 14:16 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox