diff options
| author | 2025-04-01 11:37:09 +0200 | |
|---|---|---|
| committer | 2025-04-07 11:02:06 +0200 | |
| commit | 333376e9cf1cb126b87aa8c1664c4e62a58ecc23 (patch) | |
| tree | f667b3ffc2e7ea735ae2fb5f8564bfbcb582124c /drivers/gpu/drm/sysfb/simpledrm.c | |
| parent | drm/sysfb: Add struct drm_sysfb_device (diff) | |
| download | wireguard-linux-333376e9cf1cb126b87aa8c1664c4e62a58ecc23.tar.xz wireguard-linux-333376e9cf1cb126b87aa8c1664c4e62a58ecc23.zip | |
drm/sysfb: Provide single mode-init helper
Merge the mode-init functions of ofdrm and simpledrm to the new helper
drm_sysfb_mode(). Also implement the DPI defaults there. Replace the
code in each driver with the shared helper.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250401094056.32904-7-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/sysfb/simpledrm.c')
| -rw-r--r-- | drivers/gpu/drm/sysfb/simpledrm.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c index f258d8cdb6b6..149df6941b6c 100644 --- a/drivers/gpu/drm/sysfb/simpledrm.c +++ b/drivers/gpu/drm/sysfb/simpledrm.c @@ -756,18 +756,6 @@ static const struct drm_mode_config_funcs simpledrm_mode_config_funcs = { * Init / Cleanup */ -static struct drm_display_mode simpledrm_mode(unsigned int width, - unsigned int height, - unsigned int width_mm, - unsigned int height_mm) -{ - const struct drm_display_mode mode = { - DRM_MODE_INIT(60, width, height, width_mm, height_mm) - }; - - return mode; -} - static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, struct platform_device *pdev) { @@ -855,16 +843,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, return ERR_PTR(-EINVAL); } - /* - * Assume a monitor resolution of 96 dpi if physical dimensions - * are not specified to get a somewhat reasonable screen size. - */ - if (!width_mm) - width_mm = DRM_MODE_RES_MM(width, 96ul); - if (!height_mm) - height_mm = DRM_MODE_RES_MM(height, 96ul); - - sysfb->fb_mode = simpledrm_mode(width, height, width_mm, height_mm); + sysfb->fb_mode = drm_sysfb_mode(width, height, width_mm, height_mm); sysfb->fb_format = format; sysfb->fb_pitch = stride; |
