Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2332b311 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau: create base display from common code



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ea7dce90
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -77,11 +77,6 @@ nv04_display_create(struct drm_device *dev)

	nouveau_hw_save_vga_fonts(dev, 1);

	ret = nouveau_object_new(nv_object(drm), NVDRM_DEVICE, 0xd1500000,
				 NV04_DISP_CLASS, NULL, 0, &disp->core);
	if (ret)
		return ret;

	nv04_crtc_create(dev, 0);
	if (nv_two_heads(dev))
		nv04_crtc_create(dev, 1);
+0 −1
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ struct nv04_display {
	struct nv04_mode_state saved_reg;
	uint32_t saved_vga_font[4][16384];
	uint32_t dac_users[4];
	struct nouveau_object *core;
	struct nouveau_bo *image[2];
};

+28 −4
Original line number Diff line number Diff line
@@ -407,10 +407,31 @@ nouveau_display_create(struct drm_device *dev)
	drm_kms_helper_poll_disable(dev);

	if (drm->vbios.dcb.entries) {
		if (nv_device(drm->device)->card_type < NV_50)
		static const u16 oclass[] = {
			NVF0_DISP_CLASS,
			NVE0_DISP_CLASS,
			NVD0_DISP_CLASS,
			NVA3_DISP_CLASS,
			NV94_DISP_CLASS,
			NVA0_DISP_CLASS,
			NV84_DISP_CLASS,
			NV50_DISP_CLASS,
			NV04_DISP_CLASS,
		};
		int i;

		for (i = 0, ret = -ENODEV; ret && i < ARRAY_SIZE(oclass); i++) {
			ret = nouveau_object_new(nv_object(drm), NVDRM_DEVICE,
						 NVDRM_DISPLAY, oclass[i],
						 NULL, 0, &disp->core);
		}

		if (ret == 0) {
			if (nv_mclass(disp->core) < NV50_DISP_CLASS)
				ret = nv04_display_create(dev);
			else
				ret = nv50_display_create(dev);
		}
	} else {
		ret = 0;
	}
@@ -439,6 +460,7 @@ void
nouveau_display_destroy(struct drm_device *dev)
{
	struct nouveau_display *disp = nouveau_display(dev);
	struct nouveau_drm *drm = nouveau_drm(dev);

	nouveau_backlight_exit(dev);
	nouveau_display_vblank_fini(dev);
@@ -449,6 +471,8 @@ nouveau_display_destroy(struct drm_device *dev)
	if (disp->dtor)
		disp->dtor(dev);

	nouveau_object_del(nv_object(drm), NVDRM_DEVICE, NVDRM_DISPLAY);

	nouveau_drm(dev)->display = NULL;
	kfree(disp);
}
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ struct nouveau_display {
	int  (*init)(struct drm_device *);
	void (*fini)(struct drm_device *);

	struct nouveau_object *core;
	struct nouveau_eventh **vblank;

	struct drm_property *dithering_mode;
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ enum nouveau_drm_handle {
	NVDRM_CLIENT  = 0xffffffff,
	NVDRM_DEVICE  = 0xdddddddd,
	NVDRM_CONTROL = 0xdddddddc,
	NVDRM_DISPLAY = 0xd1500000,
	NVDRM_PUSH    = 0xbbbb0000, /* |= client chid */
	NVDRM_CHAN    = 0xcccc0000, /* |= client chid */
	NVDRM_NVSW    = 0x55550000,
Loading