Skip to content

Commit 8a99de3

Browse files
committed
drm/ast: Replace struct ast_fbdev with generic framebuffer emulation
This patch replaces ast's framebuffer console with DRM's generic implememtation. All respective code is being removed from the driver. The console is set up with a shadow buffer. The actual buffer object is not permanently pinned in video ram, but just another buffer object that the driver moves in and out of vram as necessary. The driver's function ast_crtc_do_set_base() used to contain special handling for the framebuffer console. With the new generic framebuffer, the driver does not need this code an longer. v2: * use drm_fb_helper_set_suspend_unlocked() in ast_drm_{thaw,freeze}() * dirty function no longer required Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Noralf Trønnes <noralf@tronnes.org> Link: https://patchwork.freedesktop.org/patch/315835/
1 parent f458579 commit 8a99de3

6 files changed

Lines changed: 5 additions & 392 deletions

File tree

‎drivers/gpu/drm/ast/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# Makefile for the drm device driver. This driver provides support for the
44
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
55

6-
ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o ast_dp501.o
6+
ast-y := ast_drv.o ast_main.o ast_mode.o ast_ttm.o ast_post.o ast_dp501.o
77

88
obj-$(CONFIG_DRM_AST) := ast.o

‎drivers/gpu/drm/ast/ast_drv.c‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,28 +100,21 @@ ast_pci_remove(struct pci_dev *pdev)
100100
static int ast_drm_freeze(struct drm_device *dev)
101101
{
102102
drm_kms_helper_poll_disable(dev);
103-
104103
pci_save_state(dev->pdev);
104+
drm_fb_helper_set_suspend_unlocked(dev->fb_helper, true);
105105

106-
console_lock();
107-
ast_fbdev_set_suspend(dev, 1);
108-
console_unlock();
109106
return 0;
110107
}
111108

112109
static int ast_drm_thaw(struct drm_device *dev)
113110
{
114-
int error = 0;
115-
116111
ast_post_gpu(dev);
117112

118113
drm_mode_config_reset(dev);
119114
drm_helper_resume_force_mode(dev);
115+
drm_fb_helper_set_suspend_unlocked(dev->fb_helper, false);
120116

121-
console_lock();
122-
ast_fbdev_set_suspend(dev, 0);
123-
console_unlock();
124-
return error;
117+
return 0;
125118
}
126119

127120
static int ast_drm_resume(struct drm_device *dev)

‎drivers/gpu/drm/ast/ast_drv.h‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ enum ast_tx_chip {
8181
#define AST_DRAM_4Gx16 7
8282
#define AST_DRAM_8Gx16 8
8383

84-
struct ast_fbdev;
85-
8684
struct ast_private {
8785
struct drm_device *dev;
8886

@@ -96,8 +94,6 @@ struct ast_private {
9694
uint32_t mclk;
9795
uint32_t vram_size;
9896

99-
struct ast_fbdev *fbdev;
100-
10197
int fb_mtrr;
10298

10399
struct drm_gem_object *cursor_cache;
@@ -239,14 +235,6 @@ struct ast_encoder {
239235
struct drm_encoder base;
240236
};
241237

242-
struct ast_fbdev {
243-
struct drm_fb_helper helper; /* must be first */
244-
void *sysram;
245-
int size;
246-
int x1, y1, x2, y2; /* dirty rect */
247-
spinlock_t dirty_lock;
248-
};
249-
250238
#define to_ast_crtc(x) container_of(x, struct ast_crtc, base)
251239
#define to_ast_connector(x) container_of(x, struct ast_connector, base)
252240
#define to_ast_encoder(x) container_of(x, struct ast_encoder, base)
@@ -289,11 +277,6 @@ struct ast_vbios_mode_info {
289277
extern int ast_mode_init(struct drm_device *dev);
290278
extern void ast_mode_fini(struct drm_device *dev);
291279

292-
int ast_fbdev_init(struct drm_device *dev);
293-
void ast_fbdev_fini(struct drm_device *dev);
294-
void ast_fbdev_set_suspend(struct drm_device *dev, int state);
295-
void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr);
296-
297280
#define AST_MM_ALIGN_SHIFT 4
298281
#define AST_MM_ALIGN_MASK ((1 << AST_MM_ALIGN_SHIFT) - 1)
299282

0 commit comments

Comments
 (0)