nv30.c 3.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Copyright 2012 Red Hat Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: Ben Skeggs
 */
24
#include "priv.h"
25 26

int
27
nv30_identify(struct nvkm_device *device)
28 29 30
{
	switch (device->chipset) {
	case 0x30:
31
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
32
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
33
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
34
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
35
		device->oclass[NVDEV_ENGINE_GR     ] = &nv30_gr_oclass;
36
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
37 38
		break;
	case 0x35:
39
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
40
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
41
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
42
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
43
		device->oclass[NVDEV_ENGINE_GR     ] = &nv35_gr_oclass;
44
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
45 46
		break;
	case 0x31:
47
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
48
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
49
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
50
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
51
		device->oclass[NVDEV_ENGINE_GR     ] = &nv30_gr_oclass;
52
		device->oclass[NVDEV_ENGINE_MPEG   ] = &nv31_mpeg_oclass;
53
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
54 55
		break;
	case 0x36:
56
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
57
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
58
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
59
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
60
		device->oclass[NVDEV_ENGINE_GR     ] = &nv35_gr_oclass;
61
		device->oclass[NVDEV_ENGINE_MPEG   ] = &nv31_mpeg_oclass;
62
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
63 64
		break;
	case 0x34:
65
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
66
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
67
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
68
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
69
		device->oclass[NVDEV_ENGINE_GR     ] = &nv34_gr_oclass;
70
		device->oclass[NVDEV_ENGINE_MPEG   ] = &nv31_mpeg_oclass;
71
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
72 73 74 75 76 77 78
		break;
	default:
		return -EINVAL;
	}

	return 0;
}