diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2020-02-03 16:52:56 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2020-02-06 10:33:58 +0100 |
commit | 8bc5732cad8e1ce1f78c0d893dbd1e134b014ce7 (patch) | |
tree | 3c2849eacbd30421261fa6bbaea9bf5f829c5610 /drivers/gpu/drm/bochs | |
parent | 80f7c3f77697159bafa259f92ac942f143326e90 (diff) | |
download | linux-stable-8bc5732cad8e1ce1f78c0d893dbd1e134b014ce7.tar.gz linux-stable-8bc5732cad8e1ce1f78c0d893dbd1e134b014ce7.tar.bz2 linux-stable-8bc5732cad8e1ce1f78c0d893dbd1e134b014ce7.zip |
drm/bochs: Implement struct drm_mode_config_funcs.mode_valid
The implementation of struct drm_mode_config_funcs.mode_valid verifies
that enough video memory is available for a given display mode. This
replaces similar functionality in bochs_connector_mode_valid().
v2:
* remove bochs_connector_mode_valid(), which now serves no purpose
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200203155258.9346-3-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/bochs')
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_kms.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index ff275faee88d..cc93ff74fbd8 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c @@ -83,28 +83,8 @@ static int bochs_connector_get_modes(struct drm_connector *connector) return count; } -static enum drm_mode_status bochs_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) -{ - struct bochs_device *bochs = - container_of(connector, struct bochs_device, connector); - unsigned long size = mode->hdisplay * mode->vdisplay * 4; - - /* - * Make sure we can fit two framebuffers into video memory. - * This allows up to 1600x1200 with 16 MB (default size). - * If you want more try this: - * 'qemu -vga std -global VGA.vgamem_mb=32 $otherargs' - */ - if (size * 2 > bochs->fb_size) - return MODE_BAD; - - return MODE_OK; -} - static const struct drm_connector_helper_funcs bochs_connector_connector_helper_funcs = { .get_modes = bochs_connector_get_modes, - .mode_valid = bochs_connector_mode_valid, }; static const struct drm_connector_funcs bochs_connector_connector_funcs = { @@ -148,6 +128,7 @@ bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file, const struct drm_mode_config_funcs bochs_mode_funcs = { .fb_create = bochs_gem_fb_create, + .mode_valid = drm_vram_helper_mode_valid, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, }; |