Message ID | 20191126101529.20356-2-tzimmermann@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/mgag200: Workaround HW bug with non-0 offset | expand |
Hi Thomas, On Tue, 26 Nov 2019 at 10:15, Thomas Zimmermann <tzimmermann@suse.de> wrote: > > 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: 81da87f63a1e ("drm: Replace drm_gem_vram_push_to_system() with kunmap + unpin") Are you sure the fixes tag is correct? Neither the commit summary nor the patch itself seems related to the changes below. HTH Emil
Hi Emil Am 27.11.19 um 17:29 schrieb Emil Velikov: > Hi Thomas, > > On Tue, 26 Nov 2019 at 10:15, Thomas Zimmermann <tzimmermann@suse.de> wrote: >> >> 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: 81da87f63a1e ("drm: Replace drm_gem_vram_push_to_system() with kunmap + unpin") > > Are you sure the fixes tag is correct? Neither the commit summary nor > the patch itself seems related to the changes below. Yes, it's correct. It's part of a patch series [1][2][3] that fixes the bug. Best regards Thomas [1] https://cgit.freedesktop.org/drm/drm-tip/commit/?id=3a8a5aba142a44eaeba0cb0ec1b4a8f177b5e59a [2] https://cgit.freedesktop.org/drm/drm-tip/commit/?id=d6d437d97d54c85a1a93967b2745e31dff03365a [3] https://cgit.freedesktop.org/drm/drm-tip/commit/?id=1591fadf857cdbaf2baa55e421af99a61354713c > > HTH > Emil > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >
On 2019/11/27, Thomas Zimmermann wrote: > Hi Emil > > Am 27.11.19 um 17:29 schrieb Emil Velikov: > > Hi Thomas, > > > > On Tue, 26 Nov 2019 at 10:15, Thomas Zimmermann <tzimmermann@suse.de> wrote: > >> > >> 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: 81da87f63a1e ("drm: Replace drm_gem_vram_push_to_system() with kunmap + unpin") > > > > Are you sure the fixes tag is correct? Neither the commit summary nor > > the patch itself seems related to the changes below. > > Yes, it's correct. It's part of a patch series [1][2][3] that fixes the bug. > > Best regards > Thomas > > [1] > https://cgit.freedesktop.org/drm/drm-tip/commit/?id=3a8a5aba142a44eaeba0cb0ec1b4a8f177b5e59a > [2] > https://cgit.freedesktop.org/drm/drm-tip/commit/?id=d6d437d97d54c85a1a93967b2745e31dff03365a > [3] > https://cgit.freedesktop.org/drm/drm-tip/commit/?id=1591fadf857cdbaf2baa55e421af99a61354713c > I see, different alignment is required for one mga200 GPU. Personally, I would have mentioned that in the commit message. Regardless, hats off for the prompt fixup. Thanks Emil
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index 0ea9a525e57d..976404634092 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h @@ -150,6 +150,8 @@ enum mga_type { G200_EW3, }; +#define MGAG200_TYPE_MASK (0x000000ff) + #define IS_G200_SE(mdev) (mdev->type == G200_SE_A || mdev->type == G200_SE_B) struct mga_device { @@ -181,6 +183,11 @@ struct mga_device { 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 */ int mgag200_modeset_init(struct mga_device *mdev); void mgag200_modeset_fini(struct mga_device *mdev); diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 5f74aabcd3df..517c5693ad69 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -94,7 +94,7 @@ static int mgag200_device_init(struct drm_device *dev, struct mga_device *mdev = dev->dev_private; int ret, option; - mdev->type = flags; + mdev->type = mgag200_type_from_driver_data(flags); /* Hardcode the number of CRTCs to 1 */ mdev->num_crtc = 1;