Commit d6d437d9 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/mgag200: Store flags from PCI driver data in device structure

The flags field in struct mga_device has been unused so far. We now
use it to store flag bits from the PCI driver.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Fixes: 81da87f6 ("drm: Replace drm_gem_vram_push_to_system() with kunmap + unpin")
Cc: John Donnelly <john.p.donnelly@oracle.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: "Y.C. Chen" <yc_chen@aspeedtech.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "José Roberto de Souza" <jose.souza@intel.com>
Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.3+
Link: https://patchwork.freedesktop.org/patch/msgid/20191126101529.20356-3-tzimmermann@suse.de
parent 3a8a5aba
...@@ -151,6 +151,7 @@ enum mga_type { ...@@ -151,6 +151,7 @@ enum mga_type {
}; };
#define MGAG200_TYPE_MASK (0x000000ff) #define MGAG200_TYPE_MASK (0x000000ff)
#define MGAG200_FLAG_MASK (0x00ffff00)
#define IS_G200_SE(mdev) (mdev->type == G200_SE_A || mdev->type == G200_SE_B) #define IS_G200_SE(mdev) (mdev->type == G200_SE_A || mdev->type == G200_SE_B)
...@@ -188,6 +189,13 @@ mgag200_type_from_driver_data(kernel_ulong_t driver_data) ...@@ -188,6 +189,13 @@ mgag200_type_from_driver_data(kernel_ulong_t driver_data)
{ {
return (enum mga_type)(driver_data & MGAG200_TYPE_MASK); return (enum mga_type)(driver_data & MGAG200_TYPE_MASK);
} }
static inline unsigned long
mgag200_flags_from_driver_data(kernel_ulong_t driver_data)
{
return driver_data & MGAG200_FLAG_MASK;
}
/* mgag200_mode.c */ /* mgag200_mode.c */
int mgag200_modeset_init(struct mga_device *mdev); int mgag200_modeset_init(struct mga_device *mdev);
void mgag200_modeset_fini(struct mga_device *mdev); void mgag200_modeset_fini(struct mga_device *mdev);
......
...@@ -94,6 +94,7 @@ static int mgag200_device_init(struct drm_device *dev, ...@@ -94,6 +94,7 @@ static int mgag200_device_init(struct drm_device *dev,
struct mga_device *mdev = dev->dev_private; struct mga_device *mdev = dev->dev_private;
int ret, option; int ret, option;
mdev->flags = mgag200_flags_from_driver_data(flags);
mdev->type = mgag200_type_from_driver_data(flags); mdev->type = mgag200_type_from_driver_data(flags);
/* Hardcode the number of CRTCs to 1 */ /* Hardcode the number of CRTCs to 1 */
......
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