summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-06-01 14:25:17 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2022-06-07 10:39:54 +0300
commitb62d943e9686e791dd39f8bde302fc27446cdca9 (patch)
treedc05ebabd25938439ebab8d913acc86eabd772d7 /drivers/gpu/drm/mgag200/mgag200_g200ew3.c
parentd45e32c9d98ce7c22a4bafe69cee58165b59533b (diff)
downloadlinux-b62d943e9686e791dd39f8bde302fc27446cdca9.tar.xz
drm/mgag200: Implement new init logic
Rework mgag200_regs_init() and mgag200_mm_init() into device preinit and init functions. The preinit function, mgag200_device_preinit(), requests and maps a device's I/O and video memory. The init function, mgag200_device_init() initializes the state of struct mga_device. Splitting the initialization between the two functions is necessary to perform per-model operations between the two calls, such as reading the unique revision ID on G200SEs. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Tested-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220601112522.5774-6-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_g200ew3.c')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200ew3.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
index 971d40874cf3..89346815e107 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
@@ -12,7 +12,7 @@
static resource_size_t mgag200_g200ew3_device_probe_vram(struct mga_device *mdev)
{
- resource_size_t vram_size = mdev->mc.vram_size;
+ resource_size_t vram_size = resource_size(mdev->vram_res);
if (vram_size >= 0x1000000)
vram_size = vram_size - 0x400000;
@@ -39,14 +39,11 @@ struct mga_device *mgag200_g200ew3_device_create(struct pci_dev *pdev,
if (ret)
return ERR_PTR(ret);
- mdev->flags = flags;
- mdev->type = type;
-
- ret = mgag200_regs_init(mdev);
+ ret = mgag200_device_preinit(mdev);
if (ret)
return ERR_PTR(ret);
- ret = mgag200_mm_init(mdev);
+ ret = mgag200_device_init(mdev, type, flags);
if (ret)
return ERR_PTR(ret);