drm/bochs: Remove manual format test from fb_create
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 2 Sep 2024 10:53:39 +0000 (12:53 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Fri, 6 Sep 2024 12:41:33 +0000 (14:41 +0200)
An updated implementation of drm_gem_fb_create() already tests the
driver's planes for supported formats. [1] No need to duplicate this
test in bochs.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://elixir.bootlin.com/linux/v6.9/source/drivers/gpu/drm/drm_gem_framebuffer_helper.c#L169
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240902105546.792625-2-tzimmermann@suse.de
drivers/gpu/drm/tiny/bochs.c

index 31fc5d839e106ea4d5c8fe42d1bfc3c70291e3fb..47a45a14306cc9475bf2da13517cf3a9f140e0b0 100644 (file)
@@ -511,19 +511,8 @@ static void bochs_connector_init(struct drm_device *dev)
        }
 }
 
-static struct drm_framebuffer *
-bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file,
-                   const struct drm_mode_fb_cmd2 *mode_cmd)
-{
-       if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888 &&
-           mode_cmd->pixel_format != DRM_FORMAT_BGRX8888)
-               return ERR_PTR(-EINVAL);
-
-       return drm_gem_fb_create(dev, file, mode_cmd);
-}
-
 static const struct drm_mode_config_funcs bochs_mode_funcs = {
-       .fb_create = bochs_gem_fb_create,
+       .fb_create = drm_gem_fb_create,
        .mode_valid = drm_vram_helper_mode_valid,
        .atomic_check = drm_atomic_helper_check,
        .atomic_commit = drm_atomic_helper_commit,