mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-20 02:48:32 +07:00
drm/mgag200: Extract device type from flags
Adds a conversion function that extracts the device type from the
PCI id-table flags. Allows for storing additional information in the
other flag bits.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 81da87f63a
("drm: Replace drm_gem_vram_push_to_system() with kunmap + unpin")
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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: Emil Velikov <emil.velikov@collabora.com>
Cc: "Y.C. Chen" <yc_chen@aspeedtech.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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-2-tzimmermann@suse.de
This commit is contained in:
parent
9786b65bc6
commit
3a8a5aba14
@ -150,6 +150,8 @@ enum mga_type {
|
|||||||
G200_EW3,
|
G200_EW3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MGAG200_TYPE_MASK (0x000000ff)
|
||||||
|
|
||||||
#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)
|
||||||
|
|
||||||
struct mga_device {
|
struct mga_device {
|
||||||
@ -181,6 +183,11 @@ struct mga_device {
|
|||||||
u32 unique_rev_id;
|
u32 unique_rev_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline enum mga_type
|
||||||
|
mgag200_type_from_driver_data(kernel_ulong_t driver_data)
|
||||||
|
{
|
||||||
|
return (enum mga_type)(driver_data & MGAG200_TYPE_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,7 +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->type = flags;
|
mdev->type = mgag200_type_from_driver_data(flags);
|
||||||
|
|
||||||
/* Hardcode the number of CRTCs to 1 */
|
/* Hardcode the number of CRTCs to 1 */
|
||||||
mdev->num_crtc = 1;
|
mdev->num_crtc = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user