dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail
@ 2021-01-27 12:02 Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 01/12] drm/ast: Add constants for VGACRCB register bits Thomas Zimmermann
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

Ast has vmap calls in its cursor's atomic_update function. This is not
supported as vmap might aquire the dma reservation lock. While at it,
cleanup the whole cursor code: the patchset removes all possible runtime
errors from the atomic_update function and reduces the overhead from
vmap calls on the HW cursor BOs to a minimum.

Patches 1 to 3 update the cursor code and prepare before the refactoring.

Patch 4 and 5 inline the cursor update logic into the rsp cursor-plane
functions. This is mostly about moving code around.

Patches 6 to 8 and 12 add a dedicated cursor plane that maintains the two
BOs for HW cursors. The HW cursor BOs are permanently pinned and vmapped
while the cursor plane is initialized. Thus removing the related vmap
operations from atomic_update.

Patches 9 to 11 moves more vmap code out of atomic_update. BOs with cursor
image data from userspace are vmapped and vunmapped in prepare_fb and
cleanup_fb. Instead the actual update of the cursor image is moved from
prepare_fb to atomic_update.

With the patchset applied, all cursor preparation is performed before
the commit-tail functions; while the actual update is performed within.

Tested by running X11 and Weston on ast hardware.

Thomas Zimmermann (12):
  drm/ast: Add constants for VGACRCB register bits
  drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check
  drm/ast: Initialize planes in helper functions
  drm/ast: Allocate HW cursor BOs during cursor-plane initialization
  drm/ast: Inline ast cursor-update functions into modesetting code
  drm/ast: Add cursor-plane data structure
  drm/ast: Store cursor BOs in cursor plane
  drm/ast: Map HW cursor BOs permanently
  drm/ast: Introduce dedicated cursor-plane state
  drm/ast: Fix cursor BO pinning and mapping
  drm/ast: Move all of the cursor-update functionality to atomic_update
  drm/ast: Store each HW cursor offset after pinning the rsp BO

 drivers/gpu/drm/ast/Makefile     |   3 +-
 drivers/gpu/drm/ast/ast_cursor.c | 286 ----------------------
 drivers/gpu/drm/ast/ast_drv.h    |  47 ++--
 drivers/gpu/drm/ast/ast_mode.c   | 397 +++++++++++++++++++++++++++----
 4 files changed, 389 insertions(+), 344 deletions(-)
 delete mode 100644 drivers/gpu/drm/ast/ast_cursor.c


base-commit: 3836b7fdfad40e2bac5dc882332f42bed6942cf4
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
--
2.30.0

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

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

* [PATCH 01/12] drm/ast: Add constants for VGACRCB register bits
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 02/12] drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check Thomas Zimmermann
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

Set the bits in VGACRCB with constants. Alo move the rsp code into a
helper function.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_cursor.c | 21 +++++++++++++++------
 drivers/gpu/drm/ast/ast_drv.h    |  3 +++
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
index fac1ee79c372..024858371f64 100644
--- a/drivers/gpu/drm/ast/ast_cursor.c
+++ b/drivers/gpu/drm/ast/ast_cursor.c
@@ -236,6 +236,19 @@ static void ast_cursor_set_location(struct ast_private *ast, u16 x, u16 y,
 	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc7, y1);
 }
 
+static void ast_set_cursor_enabled(struct ast_private *ast, bool enabled)
+{
+	static const u8 mask = (u8)~(AST_IO_VGACRCB_HWC_16BPP |
+				     AST_IO_VGACRCB_HWC_ENABLED);
+
+	u8 vgacrcb = AST_IO_VGACRCB_HWC_16BPP;
+
+	if (enabled)
+		vgacrcb |= AST_IO_VGACRCB_HWC_ENABLED;
+
+	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, mask, vgacrcb);
+}
+
 void ast_cursor_show(struct ast_private *ast, int x, int y,
 		     unsigned int offset_x, unsigned int offset_y)
 {
@@ -245,7 +258,6 @@ void ast_cursor_show(struct ast_private *ast, int x, int y,
 	u8 x_offset, y_offset;
 	u8 __iomem *dst;
 	u8 __iomem *sig;
-	u8 jreg;
 	int ret;
 
 	ret = drm_gem_vram_vmap(gbo, &map);
@@ -274,13 +286,10 @@ void ast_cursor_show(struct ast_private *ast, int x, int y,
 
 	ast_cursor_set_location(ast, x, y, x_offset, y_offset);
 
-	/* dummy write to fire HWC */
-	jreg = 0x02 |
-	       0x01; /* enable ARGB4444 cursor */
-	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, 0xfc, jreg);
+	ast_set_cursor_enabled(ast, true); /* dummy write to fire HWC */
 }
 
 void ast_cursor_hide(struct ast_private *ast)
 {
-	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, 0xfc, 0x00);
+	ast_set_cursor_enabled(ast, false);
 }
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index f871fc36c2f7..1575e8e636d7 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -179,6 +179,9 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
 
 #define AST_IO_VGAIR1_VREFRESH		BIT(3)
 
+#define AST_IO_VGACRCB_HWC_ENABLED     BIT(1)
+#define AST_IO_VGACRCB_HWC_16BPP       BIT(0) /* set: ARGB4444, cleared: 2bpp palette */
+
 #define __ast_read(x) \
 static inline u##x ast_read##x(struct ast_private *ast, u32 reg) { \
 u##x val = 0;\
-- 
2.30.0

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

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

* [PATCH 02/12] drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 01/12] drm/ast: Add constants for VGACRCB register bits Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 03/12] drm/ast: Initialize planes in helper functions Thomas Zimmermann
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

Use AST_MAX_HWC_HEIGHT for setting offset_y in the cursor plane's
atomic_check. The code used AST_MAX_HWC_WIDTH instead. This worked
because both constants has the same value.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 988b270fea5e..758c69aa7232 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -688,7 +688,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 	unsigned int offset_x, offset_y;
 
 	offset_x = AST_MAX_HWC_WIDTH - fb->width;
-	offset_y = AST_MAX_HWC_WIDTH - fb->height;
+	offset_y = AST_MAX_HWC_HEIGHT - fb->height;
 
 	if (state->fb != old_state->fb) {
 		/* A new cursor image was installed. */
-- 
2.30.0

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

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

* [PATCH 03/12] drm/ast: Initialize planes in helper functions
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 01/12] drm/ast: Add constants for VGACRCB register bits Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 02/12] drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 04/12] drm/ast: Allocate HW cursor BOs during cursor-plane initialization Thomas Zimmermann
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

This change will help with inlining cursor functions into modesetting
code. The primary plane's field used to be cleared with memset(). This
has been dropped as the memory is always allocated with kzalloc().

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 66 +++++++++++++++++++++++-----------
 1 file changed, 45 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 758c69aa7232..f86773a869f0 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -621,6 +621,26 @@ static const struct drm_plane_funcs ast_primary_plane_funcs = {
 	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
 };
 
+static int ast_primary_plane_init(struct ast_private *ast)
+{
+	struct drm_device *dev = &ast->base;
+	struct drm_plane *primary_plane = &ast->primary_plane;
+	int ret;
+
+	ret = drm_universal_plane_init(dev, primary_plane, 0x01,
+				       &ast_primary_plane_funcs,
+				       ast_primary_plane_formats,
+				       ARRAY_SIZE(ast_primary_plane_formats),
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret) {
+		drm_err(dev, "drm_universal_plane_init() failed: %d\n", ret);
+		return ret;
+	}
+	drm_plane_helper_add(primary_plane, &ast_primary_plane_helper_funcs);
+
+	return 0;
+}
+
 /*
  * Cursor plane
  */
@@ -725,6 +745,26 @@ static const struct drm_plane_funcs ast_cursor_plane_funcs = {
 	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
 };
 
+static int ast_cursor_plane_init(struct ast_private *ast)
+{
+	struct drm_device *dev = &ast->base;
+	struct drm_plane *cursor_plane = &ast->cursor_plane;
+	int ret;
+
+	ret = drm_universal_plane_init(dev, cursor_plane, 0x01,
+				       &ast_cursor_plane_funcs,
+				       ast_cursor_plane_formats,
+				       ARRAY_SIZE(ast_cursor_plane_formats),
+				       NULL, DRM_PLANE_TYPE_CURSOR, NULL);
+	if (ret) {
+		drm_err(dev, "drm_universal_plane_failed(): %d\n", ret);
+		return ret;
+	}
+	drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
+
+	return 0;
+}
+
 /*
  * CRTC
  */
@@ -1138,30 +1178,14 @@ int ast_mode_config_init(struct ast_private *ast)
 
 	dev->mode_config.helper_private = &ast_mode_config_helper_funcs;
 
-	memset(&ast->primary_plane, 0, sizeof(ast->primary_plane));
-	ret = drm_universal_plane_init(dev, &ast->primary_plane, 0x01,
-				       &ast_primary_plane_funcs,
-				       ast_primary_plane_formats,
-				       ARRAY_SIZE(ast_primary_plane_formats),
-				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
-	if (ret) {
-		drm_err(dev, "ast: drm_universal_plane_init() failed: %d\n", ret);
+
+	ret = ast_primary_plane_init(ast);
+	if (ret)
 		return ret;
-	}
-	drm_plane_helper_add(&ast->primary_plane,
-			     &ast_primary_plane_helper_funcs);
 
-	ret = drm_universal_plane_init(dev, &ast->cursor_plane, 0x01,
-				       &ast_cursor_plane_funcs,
-				       ast_cursor_plane_formats,
-				       ARRAY_SIZE(ast_cursor_plane_formats),
-				       NULL, DRM_PLANE_TYPE_CURSOR, NULL);
-	if (ret) {
-		drm_err(dev, "drm_universal_plane_failed(): %d\n", ret);
+	ret = ast_cursor_plane_init(ast);
+	if (ret)
 		return ret;
-	}
-	drm_plane_helper_add(&ast->cursor_plane,
-			     &ast_cursor_plane_helper_funcs);
 
 	ast_crtc_init(dev);
 	ast_encoder_init(dev);
-- 
2.30.0

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

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

* [PATCH 04/12] drm/ast: Allocate HW cursor BOs during cursor-plane initialization
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (2 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 03/12] drm/ast: Initialize planes in helper functions Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 05/12] drm/ast: Inline ast cursor-update functions into modesetting code Thomas Zimmermann
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

The BOs are eventually released by the cursor plane's destroy callback.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_cursor.c | 58 ------------------------------
 drivers/gpu/drm/ast/ast_drv.h    |  1 -
 drivers/gpu/drm/ast/ast_mode.c   | 62 ++++++++++++++++++++++++++++----
 3 files changed, 55 insertions(+), 66 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
index 024858371f64..31c35296a107 100644
--- a/drivers/gpu/drm/ast/ast_cursor.c
+++ b/drivers/gpu/drm/ast/ast_cursor.c
@@ -32,64 +32,6 @@
 
 #include "ast_drv.h"
 
-static void ast_cursor_fini(struct ast_private *ast)
-{
-	size_t i;
-	struct drm_gem_vram_object *gbo;
-
-	for (i = 0; i < ARRAY_SIZE(ast->cursor.gbo); ++i) {
-		gbo = ast->cursor.gbo[i];
-		drm_gem_vram_unpin(gbo);
-		drm_gem_vram_put(gbo);
-	}
-}
-
-static void ast_cursor_release(struct drm_device *dev, void *ptr)
-{
-	struct ast_private *ast = to_ast_private(dev);
-
-	ast_cursor_fini(ast);
-}
-
-/*
- * Allocate cursor BOs and pin them at the end of VRAM.
- */
-int ast_cursor_init(struct ast_private *ast)
-{
-	struct drm_device *dev = &ast->base;
-	size_t size, i;
-	struct drm_gem_vram_object *gbo;
-	int ret;
-
-	size = roundup(AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE, PAGE_SIZE);
-
-	for (i = 0; i < ARRAY_SIZE(ast->cursor.gbo); ++i) {
-		gbo = drm_gem_vram_create(dev, size, 0);
-		if (IS_ERR(gbo)) {
-			ret = PTR_ERR(gbo);
-			goto err_drm_gem_vram_put;
-		}
-		ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM |
-					    DRM_GEM_VRAM_PL_FLAG_TOPDOWN);
-		if (ret) {
-			drm_gem_vram_put(gbo);
-			goto err_drm_gem_vram_put;
-		}
-		ast->cursor.gbo[i] = gbo;
-	}
-
-	return drmm_add_action_or_reset(dev, ast_cursor_release, NULL);
-
-err_drm_gem_vram_put:
-	while (i) {
-		--i;
-		gbo = ast->cursor.gbo[i];
-		drm_gem_vram_unpin(gbo);
-		drm_gem_vram_put(gbo);
-	}
-	return ret;
-}
-
 static void update_cursor_image(u8 __iomem *dst, const u8 *src, int width, int height)
 {
 	union {
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 1575e8e636d7..c9c3950449b5 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -318,7 +318,6 @@ u8 ast_get_dp501_max_clk(struct drm_device *dev);
 void ast_init_3rdtx(struct drm_device *dev);
 
 /* ast_cursor.c */
-int ast_cursor_init(struct ast_private *ast);
 int ast_cursor_blit(struct ast_private *ast, struct drm_framebuffer *fb);
 void ast_cursor_page_flip(struct ast_private *ast);
 void ast_cursor_show(struct ast_private *ast, int x, int y,
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index f86773a869f0..99b6f7c5cb2f 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -736,10 +736,25 @@ static const struct drm_plane_helper_funcs ast_cursor_plane_helper_funcs = {
 	.atomic_disable = ast_cursor_plane_helper_atomic_disable,
 };
 
+static void ast_cursor_plane_destroy(struct drm_plane *plane)
+{
+	struct ast_private *ast = to_ast_private(plane->dev);
+	size_t i;
+	struct drm_gem_vram_object *gbo;
+
+	for (i = 0; i < ARRAY_SIZE(ast->cursor.gbo); ++i) {
+		gbo = ast->cursor.gbo[i];
+		drm_gem_vram_unpin(gbo);
+		drm_gem_vram_put(gbo);
+	}
+
+	drm_plane_cleanup(plane);
+}
+
 static const struct drm_plane_funcs ast_cursor_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
-	.destroy = drm_plane_cleanup,
+	.destroy = ast_cursor_plane_destroy,
 	.reset = drm_atomic_helper_plane_reset,
 	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
 	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
@@ -749,20 +764,57 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 {
 	struct drm_device *dev = &ast->base;
 	struct drm_plane *cursor_plane = &ast->cursor_plane;
+	size_t size, i;
+	struct drm_gem_vram_object *gbo;
 	int ret;
 
+	/*
+	 * Allocate backing storage for cursors. The BOs are permanently
+	 * pinned to the top end of the VRAM.
+	 */
+
+	size = roundup(AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE, PAGE_SIZE);
+
+	for (i = 0; i < ARRAY_SIZE(ast->cursor.gbo); ++i) {
+		gbo = drm_gem_vram_create(dev, size, 0);
+		if (IS_ERR(gbo)) {
+			ret = PTR_ERR(gbo);
+			goto err_hwc;
+		}
+		ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM |
+					    DRM_GEM_VRAM_PL_FLAG_TOPDOWN);
+		if (ret)
+			goto err_drm_gem_vram_put;
+		ast->cursor.gbo[i] = gbo;
+	}
+
+	/*
+	 * Create the cursor plane. The plane's destroy callback will release
+	 * the backing storages' BO memory.
+	 */
+
 	ret = drm_universal_plane_init(dev, cursor_plane, 0x01,
 				       &ast_cursor_plane_funcs,
 				       ast_cursor_plane_formats,
 				       ARRAY_SIZE(ast_cursor_plane_formats),
 				       NULL, DRM_PLANE_TYPE_CURSOR, NULL);
 	if (ret) {
-		drm_err(dev, "drm_universal_plane_failed(): %d\n", ret);
-		return ret;
+		drm_err(dev, "drm_universal_plane failed(): %d\n", ret);
+		goto err_hwc;
 	}
 	drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
 
 	return 0;
+
+err_hwc:
+	while (i) {
+		--i;
+		gbo = ast->cursor.gbo[i];
+		drm_gem_vram_unpin(gbo);
+err_drm_gem_vram_put:
+		drm_gem_vram_put(gbo);
+	}
+	return ret;
 }
 
 /*
@@ -1149,10 +1201,6 @@ int ast_mode_config_init(struct ast_private *ast)
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	int ret;
 
-	ret = ast_cursor_init(ast);
-	if (ret)
-		return ret;
-
 	ret = drmm_mode_config_init(dev);
 	if (ret)
 		return ret;
-- 
2.30.0

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

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

* [PATCH 05/12] drm/ast: Inline ast cursor-update functions into modesetting code
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (3 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 04/12] drm/ast: Allocate HW cursor BOs during cursor-plane initialization Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 06/12] drm/ast: Add cursor-plane data structure Thomas Zimmermann
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

The logic for cursor updates is now located in the cursor plane's
modesetting code. A number of helper functions remain to modify the
rsp registers and image.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/Makefile     |   3 +-
 drivers/gpu/drm/ast/ast_cursor.c | 237 -------------------------------
 drivers/gpu/drm/ast/ast_drv.h    |   7 -
 drivers/gpu/drm/ast/ast_mode.c   | 191 +++++++++++++++++++++++--
 4 files changed, 181 insertions(+), 257 deletions(-)
 delete mode 100644 drivers/gpu/drm/ast/ast_cursor.c

diff --git a/drivers/gpu/drm/ast/Makefile b/drivers/gpu/drm/ast/Makefile
index 2265a8a624dd..438a2d05b115 100644
--- a/drivers/gpu/drm/ast/Makefile
+++ b/drivers/gpu/drm/ast/Makefile
@@ -3,7 +3,6 @@
 # Makefile for the drm device driver.  This driver provides support for the
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
 
-ast-y := ast_cursor.o ast_drv.o ast_main.o ast_mm.o ast_mode.o ast_post.o \
-	 ast_dp501.o
+ast-y := ast_drv.o ast_main.o ast_mm.o ast_mode.o ast_post.o ast_dp501.o
 
 obj-$(CONFIG_DRM_AST) := ast.o
diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
deleted file mode 100644
index 31c35296a107..000000000000
--- a/drivers/gpu/drm/ast/ast_cursor.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- * Parts based on xf86-video-ast
- * Copyright (c) 2005 ASPEED Technology Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- */
-/*
- * Authors: Dave Airlie <airlied@redhat.com>
- */
-
-#include <drm/drm_gem_vram_helper.h>
-#include <drm/drm_managed.h>
-
-#include "ast_drv.h"
-
-static void update_cursor_image(u8 __iomem *dst, const u8 *src, int width, int height)
-{
-	union {
-		u32 ul;
-		u8 b[4];
-	} srcdata32[2], data32;
-	union {
-		u16 us;
-		u8 b[2];
-	} data16;
-	u32 csum = 0;
-	s32 alpha_dst_delta, last_alpha_dst_delta;
-	u8 __iomem *dstxor;
-	const u8 *srcxor;
-	int i, j;
-	u32 per_pixel_copy, two_pixel_copy;
-
-	alpha_dst_delta = AST_MAX_HWC_WIDTH << 1;
-	last_alpha_dst_delta = alpha_dst_delta - (width << 1);
-
-	srcxor = src;
-	dstxor = (u8 *)dst + last_alpha_dst_delta + (AST_MAX_HWC_HEIGHT - height) * alpha_dst_delta;
-	per_pixel_copy = width & 1;
-	two_pixel_copy = width >> 1;
-
-	for (j = 0; j < height; j++) {
-		for (i = 0; i < two_pixel_copy; i++) {
-			srcdata32[0].ul = *((u32 *)srcxor) & 0xf0f0f0f0;
-			srcdata32[1].ul = *((u32 *)(srcxor + 4)) & 0xf0f0f0f0;
-			data32.b[0] = srcdata32[0].b[1] | (srcdata32[0].b[0] >> 4);
-			data32.b[1] = srcdata32[0].b[3] | (srcdata32[0].b[2] >> 4);
-			data32.b[2] = srcdata32[1].b[1] | (srcdata32[1].b[0] >> 4);
-			data32.b[3] = srcdata32[1].b[3] | (srcdata32[1].b[2] >> 4);
-
-			writel(data32.ul, dstxor);
-			csum += data32.ul;
-
-			dstxor += 4;
-			srcxor += 8;
-
-		}
-
-		for (i = 0; i < per_pixel_copy; i++) {
-			srcdata32[0].ul = *((u32 *)srcxor) & 0xf0f0f0f0;
-			data16.b[0] = srcdata32[0].b[1] | (srcdata32[0].b[0] >> 4);
-			data16.b[1] = srcdata32[0].b[3] | (srcdata32[0].b[2] >> 4);
-			writew(data16.us, dstxor);
-			csum += (u32)data16.us;
-
-			dstxor += 2;
-			srcxor += 4;
-		}
-		dstxor += last_alpha_dst_delta;
-	}
-
-	/* write checksum + signature */
-	dst += AST_HWC_SIZE;
-	writel(csum, dst);
-	writel(width, dst + AST_HWC_SIGNATURE_SizeX);
-	writel(height, dst + AST_HWC_SIGNATURE_SizeY);
-	writel(0, dst + AST_HWC_SIGNATURE_HOTSPOTX);
-	writel(0, dst + AST_HWC_SIGNATURE_HOTSPOTY);
-}
-
-int ast_cursor_blit(struct ast_private *ast, struct drm_framebuffer *fb)
-{
-	struct drm_device *dev = &ast->base;
-	struct drm_gem_vram_object *dst_gbo = ast->cursor.gbo[ast->cursor.next_index];
-	struct drm_gem_vram_object *src_gbo = drm_gem_vram_of_gem(fb->obj[0]);
-	struct dma_buf_map src_map, dst_map;
-	void __iomem *dst;
-	void *src;
-	int ret;
-
-	if (drm_WARN_ON_ONCE(dev, fb->width > AST_MAX_HWC_WIDTH) ||
-	    drm_WARN_ON_ONCE(dev, fb->height > AST_MAX_HWC_HEIGHT))
-		return -EINVAL;
-
-	ret = drm_gem_vram_vmap(src_gbo, &src_map);
-	if (ret)
-		return ret;
-	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
-
-	ret = drm_gem_vram_vmap(dst_gbo, &dst_map);
-	if (ret)
-		goto err_drm_gem_vram_vunmap;
-	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
-
-	/* do data transfer to cursor BO */
-	update_cursor_image(dst, src, fb->width, fb->height);
-
-	drm_gem_vram_vunmap(dst_gbo, &dst_map);
-	drm_gem_vram_vunmap(src_gbo, &src_map);
-
-	return 0;
-
-err_drm_gem_vram_vunmap:
-	drm_gem_vram_vunmap(src_gbo, &src_map);
-	return ret;
-}
-
-static void ast_cursor_set_base(struct ast_private *ast, u64 address)
-{
-	u8 addr0 = (address >> 3) & 0xff;
-	u8 addr1 = (address >> 11) & 0xff;
-	u8 addr2 = (address >> 19) & 0xff;
-
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc8, addr0);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc9, addr1);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xca, addr2);
-}
-
-void ast_cursor_page_flip(struct ast_private *ast)
-{
-	struct drm_device *dev = &ast->base;
-	struct drm_gem_vram_object *gbo;
-	s64 off;
-
-	gbo = ast->cursor.gbo[ast->cursor.next_index];
-
-	off = drm_gem_vram_offset(gbo);
-	if (drm_WARN_ON_ONCE(dev, off < 0))
-		return; /* Bug: we didn't pin the cursor HW BO to VRAM. */
-
-	ast_cursor_set_base(ast, off);
-
-	++ast->cursor.next_index;
-	ast->cursor.next_index %= ARRAY_SIZE(ast->cursor.gbo);
-}
-
-static void ast_cursor_set_location(struct ast_private *ast, u16 x, u16 y,
-				    u8 x_offset, u8 y_offset)
-{
-	u8 x0 = (x & 0x00ff);
-	u8 x1 = (x & 0x0f00) >> 8;
-	u8 y0 = (y & 0x00ff);
-	u8 y1 = (y & 0x0700) >> 8;
-
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc2, x_offset);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc3, y_offset);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc4, x0);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc5, x1);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc6, y0);
-	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc7, y1);
-}
-
-static void ast_set_cursor_enabled(struct ast_private *ast, bool enabled)
-{
-	static const u8 mask = (u8)~(AST_IO_VGACRCB_HWC_16BPP |
-				     AST_IO_VGACRCB_HWC_ENABLED);
-
-	u8 vgacrcb = AST_IO_VGACRCB_HWC_16BPP;
-
-	if (enabled)
-		vgacrcb |= AST_IO_VGACRCB_HWC_ENABLED;
-
-	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, mask, vgacrcb);
-}
-
-void ast_cursor_show(struct ast_private *ast, int x, int y,
-		     unsigned int offset_x, unsigned int offset_y)
-{
-	struct drm_device *dev = &ast->base;
-	struct drm_gem_vram_object *gbo = ast->cursor.gbo[ast->cursor.next_index];
-	struct dma_buf_map map;
-	u8 x_offset, y_offset;
-	u8 __iomem *dst;
-	u8 __iomem *sig;
-	int ret;
-
-	ret = drm_gem_vram_vmap(gbo, &map);
-	if (drm_WARN_ONCE(dev, ret, "drm_gem_vram_vmap() failed, ret=%d\n", ret))
-		return;
-	dst = map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
-
-	sig = dst + AST_HWC_SIZE;
-	writel(x, sig + AST_HWC_SIGNATURE_X);
-	writel(y, sig + AST_HWC_SIGNATURE_Y);
-
-	drm_gem_vram_vunmap(gbo, &map);
-
-	if (x < 0) {
-		x_offset = (-x) + offset_x;
-		x = 0;
-	} else {
-		x_offset = offset_x;
-	}
-	if (y < 0) {
-		y_offset = (-y) + offset_y;
-		y = 0;
-	} else {
-		y_offset = offset_y;
-	}
-
-	ast_cursor_set_location(ast, x, y, x_offset, y_offset);
-
-	ast_set_cursor_enabled(ast, true); /* dummy write to fire HWC */
-}
-
-void ast_cursor_hide(struct ast_private *ast)
-{
-	ast_set_cursor_enabled(ast, false);
-}
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index c9c3950449b5..2761fa547c35 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -317,11 +317,4 @@ bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata);
 u8 ast_get_dp501_max_clk(struct drm_device *dev);
 void ast_init_3rdtx(struct drm_device *dev);
 
-/* ast_cursor.c */
-int ast_cursor_blit(struct ast_private *ast, struct drm_framebuffer *fb);
-void ast_cursor_page_flip(struct ast_private *ast);
-void ast_cursor_show(struct ast_private *ast, int x, int y,
-		     unsigned int offset_x, unsigned int offset_y);
-void ast_cursor_hide(struct ast_private *ast);
-
 #endif
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 99b6f7c5cb2f..968ee0c69ec3 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -645,6 +645,110 @@ static int ast_primary_plane_init(struct ast_private *ast)
  * Cursor plane
  */
 
+static void ast_update_cursor_image(u8 __iomem *dst, const u8 *src, int width, int height)
+{
+	union {
+		u32 ul;
+		u8 b[4];
+	} srcdata32[2], data32;
+	union {
+		u16 us;
+		u8 b[2];
+	} data16;
+	u32 csum = 0;
+	s32 alpha_dst_delta, last_alpha_dst_delta;
+	u8 __iomem *dstxor;
+	const u8 *srcxor;
+	int i, j;
+	u32 per_pixel_copy, two_pixel_copy;
+
+	alpha_dst_delta = AST_MAX_HWC_WIDTH << 1;
+	last_alpha_dst_delta = alpha_dst_delta - (width << 1);
+
+	srcxor = src;
+	dstxor = (u8 *)dst + last_alpha_dst_delta + (AST_MAX_HWC_HEIGHT - height) * alpha_dst_delta;
+	per_pixel_copy = width & 1;
+	two_pixel_copy = width >> 1;
+
+	for (j = 0; j < height; j++) {
+		for (i = 0; i < two_pixel_copy; i++) {
+			srcdata32[0].ul = *((u32 *)srcxor) & 0xf0f0f0f0;
+			srcdata32[1].ul = *((u32 *)(srcxor + 4)) & 0xf0f0f0f0;
+			data32.b[0] = srcdata32[0].b[1] | (srcdata32[0].b[0] >> 4);
+			data32.b[1] = srcdata32[0].b[3] | (srcdata32[0].b[2] >> 4);
+			data32.b[2] = srcdata32[1].b[1] | (srcdata32[1].b[0] >> 4);
+			data32.b[3] = srcdata32[1].b[3] | (srcdata32[1].b[2] >> 4);
+
+			writel(data32.ul, dstxor);
+			csum += data32.ul;
+
+			dstxor += 4;
+			srcxor += 8;
+
+		}
+
+		for (i = 0; i < per_pixel_copy; i++) {
+			srcdata32[0].ul = *((u32 *)srcxor) & 0xf0f0f0f0;
+			data16.b[0] = srcdata32[0].b[1] | (srcdata32[0].b[0] >> 4);
+			data16.b[1] = srcdata32[0].b[3] | (srcdata32[0].b[2] >> 4);
+			writew(data16.us, dstxor);
+			csum += (u32)data16.us;
+
+			dstxor += 2;
+			srcxor += 4;
+		}
+		dstxor += last_alpha_dst_delta;
+	}
+
+	/* write checksum + signature */
+	dst += AST_HWC_SIZE;
+	writel(csum, dst);
+	writel(width, dst + AST_HWC_SIGNATURE_SizeX);
+	writel(height, dst + AST_HWC_SIGNATURE_SizeY);
+	writel(0, dst + AST_HWC_SIGNATURE_HOTSPOTX);
+	writel(0, dst + AST_HWC_SIGNATURE_HOTSPOTY);
+}
+
+static void ast_set_cursor_base(struct ast_private *ast, u64 address)
+{
+	u8 addr0 = (address >> 3) & 0xff;
+	u8 addr1 = (address >> 11) & 0xff;
+	u8 addr2 = (address >> 19) & 0xff;
+
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc8, addr0);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc9, addr1);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xca, addr2);
+}
+
+static void ast_set_cursor_location(struct ast_private *ast, u16 x, u16 y,
+				    u8 x_offset, u8 y_offset)
+{
+	u8 x0 = (x & 0x00ff);
+	u8 x1 = (x & 0x0f00) >> 8;
+	u8 y0 = (y & 0x00ff);
+	u8 y1 = (y & 0x0700) >> 8;
+
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc2, x_offset);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc3, y_offset);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc4, x0);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc5, x1);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc6, y0);
+	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc7, y1);
+}
+
+static void ast_set_cursor_enabled(struct ast_private *ast, bool enabled)
+{
+	static const u8 mask = (u8)~(AST_IO_VGACRCB_HWC_16BPP |
+				     AST_IO_VGACRCB_HWC_ENABLED);
+
+	u8 vgacrcb = AST_IO_VGACRCB_HWC_16BPP;
+
+	if (enabled)
+		vgacrcb |= AST_IO_VGACRCB_HWC_ENABLED;
+
+	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, mask, vgacrcb);
+}
+
 static const uint32_t ast_cursor_plane_formats[] = {
 	DRM_FORMAT_ARGB8888,
 };
@@ -654,20 +758,40 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 				   struct drm_plane_state *new_state)
 {
 	struct drm_framebuffer *fb = new_state->fb;
-	struct drm_crtc *crtc = new_state->crtc;
-	struct ast_private *ast;
+	struct ast_private *ast = to_ast_private(plane->dev);
+	struct drm_gem_vram_object *dst_gbo = ast->cursor.gbo[ast->cursor.next_index];
+	struct drm_gem_vram_object *src_gbo;
+	struct dma_buf_map src_map, dst_map;
+	void __iomem *dst;
+	void *src;
 	int ret;
 
-	if (!crtc || !fb)
+	if (!fb)
 		return 0;
 
-	ast = to_ast_private(plane->dev);
+	src_gbo = drm_gem_vram_of_gem(fb->obj[0]);
 
-	ret = ast_cursor_blit(ast, fb);
+	ret = drm_gem_vram_vmap(src_gbo, &src_map);
 	if (ret)
 		return ret;
+	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
+
+	ret = drm_gem_vram_vmap(dst_gbo, &dst_map);
+	if (ret)
+		goto err_drm_gem_vram_vunmap;
+	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
+
+	/* do data transfer to cursor BO */
+	ast_update_cursor_image(dst, src, fb->width, fb->height);
+
+	drm_gem_vram_vunmap(dst_gbo, &dst_map);
+	drm_gem_vram_vunmap(src_gbo, &src_map);
 
 	return 0;
+
+err_drm_gem_vram_vunmap:
+	drm_gem_vram_vunmap(src_gbo, &src_map);
+	return ret;
 }
 
 static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
@@ -705,18 +829,63 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 	struct drm_plane_state *state = plane->state;
 	struct drm_framebuffer *fb = state->fb;
 	struct ast_private *ast = to_ast_private(plane->dev);
+	struct drm_device *dev = &ast->base;
+	struct drm_gem_vram_object *gbo = ast->cursor.gbo[ast->cursor.next_index];
 	unsigned int offset_x, offset_y;
+	s64 off;
+	struct dma_buf_map map;
+	u16 x, y;
+	u8 x_offset, y_offset;
+	u8 __iomem *dst;
+	u8 __iomem *sig;
+	int ret;
 
-	offset_x = AST_MAX_HWC_WIDTH - fb->width;
-	offset_y = AST_MAX_HWC_HEIGHT - fb->height;
+	gbo = ast->cursor.gbo[ast->cursor.next_index];
 
 	if (state->fb != old_state->fb) {
 		/* A new cursor image was installed. */
-		ast_cursor_page_flip(ast);
+		off = drm_gem_vram_offset(gbo);
+		if (drm_WARN_ON_ONCE(dev, off < 0))
+			return; /* Bug: we didn't pin the cursor HW BO to VRAM. */
+		ast_set_cursor_base(ast, off);
+
+		++ast->cursor.next_index;
+		ast->cursor.next_index %= ARRAY_SIZE(ast->cursor.gbo);
+	}
+
+	ret = drm_gem_vram_vmap(gbo, &map);
+	if (drm_WARN_ONCE(dev, ret, "drm_gem_vram_vmap() failed, ret=%d\n", ret))
+		return;
+	dst = map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
+
+	sig = dst + AST_HWC_SIZE;
+	writel(state->crtc_x, sig + AST_HWC_SIGNATURE_X);
+	writel(state->crtc_y, sig + AST_HWC_SIGNATURE_Y);
+
+	drm_gem_vram_vunmap(gbo, &map);
+
+	offset_x = AST_MAX_HWC_WIDTH - fb->width;
+	offset_y = AST_MAX_HWC_HEIGHT - fb->height;
+
+	if (state->crtc_x < 0) {
+		x_offset = (-state->crtc_x) + offset_x;
+		x = 0;
+	} else {
+		x_offset = offset_x;
+		x = state->crtc_x;
 	}
+	if (state->crtc_y < 0) {
+		y_offset = (-state->crtc_y) + offset_y;
+		y = 0;
+	} else {
+		y_offset = offset_y;
+		y = state->crtc_y;
+	}
+
+	ast_set_cursor_location(ast, x, y, x_offset, y_offset);
 
-	ast_cursor_show(ast, state->crtc_x, state->crtc_y,
-			offset_x, offset_y);
+	/* dummy write to fire HWC */
+	ast_set_cursor_enabled(ast, true);
 }
 
 static void
@@ -725,7 +894,7 @@ ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane,
 {
 	struct ast_private *ast = to_ast_private(plane->dev);
 
-	ast_cursor_hide(ast);
+	ast_set_cursor_enabled(ast, false);
 }
 
 static const struct drm_plane_helper_funcs ast_cursor_plane_helper_funcs = {
-- 
2.30.0

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

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

* [PATCH 06/12] drm/ast: Add cursor-plane data structure
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (4 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 05/12] drm/ast: Inline ast cursor-update functions into modesetting code Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 07/12] drm/ast: Store cursor BOs in cursor plane Thomas Zimmermann
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

Cursor state is currently located throughout struct ast_private. Having
struct ast_cursor_plane as dedicated data structure for cursors helps to
organize the modesetting code.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_drv.h  | 23 ++++++++++++++++++++++-
 drivers/gpu/drm/ast/ast_mode.c |  5 +++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 2761fa547c35..9eefd3f01f4c 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -81,6 +81,9 @@ enum ast_tx_chip {
 #define AST_DRAM_4Gx16   7
 #define AST_DRAM_8Gx16   8
 
+/*
+ * Cursor plane
+ */
 
 #define AST_MAX_HWC_WIDTH	64
 #define AST_MAX_HWC_HEIGHT	64
@@ -99,6 +102,20 @@ enum ast_tx_chip {
 #define AST_HWC_SIGNATURE_HOTSPOTX	0x14
 #define AST_HWC_SIGNATURE_HOTSPOTY	0x18
 
+struct ast_cursor_plane {
+	struct drm_plane base;
+};
+
+static inline struct ast_cursor_plane *
+to_ast_cursor_plane(struct drm_plane *plane)
+{
+	return container_of(plane, struct ast_cursor_plane, base);
+}
+
+/*
+ * Connector with i2c channel
+ */
+
 struct ast_i2c_chan {
 	struct i2c_adapter adapter;
 	struct drm_device *dev;
@@ -116,6 +133,10 @@ to_ast_connector(struct drm_connector *connector)
 	return container_of(connector, struct ast_connector, base);
 }
 
+/*
+ * Device
+ */
+
 struct ast_private {
 	struct drm_device base;
 
@@ -136,7 +157,7 @@ struct ast_private {
 	} cursor;
 
 	struct drm_plane primary_plane;
-	struct drm_plane cursor_plane;
+	struct ast_cursor_plane cursor_plane;
 	struct drm_crtc crtc;
 	struct drm_encoder encoder;
 	struct ast_connector connector;
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 968ee0c69ec3..9dc70aa62fef 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -932,7 +932,8 @@ static const struct drm_plane_funcs ast_cursor_plane_funcs = {
 static int ast_cursor_plane_init(struct ast_private *ast)
 {
 	struct drm_device *dev = &ast->base;
-	struct drm_plane *cursor_plane = &ast->cursor_plane;
+	struct ast_cursor_plane *ast_cursor_plane = &ast->cursor_plane;
+	struct drm_plane *cursor_plane = &ast_cursor_plane->base;
 	size_t size, i;
 	struct drm_gem_vram_object *gbo;
 	int ret;
@@ -1178,7 +1179,7 @@ static int ast_crtc_init(struct drm_device *dev)
 	int ret;
 
 	ret = drm_crtc_init_with_planes(dev, crtc, &ast->primary_plane,
-					&ast->cursor_plane, &ast_crtc_funcs,
+					&ast->cursor_plane.base, &ast_crtc_funcs,
 					NULL);
 	if (ret)
 		return ret;
-- 
2.30.0

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

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

* [PATCH 07/12] drm/ast: Store cursor BOs in cursor plane
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (5 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 06/12] drm/ast: Add cursor-plane data structure Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 08/12] drm/ast: Map HW cursor BOs permanently Thomas Zimmermann
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

The cursor uses two BOs in video RAM to implement double buffering. Store
both in struct ast_cursor_plane.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_drv.h  | 11 ++++++-----
 drivers/gpu/drm/ast/ast_mode.c | 27 +++++++++++++++------------
 2 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 9eefd3f01f4c..4117c49096d4 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -104,6 +104,12 @@ enum ast_tx_chip {
 
 struct ast_cursor_plane {
 	struct drm_plane base;
+
+	struct {
+		struct drm_gem_vram_object *gbo;
+	} hwc[AST_DEFAULT_HWC_NUM];
+
+	unsigned int next_hwc_index;
 };
 
 static inline struct ast_cursor_plane *
@@ -151,11 +157,6 @@ struct ast_private {
 
 	int fb_mtrr;
 
-	struct {
-		struct drm_gem_vram_object *gbo[AST_DEFAULT_HWC_NUM];
-		unsigned int next_index;
-	} cursor;
-
 	struct drm_plane primary_plane;
 	struct ast_cursor_plane cursor_plane;
 	struct drm_crtc crtc;
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 9dc70aa62fef..dfff30e3d411 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -757,9 +757,10 @@ static int
 ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 				   struct drm_plane_state *new_state)
 {
+	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	struct drm_framebuffer *fb = new_state->fb;
-	struct ast_private *ast = to_ast_private(plane->dev);
-	struct drm_gem_vram_object *dst_gbo = ast->cursor.gbo[ast->cursor.next_index];
+	struct drm_gem_vram_object *dst_gbo =
+		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
 	struct drm_gem_vram_object *src_gbo;
 	struct dma_buf_map src_map, dst_map;
 	void __iomem *dst;
@@ -826,11 +827,13 @@ static void
 ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 				      struct drm_plane_state *old_state)
 {
+	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	struct drm_plane_state *state = plane->state;
 	struct drm_framebuffer *fb = state->fb;
 	struct ast_private *ast = to_ast_private(plane->dev);
 	struct drm_device *dev = &ast->base;
-	struct drm_gem_vram_object *gbo = ast->cursor.gbo[ast->cursor.next_index];
+	struct drm_gem_vram_object *gbo =
+		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
 	unsigned int offset_x, offset_y;
 	s64 off;
 	struct dma_buf_map map;
@@ -840,7 +843,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 	u8 __iomem *sig;
 	int ret;
 
-	gbo = ast->cursor.gbo[ast->cursor.next_index];
+	gbo = ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
 
 	if (state->fb != old_state->fb) {
 		/* A new cursor image was installed. */
@@ -849,8 +852,8 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 			return; /* Bug: we didn't pin the cursor HW BO to VRAM. */
 		ast_set_cursor_base(ast, off);
 
-		++ast->cursor.next_index;
-		ast->cursor.next_index %= ARRAY_SIZE(ast->cursor.gbo);
+		++ast_cursor_plane->next_hwc_index;
+		ast_cursor_plane->next_hwc_index %= ARRAY_SIZE(ast_cursor_plane->hwc);
 	}
 
 	ret = drm_gem_vram_vmap(gbo, &map);
@@ -907,12 +910,12 @@ static const struct drm_plane_helper_funcs ast_cursor_plane_helper_funcs = {
 
 static void ast_cursor_plane_destroy(struct drm_plane *plane)
 {
-	struct ast_private *ast = to_ast_private(plane->dev);
+	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	size_t i;
 	struct drm_gem_vram_object *gbo;
 
-	for (i = 0; i < ARRAY_SIZE(ast->cursor.gbo); ++i) {
-		gbo = ast->cursor.gbo[i];
+	for (i = 0; i < ARRAY_SIZE(ast_cursor_plane->hwc); ++i) {
+		gbo = ast_cursor_plane->hwc[i].gbo;
 		drm_gem_vram_unpin(gbo);
 		drm_gem_vram_put(gbo);
 	}
@@ -945,7 +948,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 
 	size = roundup(AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE, PAGE_SIZE);
 
-	for (i = 0; i < ARRAY_SIZE(ast->cursor.gbo); ++i) {
+	for (i = 0; i < ARRAY_SIZE(ast_cursor_plane->hwc); ++i) {
 		gbo = drm_gem_vram_create(dev, size, 0);
 		if (IS_ERR(gbo)) {
 			ret = PTR_ERR(gbo);
@@ -955,7 +958,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 					    DRM_GEM_VRAM_PL_FLAG_TOPDOWN);
 		if (ret)
 			goto err_drm_gem_vram_put;
-		ast->cursor.gbo[i] = gbo;
+		ast_cursor_plane->hwc[i].gbo = gbo;
 	}
 
 	/*
@@ -979,7 +982,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 err_hwc:
 	while (i) {
 		--i;
-		gbo = ast->cursor.gbo[i];
+		gbo = ast_cursor_plane->hwc[i].gbo;
 		drm_gem_vram_unpin(gbo);
 err_drm_gem_vram_put:
 		drm_gem_vram_put(gbo);
-- 
2.30.0

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

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

* [PATCH 08/12] drm/ast: Map HW cursor BOs permanently
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (6 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 07/12] drm/ast: Store cursor BOs in cursor plane Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:02 ` [PATCH 09/12] drm/ast: Introduce dedicated cursor-plane state Thomas Zimmermann
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

The BOs of the hardware cursor are now mapped permanently while the
cursor plane is being used. This reduces the CPU overhead of the cursor
plane's atomic_update function.

The change also resolves a problem with the vmap call in the commit tail.
The vmap implementation could acquire the DMA reservation lock on the
BO, which is not allowed that late in the atomic update. Removing the
vmap call from atomic_update fixes the issue.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_drv.h  |  1 +
 drivers/gpu/drm/ast/ast_mode.c | 32 +++++++++++++++-----------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 4117c49096d4..22193cfde255 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -107,6 +107,7 @@ struct ast_cursor_plane {
 
 	struct {
 		struct drm_gem_vram_object *gbo;
+		struct dma_buf_map map;
 	} hwc[AST_DEFAULT_HWC_NUM];
 
 	unsigned int next_hwc_index;
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index dfff30e3d411..b9b9badcee00 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -759,10 +759,10 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 {
 	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	struct drm_framebuffer *fb = new_state->fb;
-	struct drm_gem_vram_object *dst_gbo =
-		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
+	struct dma_buf_map dst_map =
+		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
 	struct drm_gem_vram_object *src_gbo;
-	struct dma_buf_map src_map, dst_map;
+	struct dma_buf_map src_map;
 	void __iomem *dst;
 	void *src;
 	int ret;
@@ -777,22 +777,14 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 		return ret;
 	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
 
-	ret = drm_gem_vram_vmap(dst_gbo, &dst_map);
-	if (ret)
-		goto err_drm_gem_vram_vunmap;
 	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
 
 	/* do data transfer to cursor BO */
 	ast_update_cursor_image(dst, src, fb->width, fb->height);
 
-	drm_gem_vram_vunmap(dst_gbo, &dst_map);
 	drm_gem_vram_vunmap(src_gbo, &src_map);
 
 	return 0;
-
-err_drm_gem_vram_vunmap:
-	drm_gem_vram_vunmap(src_gbo, &src_map);
-	return ret;
 }
 
 static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
@@ -841,9 +833,9 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 	u8 x_offset, y_offset;
 	u8 __iomem *dst;
 	u8 __iomem *sig;
-	int ret;
 
 	gbo = ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
+	map = ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
 
 	if (state->fb != old_state->fb) {
 		/* A new cursor image was installed. */
@@ -856,17 +848,12 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 		ast_cursor_plane->next_hwc_index %= ARRAY_SIZE(ast_cursor_plane->hwc);
 	}
 
-	ret = drm_gem_vram_vmap(gbo, &map);
-	if (drm_WARN_ONCE(dev, ret, "drm_gem_vram_vmap() failed, ret=%d\n", ret))
-		return;
 	dst = map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
 
 	sig = dst + AST_HWC_SIZE;
 	writel(state->crtc_x, sig + AST_HWC_SIGNATURE_X);
 	writel(state->crtc_y, sig + AST_HWC_SIGNATURE_Y);
 
-	drm_gem_vram_vunmap(gbo, &map);
-
 	offset_x = AST_MAX_HWC_WIDTH - fb->width;
 	offset_y = AST_MAX_HWC_HEIGHT - fb->height;
 
@@ -913,9 +900,12 @@ static void ast_cursor_plane_destroy(struct drm_plane *plane)
 	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	size_t i;
 	struct drm_gem_vram_object *gbo;
+	struct dma_buf_map map;
 
 	for (i = 0; i < ARRAY_SIZE(ast_cursor_plane->hwc); ++i) {
 		gbo = ast_cursor_plane->hwc[i].gbo;
+		map = ast_cursor_plane->hwc[i].map;
+		drm_gem_vram_vunmap(gbo, &map);
 		drm_gem_vram_unpin(gbo);
 		drm_gem_vram_put(gbo);
 	}
@@ -939,6 +929,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 	struct drm_plane *cursor_plane = &ast_cursor_plane->base;
 	size_t size, i;
 	struct drm_gem_vram_object *gbo;
+	struct dma_buf_map map;
 	int ret;
 
 	/*
@@ -958,7 +949,11 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 					    DRM_GEM_VRAM_PL_FLAG_TOPDOWN);
 		if (ret)
 			goto err_drm_gem_vram_put;
+		ret = drm_gem_vram_vmap(gbo, &map);
+		if (ret)
+			goto err_drm_gem_vram_unpin;
 		ast_cursor_plane->hwc[i].gbo = gbo;
+		ast_cursor_plane->hwc[i].map = map;
 	}
 
 	/*
@@ -983,6 +978,9 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 	while (i) {
 		--i;
 		gbo = ast_cursor_plane->hwc[i].gbo;
+		map = ast_cursor_plane->hwc[i].map;
+		drm_gem_vram_vunmap(gbo, &map);
+err_drm_gem_vram_unpin:
 		drm_gem_vram_unpin(gbo);
 err_drm_gem_vram_put:
 		drm_gem_vram_put(gbo);
-- 
2.30.0

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

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

* [PATCH 09/12] drm/ast: Introduce dedicated cursor-plane state
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (7 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 08/12] drm/ast: Map HW cursor BOs permanently Thomas Zimmermann
@ 2021-01-27 12:02 ` Thomas Zimmermann
  2021-01-27 12:03 ` [PATCH 10/12] drm/ast: Fix cursor BO pinning and mapping Thomas Zimmermann
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:02 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

The cursor-plane state struct ast_cursor_plane_state will store the
involved cursor source BO's mapping into kernel address space.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 40 ++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index b9b9badcee00..199ad9f9c932 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -749,6 +749,16 @@ static void ast_set_cursor_enabled(struct ast_private *ast, bool enabled)
 	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, mask, vgacrcb);
 }
 
+struct ast_cursor_plane_state {
+	struct drm_plane_state base;
+};
+
+static inline struct ast_cursor_plane_state *
+to_ast_cursor_plane_state(struct drm_plane_state *state)
+{
+	return container_of(state, struct ast_cursor_plane_state, base);
+}
+
 static const uint32_t ast_cursor_plane_formats[] = {
 	DRM_FORMAT_ARGB8888,
 };
@@ -913,13 +923,39 @@ static void ast_cursor_plane_destroy(struct drm_plane *plane)
 	drm_plane_cleanup(plane);
 }
 
+static struct drm_plane_state *
+ast_cursor_plane_atomic_duplicate_state(struct drm_plane *plane)
+{
+	struct ast_cursor_plane_state *new_ast_state;
+	struct drm_device *dev = plane->dev;
+
+	if (drm_WARN_ON(dev, !plane->state))
+		return NULL;
+
+	new_ast_state = kmalloc(sizeof(*new_ast_state), GFP_KERNEL);
+	if (!new_ast_state)
+		return NULL;
+	__drm_atomic_helper_plane_duplicate_state(plane, &new_ast_state->base);
+
+	return &new_ast_state->base;
+}
+
+static void ast_cursor_plane_atomic_destroy_state(struct drm_plane *plane,
+						  struct drm_plane_state *state)
+{
+	struct ast_cursor_plane_state *ast_state = to_ast_cursor_plane_state(state);
+
+	__drm_atomic_helper_plane_destroy_state(&ast_state->base);
+	kfree(ast_state);
+}
+
 static const struct drm_plane_funcs ast_cursor_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = ast_cursor_plane_destroy,
 	.reset = drm_atomic_helper_plane_reset,
-	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
-	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
+	.atomic_duplicate_state = ast_cursor_plane_atomic_duplicate_state,
+	.atomic_destroy_state = ast_cursor_plane_atomic_destroy_state,
 };
 
 static int ast_cursor_plane_init(struct ast_private *ast)
-- 
2.30.0

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

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

* [PATCH 10/12] drm/ast: Fix cursor BO pinning and mapping
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (8 preceding siblings ...)
  2021-01-27 12:02 ` [PATCH 09/12] drm/ast: Introduce dedicated cursor-plane state Thomas Zimmermann
@ 2021-01-27 12:03 ` Thomas Zimmermann
  2021-01-27 13:40   ` Thomas Zimmermann
  2021-01-27 12:03 ` [PATCH 11/12] drm/ast: Move all of the cursor-update functionality to atomic_update Thomas Zimmermann
  2021-01-27 12:03 ` [PATCH 12/12] drm/ast: Store each HW cursor offset after pinning the rsp BO Thomas Zimmermann
  11 siblings, 1 reply; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:03 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

GEM vmap operations are not allowed in commit tail. Therefore, we cannot
map the cursor source BO in atomic_update. Instead do this in prepare_fb.
There was no pin operation for the BO, so add this as well.

Hence the cursor source BO is now mapped while it's being displayed. The
change will allow us to move all cursor damage handling from prepare_fb
to atomic_update.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 37 +++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 199ad9f9c932..192d3d34b9ed 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -751,6 +751,10 @@ static void ast_set_cursor_enabled(struct ast_private *ast, bool enabled)
 
 struct ast_cursor_plane_state {
 	struct drm_plane_state base;
+
+	/* Transitional state - do not export or duplicate */
+
+	struct dma_buf_map map;
 };
 
 static inline struct ast_cursor_plane_state *
@@ -771,6 +775,7 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 	struct drm_framebuffer *fb = new_state->fb;
 	struct dma_buf_map dst_map =
 		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
+	struct ast_cursor_plane_state *new_ast_state = to_ast_cursor_plane_state(new_state);
 	struct drm_gem_vram_object *src_gbo;
 	struct dma_buf_map src_map;
 	void __iomem *dst;
@@ -782,9 +787,13 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 
 	src_gbo = drm_gem_vram_of_gem(fb->obj[0]);
 
-	ret = drm_gem_vram_vmap(src_gbo, &src_map);
+	ret = drm_gem_vram_pin(src_gbo, 0);
 	if (ret)
 		return ret;
+
+	ret = drm_gem_vram_vmap(src_gbo, &src_map);
+	if (ret)
+		goto err_drm_gem_vram_unpin;
 	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
 
 	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
@@ -792,9 +801,31 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 	/* do data transfer to cursor BO */
 	ast_update_cursor_image(dst, src, fb->width, fb->height);
 
-	drm_gem_vram_vunmap(src_gbo, &src_map);
+	new_ast_state->map = src_map;
 
 	return 0;
+
+err_drm_gem_vram_unpin:
+	drm_gem_vram_unpin(src_gbo);
+	return ret;
+}
+
+static void ast_cursor_plane_helper_cleanup_fb(struct drm_plane *plane,
+					       struct drm_plane_state *old_state)
+{
+	struct ast_cursor_plane_state *old_ast_state = to_ast_cursor_plane_state(old_state);
+	struct drm_framebuffer *fb = old_state->fb;
+	struct drm_gem_vram_object *gbo;
+	struct dma_buf_map map;
+
+	if (!fb)
+		return;
+
+	gbo = drm_gem_vram_of_gem(fb->obj[0]);
+	map = old_ast_state->map;
+
+	drm_gem_vram_vunmap(gbo, &map);
+	drm_gem_vram_unpin(gbo);
 }
 
 static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
@@ -899,7 +930,7 @@ ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane,
 
 static const struct drm_plane_helper_funcs ast_cursor_plane_helper_funcs = {
 	.prepare_fb = ast_cursor_plane_helper_prepare_fb,
-	.cleanup_fb = NULL, /* not required for cursor plane */
+	.cleanup_fb = ast_cursor_plane_helper_cleanup_fb,
 	.atomic_check = ast_cursor_plane_helper_atomic_check,
 	.atomic_update = ast_cursor_plane_helper_atomic_update,
 	.atomic_disable = ast_cursor_plane_helper_atomic_disable,
-- 
2.30.0

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

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

* [PATCH 11/12] drm/ast: Move all of the cursor-update functionality to atomic_update
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (9 preceding siblings ...)
  2021-01-27 12:03 ` [PATCH 10/12] drm/ast: Fix cursor BO pinning and mapping Thomas Zimmermann
@ 2021-01-27 12:03 ` Thomas Zimmermann
  2021-01-27 12:03 ` [PATCH 12/12] drm/ast: Store each HW cursor offset after pinning the rsp BO Thomas Zimmermann
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:03 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

We used to update the cursor image in prepare_fb. Move all this code to
atomic_update (were it belongs). Prepare_fb only prepares the source BO.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 56 +++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 192d3d34b9ed..716ed7025b41 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -771,42 +771,30 @@ static int
 ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
 				   struct drm_plane_state *new_state)
 {
-	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	struct drm_framebuffer *fb = new_state->fb;
-	struct dma_buf_map dst_map =
-		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
 	struct ast_cursor_plane_state *new_ast_state = to_ast_cursor_plane_state(new_state);
-	struct drm_gem_vram_object *src_gbo;
-	struct dma_buf_map src_map;
-	void __iomem *dst;
-	void *src;
+	struct drm_gem_vram_object *gbo;
+	struct dma_buf_map map;
 	int ret;
 
 	if (!fb)
 		return 0;
 
-	src_gbo = drm_gem_vram_of_gem(fb->obj[0]);
+	gbo = drm_gem_vram_of_gem(fb->obj[0]);
 
-	ret = drm_gem_vram_pin(src_gbo, 0);
+	ret = drm_gem_vram_pin(gbo, 0);
 	if (ret)
 		return ret;
 
-	ret = drm_gem_vram_vmap(src_gbo, &src_map);
+	ret = drm_gem_vram_vmap(gbo, &map);
 	if (ret)
 		goto err_drm_gem_vram_unpin;
-	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
-
-	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
-
-	/* do data transfer to cursor BO */
-	ast_update_cursor_image(dst, src, fb->width, fb->height);
-
-	new_ast_state->map = src_map;
+	new_ast_state->map = map;
 
 	return 0;
 
 err_drm_gem_vram_unpin:
-	drm_gem_vram_unpin(src_gbo);
+	drm_gem_vram_unpin(gbo);
 	return ret;
 }
 
@@ -862,25 +850,36 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 {
 	struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
 	struct drm_plane_state *state = plane->state;
+	struct ast_cursor_plane_state *ast_state = to_ast_cursor_plane_state(state);
 	struct drm_framebuffer *fb = state->fb;
 	struct ast_private *ast = to_ast_private(plane->dev);
 	struct drm_device *dev = &ast->base;
-	struct drm_gem_vram_object *gbo =
+	struct drm_gem_vram_object *dst_gbo =
 		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
+	struct dma_buf_map dst_map =
+		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
+	struct dma_buf_map src_map = ast_state->map;
 	unsigned int offset_x, offset_y;
 	s64 off;
-	struct dma_buf_map map;
 	u16 x, y;
 	u8 x_offset, y_offset;
 	u8 __iomem *dst;
 	u8 __iomem *sig;
+	const u8 *src;
 
-	gbo = ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
-	map = ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
+	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
+	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
+	sig = dst + AST_HWC_SIZE; /* TODO: Use mapping abstraction properly */
+
+	/*
+	 * Do data transfer to HW cursor BO. If a new cursor image was installed,
+	 * point the scanout engine to dst_gbo's offset and page-flip the HWC buffers.
+	 */
+
+	ast_update_cursor_image(dst, src, fb->width, fb->height);
 
 	if (state->fb != old_state->fb) {
-		/* A new cursor image was installed. */
-		off = drm_gem_vram_offset(gbo);
+		off = drm_gem_vram_offset(dst_gbo);
 		if (drm_WARN_ON_ONCE(dev, off < 0))
 			return; /* Bug: we didn't pin the cursor HW BO to VRAM. */
 		ast_set_cursor_base(ast, off);
@@ -889,9 +888,10 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 		ast_cursor_plane->next_hwc_index %= ARRAY_SIZE(ast_cursor_plane->hwc);
 	}
 
-	dst = map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
+	/*
+	 * Update location in HWC signature and registers.
+	 */
 
-	sig = dst + AST_HWC_SIZE;
 	writel(state->crtc_x, sig + AST_HWC_SIGNATURE_X);
 	writel(state->crtc_y, sig + AST_HWC_SIGNATURE_Y);
 
@@ -915,7 +915,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 
 	ast_set_cursor_location(ast, x, y, x_offset, y_offset);
 
-	/* dummy write to fire HWC */
+	/* Dummy write to enable HWC and make the HW pick-up the changes. */
 	ast_set_cursor_enabled(ast, true);
 }
 
-- 
2.30.0

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

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

* [PATCH 12/12] drm/ast: Store each HW cursor offset after pinning the rsp BO
  2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
                   ` (10 preceding siblings ...)
  2021-01-27 12:03 ` [PATCH 11/12] drm/ast: Move all of the cursor-update functionality to atomic_update Thomas Zimmermann
@ 2021-01-27 12:03 ` Thomas Zimmermann
  11 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 12:03 UTC (permalink / raw)
  To: airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

As HW cursor BOs never move, we can store the offset in VRAM in the
cursor-plane's HWC state. This removes the last possible source of
runtime errors from atomic_update.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_drv.h  |  1 +
 drivers/gpu/drm/ast/ast_mode.c | 19 +++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 22193cfde255..e82ab8628770 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -108,6 +108,7 @@ struct ast_cursor_plane {
 	struct {
 		struct drm_gem_vram_object *gbo;
 		struct dma_buf_map map;
+		u64 off;
 	} hwc[AST_DEFAULT_HWC_NUM];
 
 	unsigned int next_hwc_index;
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 716ed7025b41..6388e6364e8e 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -853,14 +853,12 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 	struct ast_cursor_plane_state *ast_state = to_ast_cursor_plane_state(state);
 	struct drm_framebuffer *fb = state->fb;
 	struct ast_private *ast = to_ast_private(plane->dev);
-	struct drm_device *dev = &ast->base;
-	struct drm_gem_vram_object *dst_gbo =
-		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].gbo;
 	struct dma_buf_map dst_map =
 		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
+	u64 dst_off =
+		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].off;
 	struct dma_buf_map src_map = ast_state->map;
 	unsigned int offset_x, offset_y;
-	s64 off;
 	u16 x, y;
 	u8 x_offset, y_offset;
 	u8 __iomem *dst;
@@ -879,10 +877,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 	ast_update_cursor_image(dst, src, fb->width, fb->height);
 
 	if (state->fb != old_state->fb) {
-		off = drm_gem_vram_offset(dst_gbo);
-		if (drm_WARN_ON_ONCE(dev, off < 0))
-			return; /* Bug: we didn't pin the cursor HW BO to VRAM. */
-		ast_set_cursor_base(ast, off);
+		ast_set_cursor_base(ast, dst_off);
 
 		++ast_cursor_plane->next_hwc_index;
 		ast_cursor_plane->next_hwc_index %= ARRAY_SIZE(ast_cursor_plane->hwc);
@@ -998,6 +993,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 	struct drm_gem_vram_object *gbo;
 	struct dma_buf_map map;
 	int ret;
+	s64 off;
 
 	/*
 	 * Allocate backing storage for cursors. The BOs are permanently
@@ -1019,8 +1015,14 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 		ret = drm_gem_vram_vmap(gbo, &map);
 		if (ret)
 			goto err_drm_gem_vram_unpin;
+		off = drm_gem_vram_offset(gbo);
+		if (off < 0) {
+			ret = off;
+			goto err_drm_gem_vram_vunmap;
+		}
 		ast_cursor_plane->hwc[i].gbo = gbo;
 		ast_cursor_plane->hwc[i].map = map;
+		ast_cursor_plane->hwc[i].off = off;
 	}
 
 	/*
@@ -1046,6 +1048,7 @@ static int ast_cursor_plane_init(struct ast_private *ast)
 		--i;
 		gbo = ast_cursor_plane->hwc[i].gbo;
 		map = ast_cursor_plane->hwc[i].map;
+err_drm_gem_vram_vunmap:
 		drm_gem_vram_vunmap(gbo, &map);
 err_drm_gem_vram_unpin:
 		drm_gem_vram_unpin(gbo);
-- 
2.30.0

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

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

* Re: [PATCH 10/12] drm/ast: Fix cursor BO pinning and mapping
  2021-01-27 12:03 ` [PATCH 10/12] drm/ast: Fix cursor BO pinning and mapping Thomas Zimmermann
@ 2021-01-27 13:40   ` Thomas Zimmermann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Zimmermann @ 2021-01-27 13:40 UTC (permalink / raw)
  To: airlied, daniel; +Cc: dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 4035 bytes --]



Am 27.01.21 um 13:03 schrieb Thomas Zimmermann:
> GEM vmap operations are not allowed in commit tail. Therefore, we cannot
> map the cursor source BO in atomic_update. Instead do this in prepare_fb.
> There was no pin operation for the BO, so add this as well.

Reviewing drm_gem_vram_vmap() I saw that is pins implicitly. I'll remove 
the pinning from the driver code in the patch's next iteration.

> 
> Hence the cursor source BO is now mapped while it's being displayed. The
> change will allow us to move all cursor damage handling from prepare_fb
> to atomic_update.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/ast/ast_mode.c | 37 +++++++++++++++++++++++++++++++---
>   1 file changed, 34 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index 199ad9f9c932..192d3d34b9ed 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -751,6 +751,10 @@ static void ast_set_cursor_enabled(struct ast_private *ast, bool enabled)
>   
>   struct ast_cursor_plane_state {
>   	struct drm_plane_state base;
> +
> +	/* Transitional state - do not export or duplicate */
> +
> +	struct dma_buf_map map;
>   };
>   
>   static inline struct ast_cursor_plane_state *
> @@ -771,6 +775,7 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
>   	struct drm_framebuffer *fb = new_state->fb;
>   	struct dma_buf_map dst_map =
>   		ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
> +	struct ast_cursor_plane_state *new_ast_state = to_ast_cursor_plane_state(new_state);
>   	struct drm_gem_vram_object *src_gbo;
>   	struct dma_buf_map src_map;
>   	void __iomem *dst;
> @@ -782,9 +787,13 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
>   
>   	src_gbo = drm_gem_vram_of_gem(fb->obj[0]);
>   
> -	ret = drm_gem_vram_vmap(src_gbo, &src_map);
> +	ret = drm_gem_vram_pin(src_gbo, 0);
>   	if (ret)
>   		return ret;
> +
> +	ret = drm_gem_vram_vmap(src_gbo, &src_map);
> +	if (ret)
> +		goto err_drm_gem_vram_unpin;
>   	src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
>   
>   	dst = dst_map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
> @@ -792,9 +801,31 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,
>   	/* do data transfer to cursor BO */
>   	ast_update_cursor_image(dst, src, fb->width, fb->height);
>   
> -	drm_gem_vram_vunmap(src_gbo, &src_map);
> +	new_ast_state->map = src_map;
>   
>   	return 0;
> +
> +err_drm_gem_vram_unpin:
> +	drm_gem_vram_unpin(src_gbo);
> +	return ret;
> +}
> +
> +static void ast_cursor_plane_helper_cleanup_fb(struct drm_plane *plane,
> +					       struct drm_plane_state *old_state)
> +{
> +	struct ast_cursor_plane_state *old_ast_state = to_ast_cursor_plane_state(old_state);
> +	struct drm_framebuffer *fb = old_state->fb;
> +	struct drm_gem_vram_object *gbo;
> +	struct dma_buf_map map;
> +
> +	if (!fb)
> +		return;
> +
> +	gbo = drm_gem_vram_of_gem(fb->obj[0]);
> +	map = old_ast_state->map;
> +
> +	drm_gem_vram_vunmap(gbo, &map);
> +	drm_gem_vram_unpin(gbo);
>   }
>   
>   static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
> @@ -899,7 +930,7 @@ ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane,
>   
>   static const struct drm_plane_helper_funcs ast_cursor_plane_helper_funcs = {
>   	.prepare_fb = ast_cursor_plane_helper_prepare_fb,
> -	.cleanup_fb = NULL, /* not required for cursor plane */
> +	.cleanup_fb = ast_cursor_plane_helper_cleanup_fb,
>   	.atomic_check = ast_cursor_plane_helper_atomic_check,
>   	.atomic_update = ast_cursor_plane_helper_atomic_update,
>   	.atomic_disable = ast_cursor_plane_helper_atomic_disable,
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

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

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

end of thread, other threads:[~2021-01-27 13:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 12:02 [PATCH 00/12] drm/ast: Move cursor vmap calls out of commit tail Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 01/12] drm/ast: Add constants for VGACRCB register bits Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 02/12] drm/ast: Fix invalid usage of AST_MAX_HWC_WIDTH in cursor atomic_check Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 03/12] drm/ast: Initialize planes in helper functions Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 04/12] drm/ast: Allocate HW cursor BOs during cursor-plane initialization Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 05/12] drm/ast: Inline ast cursor-update functions into modesetting code Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 06/12] drm/ast: Add cursor-plane data structure Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 07/12] drm/ast: Store cursor BOs in cursor plane Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 08/12] drm/ast: Map HW cursor BOs permanently Thomas Zimmermann
2021-01-27 12:02 ` [PATCH 09/12] drm/ast: Introduce dedicated cursor-plane state Thomas Zimmermann
2021-01-27 12:03 ` [PATCH 10/12] drm/ast: Fix cursor BO pinning and mapping Thomas Zimmermann
2021-01-27 13:40   ` Thomas Zimmermann
2021-01-27 12:03 ` [PATCH 11/12] drm/ast: Move all of the cursor-update functionality to atomic_update Thomas Zimmermann
2021-01-27 12:03 ` [PATCH 12/12] drm/ast: Store each HW cursor offset after pinning the rsp BO Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).