All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix "dc has no member named dml" compile error
@ 2019-03-21 14:44 sunpeng.li-5C7GfCeVMHo
       [not found] ` <1553179469-10012-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: sunpeng.li-5C7GfCeVMHo @ 2019-03-21 14:44 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Leo Li, Alex Deucher, Harry Wentland, Nicholas Kazlauskas

From: Leo Li <sunpeng.li@amd.com>

For DCN disabled builds, dc->dml is stripped out. Therefore, guard usage
in dc_create_state() with CONFIG_DRM_AMD_DC_DCN1_0.

It fixes the following error:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'dc_create_state':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1237:34: error: 'struct dc' has no member named 'dml'
     memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
                                     ^~

Signed-off-by: Leo Li <sunpeng.li@amd.com>
CC: Alex Deucher <alexdeucher@gmail.com>
CC: Harry Wentland <Harry.Wentland@amd.com>
CC: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index cebd083..589cd95 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1245,7 +1245,9 @@ struct dc_state *dc_create_state(struct dc *dc)
 	 * initialize and obtain IP and SOC the base DML instance from DC is
 	 * initially copied into every context
 	 */
+#ifdef CONFIG_DRM_AMD_DC_DCN1_0
 	memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
+#endif
 
 	kref_init(&context->refcount);
 
-- 
2.7.4

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

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

* Re: [PATCH] drm/amd/display: Fix "dc has no member named dml" compile error
       [not found] ` <1553179469-10012-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-21 14:46   ` Kazlauskas, Nicholas
  2019-03-21 14:51   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Kazlauskas, Nicholas @ 2019-03-21 14:46 UTC (permalink / raw)
  To: Li, Sun peng (Leo), amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alex Deucher, Wentland, Harry

On 3/21/19 10:44 AM, sunpeng.li@amd.com wrote:
> From: Leo Li <sunpeng.li@amd.com>
> 
> For DCN disabled builds, dc->dml is stripped out. Therefore, guard usage
> in dc_create_state() with CONFIG_DRM_AMD_DC_DCN1_0.
> 
> It fixes the following error:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'dc_create_state':
>>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1237:34: error: 'struct dc' has no member named 'dml'
>       memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
>                                       ^~
> 
> Signed-off-by: Leo Li <sunpeng.li@amd.com>
> CC: Alex Deucher <alexdeucher@gmail.com>
> CC: Harry Wentland <Harry.Wentland@amd.com>
> CC: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> ---

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

I think this is the only place left unguarded at least.

>   drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index cebd083..589cd95 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -1245,7 +1245,9 @@ struct dc_state *dc_create_state(struct dc *dc)
>   	 * initialize and obtain IP and SOC the base DML instance from DC is
>   	 * initially copied into every context
>   	 */
> +#ifdef CONFIG_DRM_AMD_DC_DCN1_0
>   	memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
> +#endif
>   
>   	kref_init(&context->refcount);
>   
> 

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

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

* Re: [PATCH] drm/amd/display: Fix "dc has no member named dml" compile error
       [not found] ` <1553179469-10012-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
  2019-03-21 14:46   ` Kazlauskas, Nicholas
@ 2019-03-21 14:51   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2019-03-21 14:51 UTC (permalink / raw)
  To: Li, Sun peng (Leo), amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alex Deucher, Wentland, Harry, Kazlauskas, Nicholas


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

Thanks!

Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of sunpeng.li-5C7GfCeVMHo@public.gmane.org <sunpeng.li-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, March 21, 2019 10:44 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Li, Sun peng (Leo); Alex Deucher; Wentland, Harry; Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Fix "dc has no member named dml" compile error

From: Leo Li <sunpeng.li-5C7GfCeVMHo@public.gmane.org>

For DCN disabled builds, dc->dml is stripped out. Therefore, guard usage
in dc_create_state() with CONFIG_DRM_AMD_DC_DCN1_0.

It fixes the following error:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'dc_create_state':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1237:34: error: 'struct dc' has no member named 'dml'
     memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
                                     ^~

Signed-off-by: Leo Li <sunpeng.li-5C7GfCeVMHo@public.gmane.org>
CC: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
CC: Harry Wentland <Harry.Wentland-5C7GfCeVMHo@public.gmane.org>
CC: Nicholas Kazlauskas <nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index cebd083..589cd95 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1245,7 +1245,9 @@ struct dc_state *dc_create_state(struct dc *dc)
          * initialize and obtain IP and SOC the base DML instance from DC is
          * initially copied into every context
          */
+#ifdef CONFIG_DRM_AMD_DC_DCN1_0
         memcpy(&context->bw_ctx.dml, &dc->dml, sizeof(struct display_mode_lib));
+#endif

         kref_init(&context->refcount);

--
2.7.4

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

[-- Attachment #1.2: Type: text/html, Size: 4128 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] 3+ messages in thread

end of thread, other threads:[~2019-03-21 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 14:44 [PATCH] drm/amd/display: Fix "dc has no member named dml" compile error sunpeng.li-5C7GfCeVMHo
     [not found] ` <1553179469-10012-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2019-03-21 14:46   ` Kazlauskas, Nicholas
2019-03-21 14:51   ` Deucher, Alexander

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.