Skip to contentSkip to conversation

drm/amdgpu/display: use kvzalloc again in dc_create_state

PATCH In review Alex Deucher 3 participants 4 messages Oct 26, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/display: use kvzalloc again in dc_create_state

It looks this was accidently lost in a follow up patch. dc context is large and we don't need contiguous pages.

Fixes e4863f118a7d ("drm/amd/display: Multi display cause system lag on mode change")
Cc Aric Cyr <[email protected]>
Cc Alex Xu <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
index 7ff029143722..64da60450fb0 100644
@@ -1564,8 +1564,8 @@ static void init_state(struct dc *dc, struct dc_state *context)
 
 struct dc_state *dc_create_state(struct dc *dc)
 {
-	struct dc_state *context = kzalloc(sizeof(struct dc_state),
-					   GFP_KERNEL);
+	struct dc_state *context = kvzalloc(sizeof(struct dc_state),
+					    GFP_KERNEL);
 
 	if (!context)
 		return NULL;
Signature · 6 lines
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Alex Deucher

It looks this was accidently lost in a follow up patch. dc context is large and we don't need contiguous pages.

Fixes e4863f118a7d ("drm/amd/display: Multi display cause system lag on mode change")
Cc Aric Cyr <[email protected]>
Cc Alex Xu <[email protected]>

Regards,
Nicholas Kazlauskas

Quoted 10 lines
---
  drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
index 7ff029143722..64da60450fb0 100644

drivers/gpu/drm/amd/display/dc/core/dc.c static void init_state(struct dc *dc, struct dc_state *context) · line 1571

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -1564,8 +1564,8 @@ static void init_state(struct dc *dc, struct dc_state *context)
 
  struct dc_state *dc_create_state(struct dc *dc)
  {
-	struct dc_state *context = kzalloc(sizeof(struct dc_state),
-					   GFP_KERNEL);
+	struct dc_state *context = kvzalloc(sizeof(struct dc_state),
+					    GFP_KERNEL);
 
  	if (!context)
  		return NULL;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Tested-by on v1 1/1
#2 lore raw
In reply to Alex Deucher

Excerpts from Alex Deucher's message of October 26, 2020 10:30 am:

Quoted 30 lines

It looks this was accidently lost in a follow up patch. dc context is large and we don't need contiguous pages.

Fixes e4863f118a7d ("drm/amd/display: Multi display cause system lag on mode change")
Cc Aric Cyr <[email protected]>
Cc Alex Xu <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
index 7ff029143722..64da60450fb0 100644
@@ -1564,8 +1564,8 @@ static void init_state(struct dc *dc, struct dc_state *context)
 
 struct dc_state *dc_create_state(struct dc *dc)
 {
-	struct dc_state *context = kzalloc(sizeof(struct dc_state),
-					   GFP_KERNEL);
+	struct dc_state *context = kvzalloc(sizeof(struct dc_state),
+					    GFP_KERNEL);
 
 	if (!context)
 		return NULL;
Signature · 1 line
2.25.4

Did a quick test, it seems to resolve the issue for me. If you could apply one or both of:

I'd appreciate it, but it's not a big deal. Thanks!
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw

Will do. Thanks!

Alex

Quoted 36 lines · On Mon, Oct 26, 2020 at 12:56 PM Alex Xu (Hello71) <[email protected]> wrote:

Excerpts from Alex Deucher's message of October 26, 2020 10:30 am:

Quoted 27 lines

It looks this was accidently lost in a follow up patch. dc context is large and we don't need contiguous pages.

Fixes e4863f118a7d ("drm/amd/display: Multi display cause system lag on mode change")
Cc Aric Cyr <[email protected]>
Cc Alex Xu <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -3
index 7ff029143722..64da60450fb0 100644
@@ -1564,8 +1564,8 @@ static void init_state(struct dc *dc, struct dc_state *context)
 
 struct dc_state *dc_create_state(struct dc *dc)
 {
-     struct dc_state *context = kzalloc(sizeof(struct dc_state),
-                                        GFP_KERNEL);
+     struct dc_state *context = kvzalloc(sizeof(struct dc_state),
+                                         GFP_KERNEL);
 
      if (!context)
              return NULL;
--
Quoted 3 lines

2.25.4

Did a quick test, it seems to resolve the issue for me. If you could apply one or both of:

Quoted 4 lines

I'd appreciate it, but it's not a big deal. Thanks!

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx