Skip to content

Commit ef35089

Browse files
author
Thomas Zimmermann
committed
drm/nouveau: Run DRM default client setup
Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client. The nouveau driver specifies a preferred color mode depending on the available video memory, with a default of 32. Adapt this for the new client interface. v5: - select DRM_CLIENT_SELECTION v2: - style changes Signed-off-by: Thomas Zimmermann <[email protected]> Cc: Karol Herbst <[email protected]> Cc: Lyude Paul <[email protected]> Cc: Danilo Krummrich <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Acked-by: Danilo Krummrich <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4269f5c commit ef35089

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/gpu/drm/nouveau/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config DRM_NOUVEAU
44
depends on DRM && PCI && MMU
55
select IOMMU_API
66
select FW_LOADER
7+
select DRM_CLIENT_SELECTION
78
select DRM_DISPLAY_DP_HELPER
89
select DRM_DISPLAY_HDMI_HELPER
910
select DRM_DISPLAY_HELPER

drivers/gpu/drm/nouveau/nouveau_drm.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/dynamic_debug.h>
3232

3333
#include <drm/drm_aperture.h>
34+
#include <drm/drm_client_setup.h>
3435
#include <drm/drm_drv.h>
3536
#include <drm/drm_fbdev_ttm.h>
3637
#include <drm/drm_gem_ttm_helper.h>
@@ -836,6 +837,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
836837
{
837838
struct nvkm_device *device;
838839
struct nouveau_drm *drm;
840+
const struct drm_format_info *format;
839841
int ret;
840842

841843
if (vga_switcheroo_client_probe_defer(pdev))
@@ -873,9 +875,11 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
873875
goto fail_pci;
874876

875877
if (drm->client.device.info.ram_size <= 32 * 1024 * 1024)
876-
drm_fbdev_ttm_setup(drm->dev, 8);
878+
format = drm_format_info(DRM_FORMAT_C8);
877879
else
878-
drm_fbdev_ttm_setup(drm->dev, 32);
880+
format = NULL;
881+
882+
drm_client_setup(drm->dev, format);
879883

880884
quirk_broken_nv_runpm(pdev);
881885
return 0;
@@ -1317,6 +1321,8 @@ driver_stub = {
13171321
.dumb_create = nouveau_display_dumb_create,
13181322
.dumb_map_offset = drm_gem_ttm_dumb_map_offset,
13191323

1324+
DRM_FBDEV_TTM_DRIVER_OPS,
1325+
13201326
.name = DRIVER_NAME,
13211327
.desc = DRIVER_DESC,
13221328
#ifdef GIT_REVISION

0 commit comments

Comments
 (0)