All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path
@ 2018-03-30 20:45 Takashi Iwai
       [not found] ` <20180330204512.16863-1-tiwai-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Takashi Iwai @ 2018-03-30 20:45 UTC (permalink / raw)
  To: Alex Deucher; +Cc: David Airlie, dri-devel, Christian König, amd-gfx

amdgpu driver checks vgacon_text_force() after some initializations
but without cleaning up.  This will result in leaks.

Move the check of vgacon_text_force() to the beginning of
amdgpu_init() for fixing it and also for optimization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 50afcf65181a..e55792d3cd12 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -905,6 +905,11 @@ static int __init amdgpu_init(void)
 {
 	int r;
 
+	if (vgacon_text_force()) {
+		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
+		return -EINVAL;
+	}
+
 	r = amdgpu_sync_init();
 	if (r)
 		goto error_sync;
@@ -913,10 +918,6 @@ static int __init amdgpu_init(void)
 	if (r)
 		goto error_fence;
 
-	if (vgacon_text_force()) {
-		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
-		return -EINVAL;
-	}
 	DRM_INFO("amdgpu kernel modesetting enabled.\n");
 	driver = &kms_driver;
 	pdriver = &amdgpu_kms_pci_driver;
-- 
2.16.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found] ` <20180330204512.16863-1-tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2018-03-30 20:45   ` Takashi Iwai
       [not found]     ` <20180330204512.16863-2-tiwai-l3A5Bk7waGM@public.gmane.org>
  2018-04-02 17:36   ` [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path Alex Deucher
  1 sibling, 1 reply; 27+ messages in thread
From: Takashi Iwai @ 2018-03-30 20:45 UTC (permalink / raw)
  To: Alex Deucher
  Cc: David Airlie, David Zhou,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Christian König,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

amdgpu driver lacks of modeset module option other drm drivers provide
for enforcing or disabling the driver load.  Interestingly, the
amdgpu_mode variable declaration is already found in the header file,
but the actual implementation seems to have been forgotten.

This patch adds the missing piece.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index e55792d3cd12..029d95ecd26b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -78,6 +78,7 @@
 #define KMS_DRIVER_MINOR	23
 #define KMS_DRIVER_PATCHLEVEL	0
 
+int amdgpu_modeset = -1;
 int amdgpu_vram_limit = 0;
 int amdgpu_vis_vram_limit = 0;
 int amdgpu_gart_size = -1; /* auto */
@@ -130,6 +131,9 @@ int amdgpu_lbpw = -1;
 int amdgpu_compute_multipipe = -1;
 int amdgpu_gpu_recovery = -1; /* auto */
 
+MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
+module_param_named(modeset, amdgpu_modeset, int, 0400);
+
 MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
 module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
 
@@ -905,10 +909,12 @@ static int __init amdgpu_init(void)
 {
 	int r;
 
-	if (vgacon_text_force()) {
+	if (vgacon_text_force() && amdgpu_modeset == -1) {
 		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
 		return -EINVAL;
 	}
+	if (amdgpu_modeset == 0)
+		return -EINVAL;
 
 	r = amdgpu_sync_init();
 	if (r)
-- 
2.16.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]     ` <20180330204512.16863-2-tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2018-04-01 17:39       ` Christian König
       [not found]         ` <c95f9e61-c921-42de-9e03-851d785ab5fc-5C7GfCeVMHo@public.gmane.org>
  2019-09-25  8:07       ` Dave Airlie
  1 sibling, 1 reply; 27+ messages in thread
From: Christian König @ 2018-04-01 17:39 UTC (permalink / raw)
  To: Takashi Iwai, Alex Deucher
  Cc: David Airlie, David Zhou,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> amdgpu driver lacks of modeset module option other drm drivers provide
> for enforcing or disabling the driver load.  Interestingly, the
> amdgpu_mode variable declaration is already found in the header file,
> but the actual implementation seems to have been forgotten.
>
> This patch adds the missing piece.

NAK, modesetting is mandatory for amdgpu and we should probably remove 
the option to disable it from other DRM drivers without UMS support as 
well (pretty much all of them now).

If you want to prevent a driver from loading I think the correct way to 
do so is to give modprobe.blacklist=amdgpu on the kernel commandline.

That would remove the possibility to prevent the driver from loading 
when it is compiled in, but I don't see much of a problem with that.

Christian.

>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index e55792d3cd12..029d95ecd26b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -78,6 +78,7 @@
>   #define KMS_DRIVER_MINOR	23
>   #define KMS_DRIVER_PATCHLEVEL	0
>   
> +int amdgpu_modeset = -1;
>   int amdgpu_vram_limit = 0;
>   int amdgpu_vis_vram_limit = 0;
>   int amdgpu_gart_size = -1; /* auto */
> @@ -130,6 +131,9 @@ int amdgpu_lbpw = -1;
>   int amdgpu_compute_multipipe = -1;
>   int amdgpu_gpu_recovery = -1; /* auto */
>   
> +MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
> +module_param_named(modeset, amdgpu_modeset, int, 0400);
> +
>   MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
>   module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
>   
> @@ -905,10 +909,12 @@ static int __init amdgpu_init(void)
>   {
>   	int r;
>   
> -	if (vgacon_text_force()) {
> +	if (vgacon_text_force() && amdgpu_modeset == -1) {
>   		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
>   		return -EINVAL;
>   	}
> +	if (amdgpu_modeset == 0)
> +		return -EINVAL;
>   
>   	r = amdgpu_sync_init();
>   	if (r)

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]         ` <c95f9e61-c921-42de-9e03-851d785ab5fc-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-01 17:45           ` Ilia Mirkin
  2018-04-01 17:58             ` Christian König
       [not found]             ` <CAKb7Uvh_CxE=Zg_F0tentwXK64_baxs0TCQ-K9Mh_Mjf+NV_DA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 2 replies; 27+ messages in thread
From: Ilia Mirkin @ 2018-04-01 17:45 UTC (permalink / raw)
  To: Christian König
  Cc: Takashi Iwai, Alex Deucher, David Airlie, amd-gfx mailing list,
	dri-devel

On Sun, Apr 1, 2018 at 1:39 PM, Christian König
<christian.koenig@amd.com> wrote:
> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>
>> amdgpu driver lacks of modeset module option other drm drivers provide
>> for enforcing or disabling the driver load.  Interestingly, the
>> amdgpu_mode variable declaration is already found in the header file,
>> but the actual implementation seems to have been forgotten.
>>
>> This patch adds the missing piece.
>
>
> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> option to disable it from other DRM drivers without UMS support as well
> (pretty much all of them now).
>
> If you want to prevent a driver from loading I think the correct way to do
> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>
> That would remove the possibility to prevent the driver from loading when it
> is compiled in, but I don't see much of a problem with that.

Having a way to kill the graphics driver is a very useful debugging
tool, and also a quick and easy way to get out of an unpleasant
situation where graphics are messed up / system hangs / etc. The
modprobe blacklist kernel arg only works in certain environments (and
only if it's a module).

Every other DRM driver has this and this is a well-documented
workaround for "graphics are messed up when I install linux", why not
allow a uniform experience for the end users who are just trying to
get their systems up and running?

  -ilia
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
  2018-04-01 17:45           ` Ilia Mirkin
@ 2018-04-01 17:58             ` Christian König
       [not found]               ` <706f4d0d-4583-2c8a-447d-f6cdd3429ad5-5C7GfCeVMHo@public.gmane.org>
       [not found]             ` <CAKb7Uvh_CxE=Zg_F0tentwXK64_baxs0TCQ-K9Mh_Mjf+NV_DA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 27+ messages in thread
From: Christian König @ 2018-04-01 17:58 UTC (permalink / raw)
  To: Ilia Mirkin; +Cc: Alex Deucher, David Airlie, amd-gfx mailing list, dri-devel

Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> <christian.koenig@amd.com> wrote:
>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>> for enforcing or disabling the driver load.  Interestingly, the
>>> amdgpu_mode variable declaration is already found in the header file,
>>> but the actual implementation seems to have been forgotten.
>>>
>>> This patch adds the missing piece.
>>
>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>> option to disable it from other DRM drivers without UMS support as well
>> (pretty much all of them now).
>>
>> If you want to prevent a driver from loading I think the correct way to do
>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>
>> That would remove the possibility to prevent the driver from loading when it
>> is compiled in, but I don't see much of a problem with that.
> Having a way to kill the graphics driver is a very useful debugging
> tool, and also a quick and easy way to get out of an unpleasant
> situation where graphics are messed up / system hangs / etc. The
> modprobe blacklist kernel arg only works in certain environments (and
> only if it's a module).
>
> Every other DRM driver has this and this is a well-documented
> workaround for "graphics are messed up when I install linux", why not
> allow a uniform experience for the end users who are just trying to
> get their systems up and running?

Because it is not well documented and repeated over and over again in 
drivers.

The problem is that people don't realized that the driver isn't loaded 
at all without the modeset=0 module option and demand fixing the 
resulting bad performance without modesetting.

I can't count how often I had to explain that this approach won't work. 
We could rename it to something like disable_gfx_accel or something like 
that to make this clear.

Christian.

>
>    -ilia

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]               ` <706f4d0d-4583-2c8a-447d-f6cdd3429ad5-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-01 18:21                 ` Takashi Iwai
       [not found]                   ` <s5ho9j24wk9.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Takashi Iwai @ 2018-04-01 18:21 UTC (permalink / raw)
  To: Christian K6nig
  Cc: Alex Deucher, David Airlie, amd-gfx mailing list, dri-devel, Ilia Mirkin

On Sun, 01 Apr 2018 19:58:11 +0200,
Christian K6nig wrote:
> 
> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
> > On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> > <christian.koenig@amd.com> wrote:
> >> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> >>> amdgpu driver lacks of modeset module option other drm drivers provide
> >>> for enforcing or disabling the driver load.  Interestingly, the
> >>> amdgpu_mode variable declaration is already found in the header file,
> >>> but the actual implementation seems to have been forgotten.
> >>>
> >>> This patch adds the missing piece.
> >>
> >> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> >> option to disable it from other DRM drivers without UMS support as well
> >> (pretty much all of them now).
> >>
> >> If you want to prevent a driver from loading I think the correct way to do
> >> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> >>
> >> That would remove the possibility to prevent the driver from loading when it
> >> is compiled in, but I don't see much of a problem with that.
> > Having a way to kill the graphics driver is a very useful debugging
> > tool, and also a quick and easy way to get out of an unpleasant
> > situation where graphics are messed up / system hangs / etc. The
> > modprobe blacklist kernel arg only works in certain environments (and
> > only if it's a module).
> >
> > Every other DRM driver has this and this is a well-documented
> > workaround for "graphics are messed up when I install linux", why not
> > allow a uniform experience for the end users who are just trying to
> > get their systems up and running?
> 
> Because it is not well documented and repeated over and over again in
> drivers.
> 
> The problem is that people don't realized that the driver isn't loaded
> at all without the modeset=0 module option and demand fixing the
> resulting bad performance without modesetting.

Hm, I don't get it.  What this options has to do with performance for
a KMS-only driver...?

> I can't count how often I had to explain that this approach won't
> work. We could rename it to something like disable_gfx_accel or
> something like that to make this clear.

Maybe it's a different view from a different perspective.
 From the distro side, nomodeset and the force reload via modeset
option has been the most reliable way to achieve the purpose, so far.
It's easier especially when the system has a hybrid graphics.

It might be not same for developers, though.


thanks,

Takashi
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                   ` <s5ho9j24wk9.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2018-04-01 20:12                     ` Christian König
       [not found]                       ` <0ecce204-6af8-2395-ac40-391e3b655bed-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Christian König @ 2018-04-01 20:12 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Alex Deucher, David Airlie, amd-gfx mailing list, dri-devel, Ilia Mirkin

Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
> On Sun, 01 Apr 2018 19:58:11 +0200,
> Christian K6nig wrote:
>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>> <christian.koenig@amd.com> wrote:
>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>> but the actual implementation seems to have been forgotten.
>>>>>
>>>>> This patch adds the missing piece.
>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>> option to disable it from other DRM drivers without UMS support as well
>>>> (pretty much all of them now).
>>>>
>>>> If you want to prevent a driver from loading I think the correct way to do
>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>
>>>> That would remove the possibility to prevent the driver from loading when it
>>>> is compiled in, but I don't see much of a problem with that.
>>> Having a way to kill the graphics driver is a very useful debugging
>>> tool, and also a quick and easy way to get out of an unpleasant
>>> situation where graphics are messed up / system hangs / etc. The
>>> modprobe blacklist kernel arg only works in certain environments (and
>>> only if it's a module).
>>>
>>> Every other DRM driver has this and this is a well-documented
>>> workaround for "graphics are messed up when I install linux", why not
>>> allow a uniform experience for the end users who are just trying to
>>> get their systems up and running?
>> Because it is not well documented and repeated over and over again in
>> drivers.
>>
>> The problem is that people don't realized that the driver isn't loaded
>> at all without the modeset=0 module option and demand fixing the
>> resulting bad performance without modesetting.
> Hm, I don't get it.  What this options has to do with performance for
> a KMS-only driver...?

Well exactly that's the point, nothing.

The problem is that the option name is confusing to the end user because 
the expectation is that "nomodeset" just means that they only can't 
change the display mode.

Some (unfortunately quite a lot) people don't realize that for KMS 
drivers this means that the driver isn't even loaded and they also don't 
get any acceleration.

We had to explain that numerous times now. I think it would be best to 
give the option a more meaningful name.

Christian.

>> I can't count how often I had to explain that this approach won't
>> work. We could rename it to something like disable_gfx_accel or
>> something like that to make this clear.
> Maybe it's a different view from a different perspective.
>   From the distro side, nomodeset and the force reload via modeset
> option has been the most reliable way to achieve the purpose, so far.
> It's easier especially when the system has a hybrid graphics.
>
> It might be not same for developers, though.
>
>
> thanks,
>
> Takashi

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path
       [not found] ` <20180330204512.16863-1-tiwai-l3A5Bk7waGM@public.gmane.org>
  2018-03-30 20:45   ` [PATCH 2/2] drm/amdgpu: Add modeset module option Takashi Iwai
@ 2018-04-02 17:36   ` Alex Deucher
  1 sibling, 0 replies; 27+ messages in thread
From: Alex Deucher @ 2018-04-02 17:36 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Alex Deucher, David Airlie, amd-gfx list, Christian König,
	Maling list - DRI developers

On Fri, Mar 30, 2018 at 4:45 PM, Takashi Iwai <tiwai@suse.de> wrote:
> amdgpu driver checks vgacon_text_force() after some initializations
> but without cleaning up.  This will result in leaks.
>
> Move the check of vgacon_text_force() to the beginning of
> amdgpu_init() for fixing it and also for optimization.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 50afcf65181a..e55792d3cd12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -905,6 +905,11 @@ static int __init amdgpu_init(void)
>  {
>         int r;
>
> +       if (vgacon_text_force()) {
> +               DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
> +               return -EINVAL;
> +       }
> +
>         r = amdgpu_sync_init();
>         if (r)
>                 goto error_sync;
> @@ -913,10 +918,6 @@ static int __init amdgpu_init(void)
>         if (r)
>                 goto error_fence;
>
> -       if (vgacon_text_force()) {
> -               DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
> -               return -EINVAL;
> -       }
>         DRM_INFO("amdgpu kernel modesetting enabled.\n");
>         driver = &kms_driver;
>         pdriver = &amdgpu_kms_pci_driver;
> --
> 2.16.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]             ` <CAKb7Uvh_CxE=Zg_F0tentwXK64_baxs0TCQ-K9Mh_Mjf+NV_DA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-04-03  8:36               ` Michel Dänzer
  2018-04-03  8:57                 ` Christian König
  0 siblings, 1 reply; 27+ messages in thread
From: Michel Dänzer @ 2018-04-03  8:36 UTC (permalink / raw)
  To: Ilia Mirkin, Christian König
  Cc: Takashi Iwai, Alex Deucher, David Airlie, dri-devel,
	amd-gfx mailing list

On 2018-04-01 07:45 PM, Ilia Mirkin wrote:
> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> <christian.koenig@amd.com> wrote:
>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>
>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>> for enforcing or disabling the driver load.  Interestingly, the
>>> amdgpu_mode variable declaration is already found in the header file,
>>> but the actual implementation seems to have been forgotten.
>>>
>>> This patch adds the missing piece.
>>
>>
>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>> option to disable it from other DRM drivers without UMS support as well
>> (pretty much all of them now).
>>
>> If you want to prevent a driver from loading I think the correct way to do
>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>
>> That would remove the possibility to prevent the driver from loading when it
>> is compiled in, but I don't see much of a problem with that.
> 
> Having a way to kill the graphics driver is a very useful debugging
> tool, and also a quick and easy way to get out of an unpleasant
> situation where graphics are messed up / system hangs / etc. The
> modprobe blacklist kernel arg only works in certain environments (and
> only if it's a module).

Building amdgpu into the kernel isn't feasible for a generic kernel such
as a distro one, because it would require including all microcode into
the kernel as well (12M right now, and growing).

If a user decides to build amdgpu into their custom kernel and runs into
trouble due to that, that's "doctor, it hurts if I do this" territory.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
  2018-04-03  8:36               ` Michel Dänzer
@ 2018-04-03  8:57                 ` Christian König
       [not found]                   ` <781c3a0b-e199-c637-410a-521fe5fd5170-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Christian König @ 2018-04-03  8:57 UTC (permalink / raw)
  To: Michel Dänzer, Ilia Mirkin
  Cc: Alex Deucher, David Airlie, dri-devel, amd-gfx mailing list

Am 03.04.2018 um 10:36 schrieb Michel Dänzer:
> On 2018-04-01 07:45 PM, Ilia Mirkin wrote:
>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>> <christian.koenig@amd.com> wrote:
>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>> amdgpu_mode variable declaration is already found in the header file,
>>>> but the actual implementation seems to have been forgotten.
>>>>
>>>> This patch adds the missing piece.
>>>
>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>> option to disable it from other DRM drivers without UMS support as well
>>> (pretty much all of them now).
>>>
>>> If you want to prevent a driver from loading I think the correct way to do
>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>
>>> That would remove the possibility to prevent the driver from loading when it
>>> is compiled in, but I don't see much of a problem with that.
>> Having a way to kill the graphics driver is a very useful debugging
>> tool, and also a quick and easy way to get out of an unpleasant
>> situation where graphics are messed up / system hangs / etc. The
>> modprobe blacklist kernel arg only works in certain environments (and
>> only if it's a module).
> Building amdgpu into the kernel isn't feasible for a generic kernel such
> as a distro one, because it would require including all microcode into
> the kernel as well (12M right now, and growing).
>
> If a user decides to build amdgpu into their custom kernel and runs into
> trouble due to that, that's "doctor, it hurts if I do this" territory.

Correct, but I agree that even in this situation it would be very 
helpful to prevent the gfx drivers from loading and fallback to 
efifb/vesafd (or whatever the platform provides).

It's just that the "nomodeset" and "amdgpu.modeset=0" options are really 
not well named for this task.

Christian.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                   ` <781c3a0b-e199-c637-410a-521fe5fd5170-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-03  9:02                     ` Takashi Iwai
       [not found]                       ` <s5hpo3g1x4m.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Takashi Iwai @ 2018-04-03  9:02 UTC (permalink / raw)
  To: Christian K6nig
  Cc: David Airlie, Michel D4nzer, dri-devel, amd-gfx mailing list,
	Alex Deucher, Ilia Mirkin

On Tue, 03 Apr 2018 10:57:56 +0200,
Christian K6nig wrote:
> 
> Am 03.04.2018 um 10:36 schrieb Michel Dänzer:
> > On 2018-04-01 07:45 PM, Ilia Mirkin wrote:
> >> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> >> <christian.koenig@amd.com> wrote:
> >>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> >>>> amdgpu driver lacks of modeset module option other drm drivers provide
> >>>> for enforcing or disabling the driver load.  Interestingly, the
> >>>> amdgpu_mode variable declaration is already found in the header file,
> >>>> but the actual implementation seems to have been forgotten.
> >>>>
> >>>> This patch adds the missing piece.
> >>>
> >>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> >>> option to disable it from other DRM drivers without UMS support as well
> >>> (pretty much all of them now).
> >>>
> >>> If you want to prevent a driver from loading I think the correct way to do
> >>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> >>>
> >>> That would remove the possibility to prevent the driver from loading when it
> >>> is compiled in, but I don't see much of a problem with that.
> >> Having a way to kill the graphics driver is a very useful debugging
> >> tool, and also a quick and easy way to get out of an unpleasant
> >> situation where graphics are messed up / system hangs / etc. The
> >> modprobe blacklist kernel arg only works in certain environments (and
> >> only if it's a module).
> > Building amdgpu into the kernel isn't feasible for a generic kernel such
> > as a distro one, because it would require including all microcode into
> > the kernel as well (12M right now, and growing).
> >
> > If a user decides to build amdgpu into their custom kernel and runs into
> > trouble due to that, that's "doctor, it hurts if I do this" territory.
> 
> Correct, but I agree that even in this situation it would be very
> helpful to prevent the gfx drivers from loading and fallback to
> efifb/vesafd (or whatever the platform provides).
> 
> It's just that the "nomodeset" and "amdgpu.modeset=0" options are
> really not well named for this task.

Agreed with the naming mess.  But OTOH, it's already a thing that is
too popular to kill.  You can add a more suitable option name, but you
cannot drop these existing ones easily.  It's already in a gray zone
of the golden "don't break user-space" rule.


thanks,

Takashi
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                       ` <s5hpo3g1x4m.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2018-04-03  9:18                         ` Michel Dänzer
  2018-04-03  9:44                           ` Takashi Iwai
       [not found]                           ` <e4933491-65be-4b31-95de-cf1147dd312c-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 2 replies; 27+ messages in thread
From: Michel Dänzer @ 2018-04-03  9:18 UTC (permalink / raw)
  To: Takashi Iwai, Christian K6nig
  Cc: David Airlie, Alex Deucher, Ilia Mirkin, amd-gfx mailing list, dri-devel

On 2018-04-03 11:02 AM, Takashi Iwai wrote:
> On Tue, 03 Apr 2018 10:57:56 +0200,
> Christian K6nig wrote:
>>
>> Am 03.04.2018 um 10:36 schrieb Michel Dänzer:
>>> On 2018-04-01 07:45 PM, Ilia Mirkin wrote:
>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>>> <christian.koenig@amd.com> wrote:
>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>>> but the actual implementation seems to have been forgotten.
>>>>>>
>>>>>> This patch adds the missing piece.
>>>>>
>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>>> option to disable it from other DRM drivers without UMS support as well
>>>>> (pretty much all of them now).
>>>>>
>>>>> If you want to prevent a driver from loading I think the correct way to do
>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>>
>>>>> That would remove the possibility to prevent the driver from loading when it
>>>>> is compiled in, but I don't see much of a problem with that.
>>>> Having a way to kill the graphics driver is a very useful debugging
>>>> tool, and also a quick and easy way to get out of an unpleasant
>>>> situation where graphics are messed up / system hangs / etc. The
>>>> modprobe blacklist kernel arg only works in certain environments (and
>>>> only if it's a module).
>>> Building amdgpu into the kernel isn't feasible for a generic kernel such
>>> as a distro one, because it would require including all microcode into
>>> the kernel as well (12M right now, and growing).
>>>
>>> If a user decides to build amdgpu into their custom kernel and runs into
>>> trouble due to that, that's "doctor, it hurts if I do this" territory.
>>
>> Correct, but I agree that even in this situation it would be very
>> helpful to prevent the gfx drivers from loading and fallback to
>> efifb/vesafd (or whatever the platform provides).
>>
>> It's just that the "nomodeset" and "amdgpu.modeset=0" options are
>> really not well named for this task.
> 
> Agreed with the naming mess.  But OTOH, it's already a thing that is
> too popular to kill.  You can add a more suitable option name, but you
> cannot drop these existing ones easily.  It's already in a gray zone
> of the golden "don't break user-space" rule.

That's quite a stretch argument, given that amdgpu has never supported
the modeset parameter. Also, module parameters aren't UAPI.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                       ` <0ecce204-6af8-2395-ac40-391e3b655bed-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-03  9:29                         ` Daniel Vetter
       [not found]                           ` <20180403092948.GQ3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
  2018-04-03 13:26                           ` Ilia Mirkin
  0 siblings, 2 replies; 27+ messages in thread
From: Daniel Vetter @ 2018-04-03  9:29 UTC (permalink / raw)
  To: Christian König
  Cc: Takashi Iwai, Alex Deucher, David Airlie, dri-devel,
	amd-gfx mailing list

On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
> > On Sun, 01 Apr 2018 19:58:11 +0200,
> > Christian K6nig wrote:
> > > Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
> > > > On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> > > > <christian.koenig@amd.com> wrote:
> > > > > Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> > > > > > amdgpu driver lacks of modeset module option other drm drivers provide
> > > > > > for enforcing or disabling the driver load.  Interestingly, the
> > > > > > amdgpu_mode variable declaration is already found in the header file,
> > > > > > but the actual implementation seems to have been forgotten.
> > > > > > 
> > > > > > This patch adds the missing piece.
> > > > > NAK, modesetting is mandatory for amdgpu and we should probably remove the
> > > > > option to disable it from other DRM drivers without UMS support as well
> > > > > (pretty much all of them now).
> > > > > 
> > > > > If you want to prevent a driver from loading I think the correct way to do
> > > > > so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> > > > > 
> > > > > That would remove the possibility to prevent the driver from loading when it
> > > > > is compiled in, but I don't see much of a problem with that.
> > > > Having a way to kill the graphics driver is a very useful debugging
> > > > tool, and also a quick and easy way to get out of an unpleasant
> > > > situation where graphics are messed up / system hangs / etc. The
> > > > modprobe blacklist kernel arg only works in certain environments (and
> > > > only if it's a module).
> > > > 
> > > > Every other DRM driver has this and this is a well-documented
> > > > workaround for "graphics are messed up when I install linux", why not
> > > > allow a uniform experience for the end users who are just trying to
> > > > get their systems up and running?
> > > Because it is not well documented and repeated over and over again in
> > > drivers.
> > > 
> > > The problem is that people don't realized that the driver isn't loaded
> > > at all without the modeset=0 module option and demand fixing the
> > > resulting bad performance without modesetting.
> > Hm, I don't get it.  What this options has to do with performance for
> > a KMS-only driver...?
> 
> Well exactly that's the point, nothing.
> 
> The problem is that the option name is confusing to the end user because the
> expectation is that "nomodeset" just means that they only can't change the
> display mode.
> 
> Some (unfortunately quite a lot) people don't realize that for KMS drivers
> this means that the driver isn't even loaded and they also don't get any
> acceleration.
> 
> We had to explain that numerous times now. I think it would be best to give
> the option a more meaningful name.

Yeah, agreed with Christian. If we want a generic "pls disable all gfx
accel" knob then probably best to put that into the drm core. And just
outright fail loading the drm core if that happens, which will prevent all
gfx drivers from loading.

That likely means a hole bunch of stuff won't work (usually sound keels
over too), but that's what you get for this. Only disabling modesetting
without disabling the entire driver doesn't work (never has, except for
this UMS+GEM combo only i915 support, and not for long).

And once we have that knob, probably best to phase out all the per-driver
options.
-Daniel

> 
> Christian.
> 
> > > I can't count how often I had to explain that this approach won't
> > > work. We could rename it to something like disable_gfx_accel or
> > > something like that to make this clear.
> > Maybe it's a different view from a different perspective.
> >   From the distro side, nomodeset and the force reload via modeset
> > option has been the most reliable way to achieve the purpose, so far.
> > It's easier especially when the system has a hybrid graphics.
> > 
> > It might be not same for developers, though.
> > 
> > 
> > thanks,
> > 
> > Takashi
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
  2018-04-03  9:18                         ` Michel Dänzer
@ 2018-04-03  9:44                           ` Takashi Iwai
       [not found]                             ` <s5h1sfwk4ja.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
       [not found]                           ` <e4933491-65be-4b31-95de-cf1147dd312c-otUistvHUpPR7s880joybQ@public.gmane.org>
  1 sibling, 1 reply; 27+ messages in thread
From: Takashi Iwai @ 2018-04-03  9:44 UTC (permalink / raw)
  To: Michel D4nzer
  Cc: David Airlie, amd-gfx mailing list, dri-devel, Alex Deucher,
	Christian K6nig

On Tue, 03 Apr 2018 11:18:34 +0200,
Michel D4nzer wrote:
> 
> On 2018-04-03 11:02 AM, Takashi Iwai wrote:
> > On Tue, 03 Apr 2018 10:57:56 +0200,
> > Christian K6nig wrote:
> >>
> >> Am 03.04.2018 um 10:36 schrieb Michel Dänzer:
> >>> On 2018-04-01 07:45 PM, Ilia Mirkin wrote:
> >>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> >>>> <christian.koenig@amd.com> wrote:
> >>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> >>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
> >>>>>> for enforcing or disabling the driver load.  Interestingly, the
> >>>>>> amdgpu_mode variable declaration is already found in the header file,
> >>>>>> but the actual implementation seems to have been forgotten.
> >>>>>>
> >>>>>> This patch adds the missing piece.
> >>>>>
> >>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> >>>>> option to disable it from other DRM drivers without UMS support as well
> >>>>> (pretty much all of them now).
> >>>>>
> >>>>> If you want to prevent a driver from loading I think the correct way to do
> >>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> >>>>>
> >>>>> That would remove the possibility to prevent the driver from loading when it
> >>>>> is compiled in, but I don't see much of a problem with that.
> >>>> Having a way to kill the graphics driver is a very useful debugging
> >>>> tool, and also a quick and easy way to get out of an unpleasant
> >>>> situation where graphics are messed up / system hangs / etc. The
> >>>> modprobe blacklist kernel arg only works in certain environments (and
> >>>> only if it's a module).
> >>> Building amdgpu into the kernel isn't feasible for a generic kernel such
> >>> as a distro one, because it would require including all microcode into
> >>> the kernel as well (12M right now, and growing).
> >>>
> >>> If a user decides to build amdgpu into their custom kernel and runs into
> >>> trouble due to that, that's "doctor, it hurts if I do this" territory.
> >>
> >> Correct, but I agree that even in this situation it would be very
> >> helpful to prevent the gfx drivers from loading and fallback to
> >> efifb/vesafd (or whatever the platform provides).
> >>
> >> It's just that the "nomodeset" and "amdgpu.modeset=0" options are
> >> really not well named for this task.
> > 
> > Agreed with the naming mess.  But OTOH, it's already a thing that is
> > too popular to kill.  You can add a more suitable option name, but you
> > cannot drop these existing ones easily.  It's already in a gray zone
> > of the golden "don't break user-space" rule.
> 
> That's quite a stretch argument, given that amdgpu has never supported
> the modeset parameter.

Oh I don't mean about my own patch but the foreseen action Christian
mentioned.

> Also, module parameters aren't UAPI.

Right, but we care not only about UAPI.  If the kernel breaks
something, it's a regression.  It's what Linus suggested many times.
The same argument has been applied to proc or sysfs files in the past,
and we had to correct back again.

Don't get me wrong: I'm not always objecting to the removal of any
module existing options.  But if it break a major usage pattern, it's
a problem.  And the removal of nomodeset option would be a kind of
such things, IMO, that's why I mentioned as "a gray zone" in the
above.


thanks,

Takashi
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                           ` <e4933491-65be-4b31-95de-cf1147dd312c-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-04-03  9:53                             ` Jani Nikula
  0 siblings, 0 replies; 27+ messages in thread
From: Jani Nikula @ 2018-04-03  9:53 UTC (permalink / raw)
  To: Michel Dänzer, Takashi Iwai, Christian K6nig
  Cc: David Airlie, Alex Deucher, dri-devel, amd-gfx mailing list

On Tue, 03 Apr 2018, Michel Dänzer <michel@daenzer.net> wrote:
> On 2018-04-03 11:02 AM, Takashi Iwai wrote:
>> Agreed with the naming mess.  But OTOH, it's already a thing that is
>> too popular to kill.  You can add a more suitable option name, but you
>> cannot drop these existing ones easily.  It's already in a gray zone
>> of the golden "don't break user-space" rule.
>
> That's quite a stretch argument, given that amdgpu has never supported
> the modeset parameter.

That much is clear.

> Also, module parameters aren't UAPI.

[citation needed]. I agree with Takashi it's a gray area.

You can have "unsafe" module parameters that taint the kernel when set,
see module_param_unsafe and module_param_named_unsafe. Using those
should make it clear all bets are off.

BR,
Jani.

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                           ` <20180403092948.GQ3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
@ 2018-04-03 11:30                             ` Christian König
  0 siblings, 0 replies; 27+ messages in thread
From: Christian König @ 2018-04-03 11:30 UTC (permalink / raw)
  To: Daniel Vetter, Christian König
  Cc: Takashi Iwai, Alex Deucher, David Airlie, amd-gfx mailing list,
	dri-devel

Am 03.04.2018 um 11:29 schrieb Daniel Vetter:
> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
>> [SNIP]
>> Well exactly that's the point, nothing.
>>
>> The problem is that the option name is confusing to the end user because the
>> expectation is that "nomodeset" just means that they only can't change the
>> display mode.
>>
>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
>> this means that the driver isn't even loaded and they also don't get any
>> acceleration.
>>
>> We had to explain that numerous times now. I think it would be best to give
>> the option a more meaningful name.
> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
> accel" knob then probably best to put that into the drm core. And just
> outright fail loading the drm core if that happens, which will prevent all
> gfx drivers from loading.
>
> That likely means a hole bunch of stuff won't work (usually sound keels
> over too), but that's what you get for this. Only disabling modesetting
> without disabling the entire driver doesn't work (never has, except for
> this UMS+GEM combo only i915 support, and not for long).
>
> And once we have that knob, probably best to phase out all the per-driver
> options.

+ some compability code to keep "nomodeset" working for a while longer 
and printing a warning that the option is deprecated.

If we approach it like that the whole idea sounds rather reasonable to me.

Christian.

> -Daniel
>

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                             ` <s5h1sfwk4ja.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2018-04-03 13:01                               ` Michel Dänzer
  0 siblings, 0 replies; 27+ messages in thread
From: Michel Dänzer @ 2018-04-03 13:01 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: David Airlie, dri-devel, amd-gfx mailing list, Alex Deucher,
	Christian K6nig, Ilia Mirkin

On 2018-04-03 11:44 AM, Takashi Iwai wrote:
> On Tue, 03 Apr 2018 11:18:34 +0200,
> Michel D4nzer wrote:
>>
>> On 2018-04-03 11:02 AM, Takashi Iwai wrote:
>>> On Tue, 03 Apr 2018 10:57:56 +0200,
>>> Christian K6nig wrote:
>>>>
>>>> Am 03.04.2018 um 10:36 schrieb Michel Dänzer:
>>>>> On 2018-04-01 07:45 PM, Ilia Mirkin wrote:
>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>>>>> <christian.koenig@amd.com> wrote:
>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>>>>> but the actual implementation seems to have been forgotten.
>>>>>>>>
>>>>>>>> This patch adds the missing piece.
>>>>>>>
>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>>>>> option to disable it from other DRM drivers without UMS support as well
>>>>>>> (pretty much all of them now).
>>>>>>>
>>>>>>> If you want to prevent a driver from loading I think the correct way to do
>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>>>>
>>>>>>> That would remove the possibility to prevent the driver from loading when it
>>>>>>> is compiled in, but I don't see much of a problem with that.
>>>>>> Having a way to kill the graphics driver is a very useful debugging
>>>>>> tool, and also a quick and easy way to get out of an unpleasant
>>>>>> situation where graphics are messed up / system hangs / etc. The
>>>>>> modprobe blacklist kernel arg only works in certain environments (and
>>>>>> only if it's a module).
>>>>> Building amdgpu into the kernel isn't feasible for a generic kernel such
>>>>> as a distro one, because it would require including all microcode into
>>>>> the kernel as well (12M right now, and growing).
>>>>>
>>>>> If a user decides to build amdgpu into their custom kernel and runs into
>>>>> trouble due to that, that's "doctor, it hurts if I do this" territory.
>>>>
>>>> Correct, but I agree that even in this situation it would be very
>>>> helpful to prevent the gfx drivers from loading and fallback to
>>>> efifb/vesafd (or whatever the platform provides).
>>>>
>>>> It's just that the "nomodeset" and "amdgpu.modeset=0" options are
>>>> really not well named for this task.
>>>
>>> Agreed with the naming mess.  But OTOH, it's already a thing that is
>>> too popular to kill.  You can add a more suitable option name, but you
>>> cannot drop these existing ones easily.  It's already in a gray zone
>>> of the golden "don't break user-space" rule.
>>
>> That's quite a stretch argument, given that amdgpu has never supported
>> the modeset parameter.
> 
> Oh I don't mean about my own patch but the foreseen action Christian
> mentioned.
> 
>> Also, module parameters aren't UAPI.
> 
> Right, but we care not only about UAPI.  If the kernel breaks
> something, it's a regression.  It's what Linus suggested many times.
> The same argument has been applied to proc or sysfs files in the past,
> and we had to correct back again.
> 
> Don't get me wrong: I'm not always objecting to the removal of any
> module existing options.  But if it break a major usage pattern, it's
> a problem.  And the removal of nomodeset option would be a kind of
> such things, IMO, that's why I mentioned as "a gray zone" in the
> above.

Note that nomodeset and the per-driver modeset parameters are separate
things. amdgpu has always supported the former, but has never supported
the latter.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
  2018-04-03  9:29                         ` Daniel Vetter
       [not found]                           ` <20180403092948.GQ3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
@ 2018-04-03 13:26                           ` Ilia Mirkin
       [not found]                             ` <CAKb7UvhG5nO9q1M=6fu6mnChObsskxFzgGXQPUJQCk1Q+E9ffQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 27+ messages in thread
From: Ilia Mirkin @ 2018-04-03 13:26 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Alex Deucher, David Airlie, amd-gfx mailing list,
	Christian König, dri-devel

On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
>> > On Sun, 01 Apr 2018 19:58:11 +0200,
>> > Christian K6nig wrote:
>> > > Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
>> > > > On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>> > > > <christian.koenig@amd.com> wrote:
>> > > > > Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>> > > > > > amdgpu driver lacks of modeset module option other drm drivers provide
>> > > > > > for enforcing or disabling the driver load.  Interestingly, the
>> > > > > > amdgpu_mode variable declaration is already found in the header file,
>> > > > > > but the actual implementation seems to have been forgotten.
>> > > > > >
>> > > > > > This patch adds the missing piece.
>> > > > > NAK, modesetting is mandatory for amdgpu and we should probably remove the
>> > > > > option to disable it from other DRM drivers without UMS support as well
>> > > > > (pretty much all of them now).
>> > > > >
>> > > > > If you want to prevent a driver from loading I think the correct way to do
>> > > > > so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>> > > > >
>> > > > > That would remove the possibility to prevent the driver from loading when it
>> > > > > is compiled in, but I don't see much of a problem with that.
>> > > > Having a way to kill the graphics driver is a very useful debugging
>> > > > tool, and also a quick and easy way to get out of an unpleasant
>> > > > situation where graphics are messed up / system hangs / etc. The
>> > > > modprobe blacklist kernel arg only works in certain environments (and
>> > > > only if it's a module).
>> > > >
>> > > > Every other DRM driver has this and this is a well-documented
>> > > > workaround for "graphics are messed up when I install linux", why not
>> > > > allow a uniform experience for the end users who are just trying to
>> > > > get their systems up and running?
>> > > Because it is not well documented and repeated over and over again in
>> > > drivers.
>> > >
>> > > The problem is that people don't realized that the driver isn't loaded
>> > > at all without the modeset=0 module option and demand fixing the
>> > > resulting bad performance without modesetting.
>> > Hm, I don't get it.  What this options has to do with performance for
>> > a KMS-only driver...?
>>
>> Well exactly that's the point, nothing.
>>
>> The problem is that the option name is confusing to the end user because the
>> expectation is that "nomodeset" just means that they only can't change the
>> display mode.
>>
>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
>> this means that the driver isn't even loaded and they also don't get any
>> acceleration.
>>
>> We had to explain that numerous times now. I think it would be best to give
>> the option a more meaningful name.
>
> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
> accel" knob then probably best to put that into the drm core. And just
> outright fail loading the drm core if that happens, which will prevent all
> gfx drivers from loading.
>
> That likely means a hole bunch of stuff won't work (usually sound keels
> over too), but that's what you get for this. Only disabling modesetting
> without disabling the entire driver doesn't work (never has, except for
> this UMS+GEM combo only i915 support, and not for long).
>
> And once we have that knob, probably best to phase out all the per-driver
> options.

Another use-case that the per-driver disables enable is "i915 works
but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
seems likely this could happen with amdgpu as well.

The current set of capabilities has served developers fairly well in
providing quick debug instructions to mildly-experienced users (i.e.
enough to be able to edit kernel cmdline). I definitely wouldn't want
to lose that.

The names are horrid. I think everyone agrees. In fact, when the
driver is disabled by nomodeset or modeset=0, I think they should
print like "driver completely disabled by modeset option" to avoid
some of the user confusion Christian is referring to (which I've run
into on a number of occasions as well). And/or maybe just refuse the
driver load entirely rather than load-but-do-nothing. However being
able to help users debug things seems more important than users being
occasionally confused by options they added to kernel cmdline.

  -ilia
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                             ` <CAKb7UvhG5nO9q1M=6fu6mnChObsskxFzgGXQPUJQCk1Q+E9ffQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-04-03 13:32                               ` Michel Dänzer
       [not found]                                 ` <ea3e89e9-0a31-604f-c3f4-2693a0f9ca92-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Michel Dänzer @ 2018-04-03 13:32 UTC (permalink / raw)
  To: Ilia Mirkin, Daniel Vetter
  Cc: Alex Deucher, David Airlie, dri-devel, Christian König,
	amd-gfx mailing list

On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
>>>> Christian K6nig wrote:
>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>>>>> <christian.koenig@amd.com> wrote:
>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>>>>> but the actual implementation seems to have been forgotten.
>>>>>>>>
>>>>>>>> This patch adds the missing piece.
>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>>>>> option to disable it from other DRM drivers without UMS support as well
>>>>>>> (pretty much all of them now).
>>>>>>>
>>>>>>> If you want to prevent a driver from loading I think the correct way to do
>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>>>>
>>>>>>> That would remove the possibility to prevent the driver from loading when it
>>>>>>> is compiled in, but I don't see much of a problem with that.
>>>>>> Having a way to kill the graphics driver is a very useful debugging
>>>>>> tool, and also a quick and easy way to get out of an unpleasant
>>>>>> situation where graphics are messed up / system hangs / etc. The
>>>>>> modprobe blacklist kernel arg only works in certain environments (and
>>>>>> only if it's a module).
>>>>>>
>>>>>> Every other DRM driver has this and this is a well-documented
>>>>>> workaround for "graphics are messed up when I install linux", why not
>>>>>> allow a uniform experience for the end users who are just trying to
>>>>>> get their systems up and running?
>>>>> Because it is not well documented and repeated over and over again in
>>>>> drivers.
>>>>>
>>>>> The problem is that people don't realized that the driver isn't loaded
>>>>> at all without the modeset=0 module option and demand fixing the
>>>>> resulting bad performance without modesetting.
>>>> Hm, I don't get it.  What this options has to do with performance for
>>>> a KMS-only driver...?
>>>
>>> Well exactly that's the point, nothing.
>>>
>>> The problem is that the option name is confusing to the end user because the
>>> expectation is that "nomodeset" just means that they only can't change the
>>> display mode.
>>>
>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
>>> this means that the driver isn't even loaded and they also don't get any
>>> acceleration.
>>>
>>> We had to explain that numerous times now. I think it would be best to give
>>> the option a more meaningful name.
>>
>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
>> accel" knob then probably best to put that into the drm core. And just
>> outright fail loading the drm core if that happens, which will prevent all
>> gfx drivers from loading.
>>
>> That likely means a hole bunch of stuff won't work (usually sound keels
>> over too), but that's what you get for this. Only disabling modesetting
>> without disabling the entire driver doesn't work (never has, except for
>> this UMS+GEM combo only i915 support, and not for long).
>>
>> And once we have that knob, probably best to phase out all the per-driver
>> options.
> 
> Another use-case that the per-driver disables enable is "i915 works
> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
> seems likely this could happen with amdgpu as well.

modprobe.blacklist=amdgpu

works as well as the modeset parameter for this.


> The names are horrid. I think everyone agrees. In fact, when the
> driver is disabled by nomodeset or modeset=0, I think they should
> print like "driver completely disabled by modeset option" to avoid
> some of the user confusion Christian is referring to (which I've run
> into on a number of occasions as well). And/or maybe just refuse the
> driver load entirely rather than load-but-do-nothing. However being
> able to help users debug things seems more important than users being
> occasionally confused by options they added to kernel cmdline.

FWIW, if a new parameter or other mechanism is added for this, ideally
it should allow preventing initialization on a per-GPU basis, instead of
only per-driver, for systems with multiple GPUs supported by the same
driver.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                                 ` <ea3e89e9-0a31-604f-c3f4-2693a0f9ca92-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-04-03 13:39                                   ` Ilia Mirkin
       [not found]                                     ` <CAKb7UvibPPu9O0HKbGBz7Zd9av-1YR905zH5VypiYeMRbGasGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Ilia Mirkin @ 2018-04-03 13:39 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: David Airlie, dri-devel, amd-gfx mailing list, Daniel Vetter,
	Alex Deucher, Christian König

On Tue, Apr 3, 2018 at 9:32 AM, Michel Dänzer <michel@daenzer.net> wrote:
> On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
>> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
>>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
>>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
>>>>> Christian K6nig wrote:
>>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
>>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>>>>>> <christian.koenig@amd.com> wrote:
>>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>>>>>> but the actual implementation seems to have been forgotten.
>>>>>>>>>
>>>>>>>>> This patch adds the missing piece.
>>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>>>>>> option to disable it from other DRM drivers without UMS support as well
>>>>>>>> (pretty much all of them now).
>>>>>>>>
>>>>>>>> If you want to prevent a driver from loading I think the correct way to do
>>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>>>>>
>>>>>>>> That would remove the possibility to prevent the driver from loading when it
>>>>>>>> is compiled in, but I don't see much of a problem with that.
>>>>>>> Having a way to kill the graphics driver is a very useful debugging
>>>>>>> tool, and also a quick and easy way to get out of an unpleasant
>>>>>>> situation where graphics are messed up / system hangs / etc. The
>>>>>>> modprobe blacklist kernel arg only works in certain environments (and
>>>>>>> only if it's a module).
>>>>>>>
>>>>>>> Every other DRM driver has this and this is a well-documented
>>>>>>> workaround for "graphics are messed up when I install linux", why not
>>>>>>> allow a uniform experience for the end users who are just trying to
>>>>>>> get their systems up and running?
>>>>>> Because it is not well documented and repeated over and over again in
>>>>>> drivers.
>>>>>>
>>>>>> The problem is that people don't realized that the driver isn't loaded
>>>>>> at all without the modeset=0 module option and demand fixing the
>>>>>> resulting bad performance without modesetting.
>>>>> Hm, I don't get it.  What this options has to do with performance for
>>>>> a KMS-only driver...?
>>>>
>>>> Well exactly that's the point, nothing.
>>>>
>>>> The problem is that the option name is confusing to the end user because the
>>>> expectation is that "nomodeset" just means that they only can't change the
>>>> display mode.
>>>>
>>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
>>>> this means that the driver isn't even loaded and they also don't get any
>>>> acceleration.
>>>>
>>>> We had to explain that numerous times now. I think it would be best to give
>>>> the option a more meaningful name.
>>>
>>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
>>> accel" knob then probably best to put that into the drm core. And just
>>> outright fail loading the drm core if that happens, which will prevent all
>>> gfx drivers from loading.
>>>
>>> That likely means a hole bunch of stuff won't work (usually sound keels
>>> over too), but that's what you get for this. Only disabling modesetting
>>> without disabling the entire driver doesn't work (never has, except for
>>> this UMS+GEM combo only i915 support, and not for long).
>>>
>>> And once we have that knob, probably best to phase out all the per-driver
>>> options.
>>
>> Another use-case that the per-driver disables enable is "i915 works
>> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
>> seems likely this could happen with amdgpu as well.
>
> modprobe.blacklist=amdgpu
>
> works as well as the modeset parameter for this.

People who build their own kernels run into trouble too. Also does
this work uniformly across all systems where it is a module? The
appeal of the kernel param is that it's fool-proof.

> FWIW, if a new parameter or other mechanism is added for this, ideally
> it should allow preventing initialization on a per-GPU basis, instead of
> only per-driver, for systems with multiple GPUs supported by the same
> driver.

Oh yeah, that'd be nice. (Optionally though, so that it's still easy
to use for the fairly common single gpu case.)
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                                     ` <CAKb7UvibPPu9O0HKbGBz7Zd9av-1YR905zH5VypiYeMRbGasGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-04-03 13:47                                       ` Michel Dänzer
       [not found]                                         ` <957f79ce-80e9-d240-3632-e8b346708646-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Michel Dänzer @ 2018-04-03 13:47 UTC (permalink / raw)
  To: Ilia Mirkin
  Cc: David Airlie, amd-gfx mailing list, dri-devel, Daniel Vetter,
	Alex Deucher, Christian König

On 2018-04-03 03:39 PM, Ilia Mirkin wrote:
> On Tue, Apr 3, 2018 at 9:32 AM, Michel Dänzer <michel@daenzer.net> wrote:
>> On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
>>> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
>>>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
>>>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
>>>>>> Christian K6nig wrote:
>>>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
>>>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>>>>>>> <christian.koenig@amd.com> wrote:
>>>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>>>>>>> but the actual implementation seems to have been forgotten.
>>>>>>>>>>
>>>>>>>>>> This patch adds the missing piece.
>>>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>>>>>>> option to disable it from other DRM drivers without UMS support as well
>>>>>>>>> (pretty much all of them now).
>>>>>>>>>
>>>>>>>>> If you want to prevent a driver from loading I think the correct way to do
>>>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>>>>>>
>>>>>>>>> That would remove the possibility to prevent the driver from loading when it
>>>>>>>>> is compiled in, but I don't see much of a problem with that.
>>>>>>>> Having a way to kill the graphics driver is a very useful debugging
>>>>>>>> tool, and also a quick and easy way to get out of an unpleasant
>>>>>>>> situation where graphics are messed up / system hangs / etc. The
>>>>>>>> modprobe blacklist kernel arg only works in certain environments (and
>>>>>>>> only if it's a module).
>>>>>>>>
>>>>>>>> Every other DRM driver has this and this is a well-documented
>>>>>>>> workaround for "graphics are messed up when I install linux", why not
>>>>>>>> allow a uniform experience for the end users who are just trying to
>>>>>>>> get their systems up and running?
>>>>>>> Because it is not well documented and repeated over and over again in
>>>>>>> drivers.
>>>>>>>
>>>>>>> The problem is that people don't realized that the driver isn't loaded
>>>>>>> at all without the modeset=0 module option and demand fixing the
>>>>>>> resulting bad performance without modesetting.
>>>>>> Hm, I don't get it.  What this options has to do with performance for
>>>>>> a KMS-only driver...?
>>>>>
>>>>> Well exactly that's the point, nothing.
>>>>>
>>>>> The problem is that the option name is confusing to the end user because the
>>>>> expectation is that "nomodeset" just means that they only can't change the
>>>>> display mode.
>>>>>
>>>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
>>>>> this means that the driver isn't even loaded and they also don't get any
>>>>> acceleration.
>>>>>
>>>>> We had to explain that numerous times now. I think it would be best to give
>>>>> the option a more meaningful name.
>>>>
>>>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
>>>> accel" knob then probably best to put that into the drm core. And just
>>>> outright fail loading the drm core if that happens, which will prevent all
>>>> gfx drivers from loading.
>>>>
>>>> That likely means a hole bunch of stuff won't work (usually sound keels
>>>> over too), but that's what you get for this. Only disabling modesetting
>>>> without disabling the entire driver doesn't work (never has, except for
>>>> this UMS+GEM combo only i915 support, and not for long).
>>>>
>>>> And once we have that knob, probably best to phase out all the per-driver
>>>> options.
>>>
>>> Another use-case that the per-driver disables enable is "i915 works
>>> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
>>> seems likely this could happen with amdgpu as well.
>>
>> modprobe.blacklist=amdgpu
>>
>> works as well as the modeset parameter for this.
> 
> People who build their own kernels run into trouble too.

There have always been various more or less serious issues with building
amdgpu (and radeon) into the kernel. People who do so get to keep all
pieces when it breaks.


> Also does this work uniformly across all systems where it is a module?

AFAIK yes.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                                         ` <957f79ce-80e9-d240-3632-e8b346708646-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-04-03 14:06                                           ` Ville Syrjälä
       [not found]                                             ` <20180403140603.GA5453-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2018-04-03 15:09                                             ` Michel Dänzer
  0 siblings, 2 replies; 27+ messages in thread
From: Ville Syrjälä @ 2018-04-03 14:06 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: David Airlie, dri-devel, amd-gfx mailing list, Alex Deucher,
	Christian König, Ilia Mirkin

On Tue, Apr 03, 2018 at 03:47:57PM +0200, Michel Dänzer wrote:
> On 2018-04-03 03:39 PM, Ilia Mirkin wrote:
> > On Tue, Apr 3, 2018 at 9:32 AM, Michel Dänzer <michel@daenzer.net> wrote:
> >> On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
> >>> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> >>>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
> >>>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
> >>>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
> >>>>>> Christian K6nig wrote:
> >>>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
> >>>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> >>>>>>>> <christian.koenig@amd.com> wrote:
> >>>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> >>>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
> >>>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
> >>>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
> >>>>>>>>>> but the actual implementation seems to have been forgotten.
> >>>>>>>>>>
> >>>>>>>>>> This patch adds the missing piece.
> >>>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> >>>>>>>>> option to disable it from other DRM drivers without UMS support as well
> >>>>>>>>> (pretty much all of them now).
> >>>>>>>>>
> >>>>>>>>> If you want to prevent a driver from loading I think the correct way to do
> >>>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> >>>>>>>>>
> >>>>>>>>> That would remove the possibility to prevent the driver from loading when it
> >>>>>>>>> is compiled in, but I don't see much of a problem with that.
> >>>>>>>> Having a way to kill the graphics driver is a very useful debugging
> >>>>>>>> tool, and also a quick and easy way to get out of an unpleasant
> >>>>>>>> situation where graphics are messed up / system hangs / etc. The
> >>>>>>>> modprobe blacklist kernel arg only works in certain environments (and
> >>>>>>>> only if it's a module).
> >>>>>>>>
> >>>>>>>> Every other DRM driver has this and this is a well-documented
> >>>>>>>> workaround for "graphics are messed up when I install linux", why not
> >>>>>>>> allow a uniform experience for the end users who are just trying to
> >>>>>>>> get their systems up and running?
> >>>>>>> Because it is not well documented and repeated over and over again in
> >>>>>>> drivers.
> >>>>>>>
> >>>>>>> The problem is that people don't realized that the driver isn't loaded
> >>>>>>> at all without the modeset=0 module option and demand fixing the
> >>>>>>> resulting bad performance without modesetting.
> >>>>>> Hm, I don't get it.  What this options has to do with performance for
> >>>>>> a KMS-only driver...?
> >>>>>
> >>>>> Well exactly that's the point, nothing.
> >>>>>
> >>>>> The problem is that the option name is confusing to the end user because the
> >>>>> expectation is that "nomodeset" just means that they only can't change the
> >>>>> display mode.
> >>>>>
> >>>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
> >>>>> this means that the driver isn't even loaded and they also don't get any
> >>>>> acceleration.
> >>>>>
> >>>>> We had to explain that numerous times now. I think it would be best to give
> >>>>> the option a more meaningful name.
> >>>>
> >>>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
> >>>> accel" knob then probably best to put that into the drm core. And just
> >>>> outright fail loading the drm core if that happens, which will prevent all
> >>>> gfx drivers from loading.
> >>>>
> >>>> That likely means a hole bunch of stuff won't work (usually sound keels
> >>>> over too), but that's what you get for this. Only disabling modesetting
> >>>> without disabling the entire driver doesn't work (never has, except for
> >>>> this UMS+GEM combo only i915 support, and not for long).
> >>>>
> >>>> And once we have that knob, probably best to phase out all the per-driver
> >>>> options.
> >>>
> >>> Another use-case that the per-driver disables enable is "i915 works
> >>> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
> >>> seems likely this could happen with amdgpu as well.
> >>
> >> modprobe.blacklist=amdgpu
> >>
> >> works as well as the modeset parameter for this.
> > 
> > People who build their own kernels run into trouble too.
> 
> There have always been various more or less serious issues with building
> amdgpu (and radeon) into the kernel. People who do so get to keep all
> pieces when it breaks.
> 
> 
> > Also does this work uniformly across all systems where it is a module?
> 
> AFAIK yes.

Sadly modprobe.blacklist doesn't prevent X/whatever from loading the
module anyway.

I use modprobe.blacklist myself all the time for i915 development,
but I also have all GUI junk disabled as well so that I can load the
module myself when I'm actually ready for it (typically after I've
enabled netconsole).

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                                             ` <20180403140603.GA5453-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2018-04-03 15:02                                               ` Daniel Vetter
       [not found]                                                 ` <20180403150235.GV3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Daniel Vetter @ 2018-04-03 15:02 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: David Airlie, Michel Dänzer, amd-gfx mailing list,
	dri-devel, Alex Deucher, Christian König

On Tue, Apr 03, 2018 at 05:06:03PM +0300, Ville Syrjälä wrote:
> On Tue, Apr 03, 2018 at 03:47:57PM +0200, Michel Dänzer wrote:
> > On 2018-04-03 03:39 PM, Ilia Mirkin wrote:
> > > On Tue, Apr 3, 2018 at 9:32 AM, Michel Dänzer <michel@daenzer.net> wrote:
> > >> On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
> > >>> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > >>>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
> > >>>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
> > >>>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
> > >>>>>> Christian K6nig wrote:
> > >>>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
> > >>>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> > >>>>>>>> <christian.koenig@amd.com> wrote:
> > >>>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> > >>>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
> > >>>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
> > >>>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
> > >>>>>>>>>> but the actual implementation seems to have been forgotten.
> > >>>>>>>>>>
> > >>>>>>>>>> This patch adds the missing piece.
> > >>>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> > >>>>>>>>> option to disable it from other DRM drivers without UMS support as well
> > >>>>>>>>> (pretty much all of them now).
> > >>>>>>>>>
> > >>>>>>>>> If you want to prevent a driver from loading I think the correct way to do
> > >>>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> > >>>>>>>>>
> > >>>>>>>>> That would remove the possibility to prevent the driver from loading when it
> > >>>>>>>>> is compiled in, but I don't see much of a problem with that.
> > >>>>>>>> Having a way to kill the graphics driver is a very useful debugging
> > >>>>>>>> tool, and also a quick and easy way to get out of an unpleasant
> > >>>>>>>> situation where graphics are messed up / system hangs / etc. The
> > >>>>>>>> modprobe blacklist kernel arg only works in certain environments (and
> > >>>>>>>> only if it's a module).
> > >>>>>>>>
> > >>>>>>>> Every other DRM driver has this and this is a well-documented
> > >>>>>>>> workaround for "graphics are messed up when I install linux", why not
> > >>>>>>>> allow a uniform experience for the end users who are just trying to
> > >>>>>>>> get their systems up and running?
> > >>>>>>> Because it is not well documented and repeated over and over again in
> > >>>>>>> drivers.
> > >>>>>>>
> > >>>>>>> The problem is that people don't realized that the driver isn't loaded
> > >>>>>>> at all without the modeset=0 module option and demand fixing the
> > >>>>>>> resulting bad performance without modesetting.
> > >>>>>> Hm, I don't get it.  What this options has to do with performance for
> > >>>>>> a KMS-only driver...?
> > >>>>>
> > >>>>> Well exactly that's the point, nothing.
> > >>>>>
> > >>>>> The problem is that the option name is confusing to the end user because the
> > >>>>> expectation is that "nomodeset" just means that they only can't change the
> > >>>>> display mode.
> > >>>>>
> > >>>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
> > >>>>> this means that the driver isn't even loaded and they also don't get any
> > >>>>> acceleration.
> > >>>>>
> > >>>>> We had to explain that numerous times now. I think it would be best to give
> > >>>>> the option a more meaningful name.
> > >>>>
> > >>>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
> > >>>> accel" knob then probably best to put that into the drm core. And just
> > >>>> outright fail loading the drm core if that happens, which will prevent all
> > >>>> gfx drivers from loading.
> > >>>>
> > >>>> That likely means a hole bunch of stuff won't work (usually sound keels
> > >>>> over too), but that's what you get for this. Only disabling modesetting
> > >>>> without disabling the entire driver doesn't work (never has, except for
> > >>>> this UMS+GEM combo only i915 support, and not for long).
> > >>>>
> > >>>> And once we have that knob, probably best to phase out all the per-driver
> > >>>> options.
> > >>>
> > >>> Another use-case that the per-driver disables enable is "i915 works
> > >>> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
> > >>> seems likely this could happen with amdgpu as well.
> > >>
> > >> modprobe.blacklist=amdgpu
> > >>
> > >> works as well as the modeset parameter for this.
> > > 
> > > People who build their own kernels run into trouble too.
> > 
> > There have always been various more or less serious issues with building
> > amdgpu (and radeon) into the kernel. People who do so get to keep all
> > pieces when it breaks.

fwiw, same roughly applies for i915. We try to make it work, by allowing
firmware to be loaded later on and asynchronously. But if you fail to
provide firmware the driver simply hangs forever. At least in certain
cases, for others we simply never clock gate/shutdown the chip. Also not
awesome (and we're closing all corresponding bug reports too).

We don't yet need firmware for basic display support, so you'll get at
least a picture to be able to look at dmesg. If you remember to start X
without accel, that is :-)

> > > Also does this work uniformly across all systems where it is a module?
> > 
> > AFAIK yes.
> 
> Sadly modprobe.blacklist doesn't prevent X/whatever from loading the
> module anyway.

A generic "please don't bind anything to this device path" kernel property
would be really nice for this. And hopefully something that could be
merged into the drivers/base core code.

Plus a generic and all-encompassing no_modeset^Wno_gfx_I_mean_it knob
would cover everything I think.
-Daniel

> I use modprobe.blacklist myself all the time for i915 development,
> but I also have all GUI junk disabled as well so that I can load the
> module myself when I'm actually ready for it (typically after I've
> enabled netconsole).

Oh, that's why modprobe.blacklist never works for me. TIL.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
  2018-04-03 14:06                                           ` Ville Syrjälä
       [not found]                                             ` <20180403140603.GA5453-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2018-04-03 15:09                                             ` Michel Dänzer
  1 sibling, 0 replies; 27+ messages in thread
From: Michel Dänzer @ 2018-04-03 15:09 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: David Airlie, amd-gfx mailing list, dri-devel, Alex Deucher,
	Christian König

On 2018-04-03 04:06 PM, Ville Syrjälä wrote:
> On Tue, Apr 03, 2018 at 03:47:57PM +0200, Michel Dänzer wrote:
>> On 2018-04-03 03:39 PM, Ilia Mirkin wrote:
>>> On Tue, Apr 3, 2018 at 9:32 AM, Michel Dänzer <michel@daenzer.net> wrote:
>>>> On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
>>>>> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>>>>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
>>>>>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
>>>>>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
>>>>>>>> Christian K6nig wrote:
>>>>>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
>>>>>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
>>>>>>>>>> <christian.koenig@amd.com> wrote:
>>>>>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
>>>>>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
>>>>>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
>>>>>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
>>>>>>>>>>>> but the actual implementation seems to have been forgotten.
>>>>>>>>>>>>
>>>>>>>>>>>> This patch adds the missing piece.
>>>>>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
>>>>>>>>>>> option to disable it from other DRM drivers without UMS support as well
>>>>>>>>>>> (pretty much all of them now).
>>>>>>>>>>>
>>>>>>>>>>> If you want to prevent a driver from loading I think the correct way to do
>>>>>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
>>>>>>>>>>>
>>>>>>>>>>> That would remove the possibility to prevent the driver from loading when it
>>>>>>>>>>> is compiled in, but I don't see much of a problem with that.
>>>>>>>>>> Having a way to kill the graphics driver is a very useful debugging
>>>>>>>>>> tool, and also a quick and easy way to get out of an unpleasant
>>>>>>>>>> situation where graphics are messed up / system hangs / etc. The
>>>>>>>>>> modprobe blacklist kernel arg only works in certain environments (and
>>>>>>>>>> only if it's a module).
>>>>>>>>>>
>>>>>>>>>> Every other DRM driver has this and this is a well-documented
>>>>>>>>>> workaround for "graphics are messed up when I install linux", why not
>>>>>>>>>> allow a uniform experience for the end users who are just trying to
>>>>>>>>>> get their systems up and running?
>>>>>>>>> Because it is not well documented and repeated over and over again in
>>>>>>>>> drivers.
>>>>>>>>>
>>>>>>>>> The problem is that people don't realized that the driver isn't loaded
>>>>>>>>> at all without the modeset=0 module option and demand fixing the
>>>>>>>>> resulting bad performance without modesetting.
>>>>>>>> Hm, I don't get it.  What this options has to do with performance for
>>>>>>>> a KMS-only driver...?
>>>>>>>
>>>>>>> Well exactly that's the point, nothing.
>>>>>>>
>>>>>>> The problem is that the option name is confusing to the end user because the
>>>>>>> expectation is that "nomodeset" just means that they only can't change the
>>>>>>> display mode.
>>>>>>>
>>>>>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
>>>>>>> this means that the driver isn't even loaded and they also don't get any
>>>>>>> acceleration.
>>>>>>>
>>>>>>> We had to explain that numerous times now. I think it would be best to give
>>>>>>> the option a more meaningful name.
>>>>>>
>>>>>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
>>>>>> accel" knob then probably best to put that into the drm core. And just
>>>>>> outright fail loading the drm core if that happens, which will prevent all
>>>>>> gfx drivers from loading.
>>>>>>
>>>>>> That likely means a hole bunch of stuff won't work (usually sound keels
>>>>>> over too), but that's what you get for this. Only disabling modesetting
>>>>>> without disabling the entire driver doesn't work (never has, except for
>>>>>> this UMS+GEM combo only i915 support, and not for long).
>>>>>>
>>>>>> And once we have that knob, probably best to phase out all the per-driver
>>>>>> options.
>>>>>
>>>>> Another use-case that the per-driver disables enable is "i915 works
>>>>> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
>>>>> seems likely this could happen with amdgpu as well.
>>>>
>>>> modprobe.blacklist=amdgpu
>>>>
>>>> works as well as the modeset parameter for this.
>>>
>>> People who build their own kernels run into trouble too.
>>
>> There have always been various more or less serious issues with building
>> amdgpu (and radeon) into the kernel. People who do so get to keep all
>> pieces when it breaks.
>>
>>
>>> Also does this work uniformly across all systems where it is a module?
>>
>> AFAIK yes.
> 
> Sadly modprobe.blacklist doesn't prevent X/whatever from loading the
> module anyway.

AFAICT xf86-video-amdgpu and modesetting have never even tried loading
the kernel module, and neither has xf86-video-ati for years at least.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]                                                 ` <20180403150235.GV3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
@ 2018-04-03 16:54                                                   ` Ville Syrjälä
  0 siblings, 0 replies; 27+ messages in thread
From: Ville Syrjälä @ 2018-04-03 16:54 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: David Airlie, Michel Dänzer, amd-gfx mailing list,
	dri-devel, Alex Deucher, Christian König

On Tue, Apr 03, 2018 at 05:02:35PM +0200, Daniel Vetter wrote:
> On Tue, Apr 03, 2018 at 05:06:03PM +0300, Ville Syrjälä wrote:
> > On Tue, Apr 03, 2018 at 03:47:57PM +0200, Michel Dänzer wrote:
> > > On 2018-04-03 03:39 PM, Ilia Mirkin wrote:
> > > > On Tue, Apr 3, 2018 at 9:32 AM, Michel Dänzer <michel@daenzer.net> wrote:
> > > >> On 2018-04-03 03:26 PM, Ilia Mirkin wrote:
> > > >>> On Tue, Apr 3, 2018 at 5:29 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > > >>>> On Sun, Apr 01, 2018 at 10:12:10PM +0200, Christian König wrote:
> > > >>>>> Am 01.04.2018 um 20:21 schrieb Takashi Iwai:
> > > >>>>>> On Sun, 01 Apr 2018 19:58:11 +0200,
> > > >>>>>> Christian K6nig wrote:
> > > >>>>>>> Am 01.04.2018 um 19:45 schrieb Ilia Mirkin:
> > > >>>>>>>> On Sun, Apr 1, 2018 at 1:39 PM, Christian König
> > > >>>>>>>> <christian.koenig@amd.com> wrote:
> > > >>>>>>>>> Am 30.03.2018 um 22:45 schrieb Takashi Iwai:
> > > >>>>>>>>>> amdgpu driver lacks of modeset module option other drm drivers provide
> > > >>>>>>>>>> for enforcing or disabling the driver load.  Interestingly, the
> > > >>>>>>>>>> amdgpu_mode variable declaration is already found in the header file,
> > > >>>>>>>>>> but the actual implementation seems to have been forgotten.
> > > >>>>>>>>>>
> > > >>>>>>>>>> This patch adds the missing piece.
> > > >>>>>>>>> NAK, modesetting is mandatory for amdgpu and we should probably remove the
> > > >>>>>>>>> option to disable it from other DRM drivers without UMS support as well
> > > >>>>>>>>> (pretty much all of them now).
> > > >>>>>>>>>
> > > >>>>>>>>> If you want to prevent a driver from loading I think the correct way to do
> > > >>>>>>>>> so is to give modprobe.blacklist=amdgpu on the kernel commandline.
> > > >>>>>>>>>
> > > >>>>>>>>> That would remove the possibility to prevent the driver from loading when it
> > > >>>>>>>>> is compiled in, but I don't see much of a problem with that.
> > > >>>>>>>> Having a way to kill the graphics driver is a very useful debugging
> > > >>>>>>>> tool, and also a quick and easy way to get out of an unpleasant
> > > >>>>>>>> situation where graphics are messed up / system hangs / etc. The
> > > >>>>>>>> modprobe blacklist kernel arg only works in certain environments (and
> > > >>>>>>>> only if it's a module).
> > > >>>>>>>>
> > > >>>>>>>> Every other DRM driver has this and this is a well-documented
> > > >>>>>>>> workaround for "graphics are messed up when I install linux", why not
> > > >>>>>>>> allow a uniform experience for the end users who are just trying to
> > > >>>>>>>> get their systems up and running?
> > > >>>>>>> Because it is not well documented and repeated over and over again in
> > > >>>>>>> drivers.
> > > >>>>>>>
> > > >>>>>>> The problem is that people don't realized that the driver isn't loaded
> > > >>>>>>> at all without the modeset=0 module option and demand fixing the
> > > >>>>>>> resulting bad performance without modesetting.
> > > >>>>>> Hm, I don't get it.  What this options has to do with performance for
> > > >>>>>> a KMS-only driver...?
> > > >>>>>
> > > >>>>> Well exactly that's the point, nothing.
> > > >>>>>
> > > >>>>> The problem is that the option name is confusing to the end user because the
> > > >>>>> expectation is that "nomodeset" just means that they only can't change the
> > > >>>>> display mode.
> > > >>>>>
> > > >>>>> Some (unfortunately quite a lot) people don't realize that for KMS drivers
> > > >>>>> this means that the driver isn't even loaded and they also don't get any
> > > >>>>> acceleration.
> > > >>>>>
> > > >>>>> We had to explain that numerous times now. I think it would be best to give
> > > >>>>> the option a more meaningful name.
> > > >>>>
> > > >>>> Yeah, agreed with Christian. If we want a generic "pls disable all gfx
> > > >>>> accel" knob then probably best to put that into the drm core. And just
> > > >>>> outright fail loading the drm core if that happens, which will prevent all
> > > >>>> gfx drivers from loading.
> > > >>>>
> > > >>>> That likely means a hole bunch of stuff won't work (usually sound keels
> > > >>>> over too), but that's what you get for this. Only disabling modesetting
> > > >>>> without disabling the entire driver doesn't work (never has, except for
> > > >>>> this UMS+GEM combo only i915 support, and not for long).
> > > >>>>
> > > >>>> And once we have that knob, probably best to phase out all the per-driver
> > > >>>> options.
> > > >>>
> > > >>> Another use-case that the per-driver disables enable is "i915 works
> > > >>> but nouveau is broken due to crazy ACPI / PCIe PM / whatever". It
> > > >>> seems likely this could happen with amdgpu as well.
> > > >>
> > > >> modprobe.blacklist=amdgpu
> > > >>
> > > >> works as well as the modeset parameter for this.
> > > > 
> > > > People who build their own kernels run into trouble too.
> > > 
> > > There have always been various more or less serious issues with building
> > > amdgpu (and radeon) into the kernel. People who do so get to keep all
> > > pieces when it breaks.
> 
> fwiw, same roughly applies for i915. We try to make it work, by allowing
> firmware to be loaded later on and asynchronously. But if you fail to
> provide firmware the driver simply hangs forever. At least in certain
> cases, for others we simply never clock gate/shutdown the chip. Also not
> awesome (and we're closing all corresponding bug reports too).
> 
> We don't yet need firmware for basic display support, so you'll get at
> least a picture to be able to look at dmesg. If you remember to start X
> without accel, that is :-)
> 
> > > > Also does this work uniformly across all systems where it is a module?
> > > 
> > > AFAIK yes.
> > 
> > Sadly modprobe.blacklist doesn't prevent X/whatever from loading the
> > module anyway.
> 
> A generic "please don't bind anything to this device path" kernel property
> would be really nice for this. And hopefully something that could be
> merged into the drivers/base core code.
> 
> Plus a generic and all-encompassing no_modeset^Wno_gfx_I_mean_it knob
> would cover everything I think.
> -Daniel
> 
> > I use modprobe.blacklist myself all the time for i915 development,
> > but I also have all GUI junk disabled as well so that I can load the
> > module myself when I'm actually ready for it (typically after I've
> > enabled netconsole).
> 
> Oh, that's why modprobe.blacklist never works for me. TIL.

The other common reason is snd_hda_intel. That one needs to be blacklisted
at the same time, on modern Intel hw at least. Also one must remember to
write it as "snd_hda_intel" instead of "snd-hda-intel", otherwise it doesn't
do anything.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
       [not found]     ` <20180330204512.16863-2-tiwai-l3A5Bk7waGM@public.gmane.org>
  2018-04-01 17:39       ` Christian König
@ 2019-09-25  8:07       ` Dave Airlie
  2019-09-25  9:04         ` Koenig, Christian
  1 sibling, 1 reply; 27+ messages in thread
From: Dave Airlie @ 2019-09-25  8:07 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: David Zhou, David Airlie, amd-gfx mailing list, dri-devel,
	Alex Deucher, Christian König

On Sat, 31 Mar 2018 at 06:45, Takashi Iwai <tiwai@suse.de> wrote:
>
> amdgpu driver lacks of modeset module option other drm drivers provide
> for enforcing or disabling the driver load.  Interestingly, the
> amdgpu_mode variable declaration is already found in the header file,
> but the actual implementation seems to have been forgotten.
>
> This patch adds the missing piece.

I'd like to land this patch, I realise people have NAKed it but for
consistency across drivers I'm going to ask we land it or something
like it.

The main use case for this is actually where you have amdgpu crashes
on load, and you want to debug them, people boot with nomodeset and
then modprobe amdgpu modeset=1 to get the crash in a running system.
This works for numerous other drivers, I'm not sure why amdgpu needs
to be the odd one out.

Reviewed-by: Dave Airlie <airlied@redhat.com>

Dave.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Add modeset module option
  2019-09-25  8:07       ` Dave Airlie
@ 2019-09-25  9:04         ` Koenig, Christian
  0 siblings, 0 replies; 27+ messages in thread
From: Koenig, Christian @ 2019-09-25  9:04 UTC (permalink / raw)
  To: Dave Airlie, Takashi Iwai
  Cc: Deucher, Alexander, David Airlie, amd-gfx mailing list, dri-devel

Am 25.09.19 um 10:07 schrieb Dave Airlie:
> On Sat, 31 Mar 2018 at 06:45, Takashi Iwai <tiwai@suse.de> wrote:
>> amdgpu driver lacks of modeset module option other drm drivers provide
>> for enforcing or disabling the driver load.  Interestingly, the
>> amdgpu_mode variable declaration is already found in the header file,
>> but the actual implementation seems to have been forgotten.
>>
>> This patch adds the missing piece.
> I'd like to land this patch, I realise people have NAKed it but for
> consistency across drivers I'm going to ask we land it or something
> like it.
>
> The main use case for this is actually where you have amdgpu crashes
> on load, and you want to debug them, people boot with nomodeset and
> then modprobe amdgpu modeset=1 to get the crash in a running system.
> This works for numerous other drivers, I'm not sure why amdgpu needs
> to be the odd one out.

Because this is essentially the wrong approach.

The correct way to prevent a module from automatically loading is to add 
modprobe.blacklist=$name to the kernel command line.

The modeset and nomodeset kernel options where used to switch between 
KMS and UMS and not to disable driver load.

We should have removed those options with the removal of UMS or 
otherwise it becomes just another ancient cruft we need to carry forward 
in potentially all drivers.

Regards,
Christian.

>
> Reviewed-by: Dave Airlie <airlied@redhat.com>
>
> Dave.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2019-09-25  9:04 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 20:45 [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path Takashi Iwai
     [not found] ` <20180330204512.16863-1-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-03-30 20:45   ` [PATCH 2/2] drm/amdgpu: Add modeset module option Takashi Iwai
     [not found]     ` <20180330204512.16863-2-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-01 17:39       ` Christian König
     [not found]         ` <c95f9e61-c921-42de-9e03-851d785ab5fc-5C7GfCeVMHo@public.gmane.org>
2018-04-01 17:45           ` Ilia Mirkin
2018-04-01 17:58             ` Christian König
     [not found]               ` <706f4d0d-4583-2c8a-447d-f6cdd3429ad5-5C7GfCeVMHo@public.gmane.org>
2018-04-01 18:21                 ` Takashi Iwai
     [not found]                   ` <s5ho9j24wk9.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-01 20:12                     ` Christian König
     [not found]                       ` <0ecce204-6af8-2395-ac40-391e3b655bed-5C7GfCeVMHo@public.gmane.org>
2018-04-03  9:29                         ` Daniel Vetter
     [not found]                           ` <20180403092948.GQ3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-04-03 11:30                             ` Christian König
2018-04-03 13:26                           ` Ilia Mirkin
     [not found]                             ` <CAKb7UvhG5nO9q1M=6fu6mnChObsskxFzgGXQPUJQCk1Q+E9ffQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-03 13:32                               ` Michel Dänzer
     [not found]                                 ` <ea3e89e9-0a31-604f-c3f4-2693a0f9ca92-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03 13:39                                   ` Ilia Mirkin
     [not found]                                     ` <CAKb7UvibPPu9O0HKbGBz7Zd9av-1YR905zH5VypiYeMRbGasGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-03 13:47                                       ` Michel Dänzer
     [not found]                                         ` <957f79ce-80e9-d240-3632-e8b346708646-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03 14:06                                           ` Ville Syrjälä
     [not found]                                             ` <20180403140603.GA5453-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-03 15:02                                               ` Daniel Vetter
     [not found]                                                 ` <20180403150235.GV3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-04-03 16:54                                                   ` Ville Syrjälä
2018-04-03 15:09                                             ` Michel Dänzer
     [not found]             ` <CAKb7Uvh_CxE=Zg_F0tentwXK64_baxs0TCQ-K9Mh_Mjf+NV_DA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-03  8:36               ` Michel Dänzer
2018-04-03  8:57                 ` Christian König
     [not found]                   ` <781c3a0b-e199-c637-410a-521fe5fd5170-5C7GfCeVMHo@public.gmane.org>
2018-04-03  9:02                     ` Takashi Iwai
     [not found]                       ` <s5hpo3g1x4m.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-03  9:18                         ` Michel Dänzer
2018-04-03  9:44                           ` Takashi Iwai
     [not found]                             ` <s5h1sfwk4ja.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-03 13:01                               ` Michel Dänzer
     [not found]                           ` <e4933491-65be-4b31-95de-cf1147dd312c-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03  9:53                             ` Jani Nikula
2019-09-25  8:07       ` Dave Airlie
2019-09-25  9:04         ` Koenig, Christian
2018-04-02 17:36   ` [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.