Thomas Zimmermann
9053cad2f0
drm/mgag200: Clear <page> field during MM init
...
The modesetting code initialized the memory-related register CRTCEXT4.
Move this code to MM initialization.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-7-tzimmermann@suse.de
2020-08-03 09:42:44 +02:00
Thomas Zimmermann
b9fa77ec1a
drm/mgag200: Set MISC memory flags in mm init code
...
The modesetting code initialized several memory-related flags in the
MISC register. Move this code to MM initialization.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730102844.10995-6-tzimmermann@suse.de
2020-08-03 09:42:35 +02:00
Thomas Zimmermann
832eddf5d8
drm/mgag200: Embed instance of struct drm_device in struct mga_device
...
Following current best practice, the instance of struct drm_device is now
embedded in struct mga_device. The respective field has been renamed from
'dev' to 'base' to reflect the relationship. Conversion from DRM device is
done via upcast. Using dev_private is no longer possible.
The patch also open-codes drm_dev_alloc() and DRM device initialization
is now performed by a call to drm_device_init().
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-14-tzimmermann@suse.de
2020-06-11 10:06:10 +02:00
Thomas Zimmermann
a71ff21e11
drm/mgag200: Switch to managed MM
...
The memory-management code now cleans up automatically as part of
device destruction.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-8-tzimmermann@suse.de
2020-06-11 10:05:47 +02:00
Thomas Zimmermann
e9f896b76c
drm/mgag200: Merge VRAM setup into MM initialization
...
The VRAM setup in mgag200_drv.c is part of memory management and
should be done in the same place. Merge the code into the memory
management's init function.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-7-tzimmermann@suse.de
2020-06-11 10:05:44 +02:00
Thomas Zimmermann
0956c329a4
drm/mgag200: Lookup VRAM PCI BAR start and length only once
...
The MM setup code on mgag200 reads PCI BAR 0's start and length
several times. Reusing these values makes the code more readable.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-6-tzimmermann@suse.de
2020-06-11 10:05:41 +02:00
Thomas Zimmermann
e7b9db6a14
drm/mgag200: Rename mgag200_ttm.c to mgag200_mm.c
...
The mgag200 driver does not use TTM any longer. Rename the related file
to mgag200_mm.c (as in 'memory management').
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-5-tzimmermann@suse.de
2020-06-11 10:05:38 +02:00