Commit a0ba992d authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Add cursor-plane data structure

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: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210209134632.12157-7-tzimmermann@suse.de
parent 718c2286
...@@ -81,6 +81,9 @@ enum ast_tx_chip { ...@@ -81,6 +81,9 @@ enum ast_tx_chip {
#define AST_DRAM_4Gx16 7 #define AST_DRAM_4Gx16 7
#define AST_DRAM_8Gx16 8 #define AST_DRAM_8Gx16 8
/*
* Cursor plane
*/
#define AST_MAX_HWC_WIDTH 64 #define AST_MAX_HWC_WIDTH 64
#define AST_MAX_HWC_HEIGHT 64 #define AST_MAX_HWC_HEIGHT 64
...@@ -99,6 +102,20 @@ enum ast_tx_chip { ...@@ -99,6 +102,20 @@ enum ast_tx_chip {
#define AST_HWC_SIGNATURE_HOTSPOTX 0x14 #define AST_HWC_SIGNATURE_HOTSPOTX 0x14
#define AST_HWC_SIGNATURE_HOTSPOTY 0x18 #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 ast_i2c_chan {
struct i2c_adapter adapter; struct i2c_adapter adapter;
struct drm_device *dev; struct drm_device *dev;
...@@ -116,6 +133,10 @@ to_ast_connector(struct drm_connector *connector) ...@@ -116,6 +133,10 @@ to_ast_connector(struct drm_connector *connector)
return container_of(connector, struct ast_connector, base); return container_of(connector, struct ast_connector, base);
} }
/*
* Device
*/
struct ast_private { struct ast_private {
struct drm_device base; struct drm_device base;
...@@ -136,7 +157,7 @@ struct ast_private { ...@@ -136,7 +157,7 @@ struct ast_private {
} cursor; } cursor;
struct drm_plane primary_plane; struct drm_plane primary_plane;
struct drm_plane cursor_plane; struct ast_cursor_plane cursor_plane;
struct drm_crtc crtc; struct drm_crtc crtc;
struct drm_encoder encoder; struct drm_encoder encoder;
struct ast_connector connector; struct ast_connector connector;
......
...@@ -932,7 +932,8 @@ static const struct drm_plane_funcs ast_cursor_plane_funcs = { ...@@ -932,7 +932,8 @@ static const struct drm_plane_funcs ast_cursor_plane_funcs = {
static int ast_cursor_plane_init(struct ast_private *ast) static int ast_cursor_plane_init(struct ast_private *ast)
{ {
struct drm_device *dev = &ast->base; 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; size_t size, i;
struct drm_gem_vram_object *gbo; struct drm_gem_vram_object *gbo;
int ret; int ret;
...@@ -1178,7 +1179,7 @@ static int ast_crtc_init(struct drm_device *dev) ...@@ -1178,7 +1179,7 @@ static int ast_crtc_init(struct drm_device *dev)
int ret; int ret;
ret = drm_crtc_init_with_planes(dev, crtc, &ast->primary_plane, 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); NULL);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment