All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Null check aconnector in event_property_validate
@ 2019-11-25 15:40 ` Bhawanpreet Lakha
  0 siblings, 0 replies; 6+ messages in thread
From: Bhawanpreet Lakha @ 2019-11-25 15:40 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Bhawanpreet Lakha

[Why]
previously event_property_validate was only called after we enabled the display.
But after "Refactor HDCP to handle multiple displays per link" this function
can be called at any time. In certain cases we don't have a aconnector

[How]
Null check aconnector and exit early. This is ok because we only need to check the
ENABLED->DESIRED transition if a connector exists.

Fixes :cc5dae9f6286 drm/amd/display: Refactor HDCP to handle multiple displays per link
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index f6864a51891a..ae329335dfcc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -225,6 +225,9 @@ static void event_property_validate(struct work_struct *work)
 	struct mod_hdcp_display_query query;
 	struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
 
+	if (!aconnector)
+		return;
+
 	mutex_lock(&hdcp_work->mutex);
 
 	query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
-- 
2.17.1

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

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

* [PATCH] drm/amd/display: Null check aconnector in event_property_validate
@ 2019-11-25 15:40 ` Bhawanpreet Lakha
  0 siblings, 0 replies; 6+ messages in thread
From: Bhawanpreet Lakha @ 2019-11-25 15:40 UTC (permalink / raw)
  To: amd-gfx; +Cc: Bhawanpreet Lakha

[Why]
previously event_property_validate was only called after we enabled the display.
But after "Refactor HDCP to handle multiple displays per link" this function
can be called at any time. In certain cases we don't have a aconnector

[How]
Null check aconnector and exit early. This is ok because we only need to check the
ENABLED->DESIRED transition if a connector exists.

Fixes :cc5dae9f6286 drm/amd/display: Refactor HDCP to handle multiple displays per link
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index f6864a51891a..ae329335dfcc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -225,6 +225,9 @@ static void event_property_validate(struct work_struct *work)
 	struct mod_hdcp_display_query query;
 	struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
 
+	if (!aconnector)
+		return;
+
 	mutex_lock(&hdcp_work->mutex);
 
 	query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
-- 
2.17.1

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

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

* Re: [PATCH] drm/amd/display: Null check aconnector in event_property_validate
@ 2019-11-25 15:41     ` Liu, Zhan
  0 siblings, 0 replies; 6+ messages in thread
From: Liu, Zhan @ 2019-11-25 15:41 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Lakha, Bhawanpreet


[-- Attachment #1.1: Type: text/plain, Size: 2449 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Zhan Liu <zhan.liu-5C7GfCeVMHo@public.gmane.org>

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
Sent: Monday, November 25, 2019 10:40:24 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Lakha, Bhawanpreet <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH] drm/amd/display: Null check aconnector in event_property_validate

[Why]
previously event_property_validate was only called after we enabled the display.
But after "Refactor HDCP to handle multiple displays per link" this function
can be called at any time. In certain cases we don't have a aconnector

[How]
Null check aconnector and exit early. This is ok because we only need to check the
ENABLED->DESIRED transition if a connector exists.

Fixes :cc5dae9f6286 drm/amd/display: Refactor HDCP to handle multiple displays per link
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index f6864a51891a..ae329335dfcc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -225,6 +225,9 @@ static void event_property_validate(struct work_struct *work)
         struct mod_hdcp_display_query query;
         struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;

+       if (!aconnector)
+               return;
+
         mutex_lock(&hdcp_work->mutex);

         query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7C22996511e2124290c9fc08d771bdd059%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C1%7C637102932411167739&amp;sdata=Q0Wlb9vuIRKJgLfiFmpLIJWWsQzmj9hFm3dOKBVxutw%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 4045 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

* Re: [PATCH] drm/amd/display: Null check aconnector in event_property_validate
@ 2019-11-25 15:41     ` Liu, Zhan
  0 siblings, 0 replies; 6+ messages in thread
From: Liu, Zhan @ 2019-11-25 15:41 UTC (permalink / raw)
  To: Lakha, Bhawanpreet, amd-gfx; +Cc: Lakha, Bhawanpreet


[-- Attachment #1.1: Type: text/plain, Size: 2253 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Zhan Liu <zhan.liu@amd.com>

________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Sent: Monday, November 25, 2019 10:40:24 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>
Subject: [PATCH] drm/amd/display: Null check aconnector in event_property_validate

[Why]
previously event_property_validate was only called after we enabled the display.
But after "Refactor HDCP to handle multiple displays per link" this function
can be called at any time. In certain cases we don't have a aconnector

[How]
Null check aconnector and exit early. This is ok because we only need to check the
ENABLED->DESIRED transition if a connector exists.

Fixes :cc5dae9f6286 drm/amd/display: Refactor HDCP to handle multiple displays per link
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index f6864a51891a..ae329335dfcc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -225,6 +225,9 @@ static void event_property_validate(struct work_struct *work)
         struct mod_hdcp_display_query query;
         struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;

+       if (!aconnector)
+               return;
+
         mutex_lock(&hdcp_work->mutex);

         query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7C22996511e2124290c9fc08d771bdd059%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C1%7C637102932411167739&amp;sdata=Q0Wlb9vuIRKJgLfiFmpLIJWWsQzmj9hFm3dOKBVxutw%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 3849 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

* Re: [PATCH] drm/amd/display: Null check aconnector in event_property_validate
@ 2019-11-25 15:42     ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 6+ messages in thread
From: Kazlauskas, Nicholas @ 2019-11-25 15:42 UTC (permalink / raw)
  To: Bhawanpreet Lakha, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2019-11-25 10:40 a.m., Bhawanpreet Lakha wrote:
> [Why]
> previously event_property_validate was only called after we enabled the display.
> But after "Refactor HDCP to handle multiple displays per link" this function
> can be called at any time. In certain cases we don't have a aconnector
> 
> [How]
> Null check aconnector and exit early. This is ok because we only need to check the
> ENABLED->DESIRED transition if a connector exists.
> 
> Fixes :cc5dae9f6286 drm/amd/display: Refactor HDCP to handle multiple displays per link

This should be:

Fixes: cc5dae9f6286 ("drm/amd/display: Refactor HDCP to handle multiple 
displays per link")

> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>

With that fixed this change is:

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> index f6864a51891a..ae329335dfcc 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> @@ -225,6 +225,9 @@ static void event_property_validate(struct work_struct *work)
>   	struct mod_hdcp_display_query query;
>   	struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
>   
> +	if (!aconnector)
> +		return;
> +
>   	mutex_lock(&hdcp_work->mutex);
>   
>   	query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
> 

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

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

* Re: [PATCH] drm/amd/display: Null check aconnector in event_property_validate
@ 2019-11-25 15:42     ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 6+ messages in thread
From: Kazlauskas, Nicholas @ 2019-11-25 15:42 UTC (permalink / raw)
  To: Bhawanpreet Lakha, amd-gfx

On 2019-11-25 10:40 a.m., Bhawanpreet Lakha wrote:
> [Why]
> previously event_property_validate was only called after we enabled the display.
> But after "Refactor HDCP to handle multiple displays per link" this function
> can be called at any time. In certain cases we don't have a aconnector
> 
> [How]
> Null check aconnector and exit early. This is ok because we only need to check the
> ENABLED->DESIRED transition if a connector exists.
> 
> Fixes :cc5dae9f6286 drm/amd/display: Refactor HDCP to handle multiple displays per link

This should be:

Fixes: cc5dae9f6286 ("drm/amd/display: Refactor HDCP to handle multiple 
displays per link")

> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>

With that fixed this change is:

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> index f6864a51891a..ae329335dfcc 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> @@ -225,6 +225,9 @@ static void event_property_validate(struct work_struct *work)
>   	struct mod_hdcp_display_query query;
>   	struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
>   
> +	if (!aconnector)
> +		return;
> +
>   	mutex_lock(&hdcp_work->mutex);
>   
>   	query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
> 

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

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

end of thread, other threads:[~2019-11-25 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 15:40 [PATCH] drm/amd/display: Null check aconnector in event_property_validate Bhawanpreet Lakha
2019-11-25 15:40 ` Bhawanpreet Lakha
     [not found] ` <20191125154024.21218-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-11-25 15:41   ` Liu, Zhan
2019-11-25 15:41     ` Liu, Zhan
2019-11-25 15:42   ` Kazlauskas, Nicholas
2019-11-25 15:42     ` Kazlauskas, Nicholas

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.