Skip to contentSkip to conversation

drm/amdgpu/display: check if fbc is available in set_static_screen_control

PATCH In review Alex Deucher 2 participants 4 messages Nov 5, 2018 2 messages not in the archive

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

PATCH 1/2 drm/amdgpu/display: check if fbc is available in set_static_screen_control

The value is dependent on whether fbc is available.

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -1
index 4789270c29d9..6c9299e33f34 100644
@@ -1738,6 +1738,7 @@ static void get_position(struct pipe_ctx **pipe_ctx,
 static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
 		int num_pipes, const struct dc_static_screen_events *events)
 {
+	struct dc *dc = pipe_ctx[0]->stream->ctx->dc;
 	unsigned int i;
 	unsigned int value = 0;
 
@@ -1750,7 +1751,8 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
 	if (events->force_trigger)
 		value |= 0x1;
 
-	value |= 0x84;
+	if (dc->fbc_compressor)
+		value |= 0x84;
 
 	for (i = 0; i < num_pipes; i++)
 		pipe_ctx[i]->stream_res.tg->funcs->
Signature · 6 lines
2.13.6

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

A message that is not in the archive (sent off-list or not yet received): 20181105192750.14135-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu/display: disable FBC

Causes a black screen on Stoney laptop.

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +2 -1
index 1a90e1a38055..ad59436a91b1 100644
@@ -1354,7 +1354,8 @@ static bool construct(
 		pool->base.sw_i2cs[i] = NULL;
 	}
 
-	dc->fbc_compressor = dce110_compressor_create(ctx);
+	/* disable FBC for now */
+	/* dc->fbc_compressor = dce110_compressor_create(ctx); */
 
 	if (!underlay_create(ctx, &pool->base))
 		goto res_create_fail;
Signature · 6 lines
2.13.6

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

A message that is not in the archive (sent off-list or not yet received): 20181105192750.14135-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#4 lore raw

Re: [PATCH 2/2] drm/amdgpu/display: disable FBC

Quoted 13 lines · Alex Deucher

Causes a black screen on Stoney laptop.

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +0 -0
index 1a90e1a38055..ad59436a91b1 100644

drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c static bool construct( · line 1358

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +2 -1
@@ -1354,7 +1354,8 @@ static bool construct(
 		pool->base.sw_i2cs[i] = NULL;
 	}
 
-	dc->fbc_compressor = dce110_compressor_create(ctx);
+	/* disable FBC for now */
+	/* dc->fbc_compressor = dce110_compressor_create(ctx); */

Maybe we should make that runtime configurable if it can be flaky, like i915's enable_fbc: https://wiki.archlinux.org/index.php/intel_graphics#Framebuffer_compression_.28enable_fbc.29

Harry

drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c static bool construct(

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +0 -0
 	if (!underlay_create(ctx, &pool->base))
 		goto res_create_fail;
 

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

#5 lore raw
In reply to a message not in the archive
Quoted 12 lines · Alex Deucher

The value is dependent on whether fbc is available.

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -0
index 4789270c29d9..6c9299e33f34 100644

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c static void get_position(struct pipe_ctx **pipe_ctx, · line 1741

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -0
@@ -1738,6 +1738,7 @@ static void get_position(struct pipe_ctx **pipe_ctx,
 static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
 		int num_pipes, const struct dc_static_screen_events *events)
 {
+	struct dc *dc = pipe_ctx[0]->stream->ctx->dc;

pipe_ctx[0] could be undefined if num_pipes == 0. I don't think this should happen but I can see a bunch of ways dc_stream_set_static_screen_events might call this with num_pipes=0. Maybe best to guard against it.

Harry

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -0
 	unsigned int i;
 	unsigned int value = 0;
 

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c static void set_static_screen_control(struct pipe_ctx **pipe_ctx, · line 1758

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -1
@@ -1750,7 +1751,8 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
 	if (events->force_trigger)
 		value |= 0x1;
 
-	value |= 0x84;
+	if (dc->fbc_compressor)
+		value |= 0x84;
 
 	for (i = 0; i < num_pipes; i++)
 		pipe_ctx[i]->stream_res.tg->funcs->

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