forked from mirrors/linux
		
	drm/nouveau/gsp: add usermode class id to gpu hal
Use usermode class ID from nvkm_rm_gpu, instead of copying it from the non-GSP HALs. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Timur Tabi <ttabi@nvidia.com> Tested-by: Timur Tabi <ttabi@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
		
							parent
							
								
									0fac5141d6
								
							
						
					
					
						commit
						cd3c62282b
					
				
					 6 changed files with 22 additions and 2 deletions
				
			
		|  | @ -16,4 +16,6 @@ ad10x_gpu = { | ||||||
| 		.wimm = GA102_DISP_WINDOW_IMM_CHANNEL_DMA, | 		.wimm = GA102_DISP_WINDOW_IMM_CHANNEL_DMA, | ||||||
| 		.curs = GA102_DISP_CURSOR, | 		.curs = GA102_DISP_CURSOR, | ||||||
| 	}, | 	}, | ||||||
|  | 
 | ||||||
|  | 	.usermode.class = AMPERE_USERMODE_A, | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -4,6 +4,9 @@ | ||||||
|  */ |  */ | ||||||
| #include "gpu.h" | #include "gpu.h" | ||||||
| 
 | 
 | ||||||
|  | #include <nvif/class.h> | ||||||
|  | 
 | ||||||
| const struct nvkm_rm_gpu | const struct nvkm_rm_gpu | ||||||
| ga100_gpu = { | ga100_gpu = { | ||||||
|  | 	.usermode.class = AMPERE_USERMODE_A, | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -16,4 +16,6 @@ ga1xx_gpu = { | ||||||
| 		.wimm = GA102_DISP_WINDOW_IMM_CHANNEL_DMA, | 		.wimm = GA102_DISP_WINDOW_IMM_CHANNEL_DMA, | ||||||
| 		.curs = GA102_DISP_CURSOR, | 		.curs = GA102_DISP_CURSOR, | ||||||
| 	}, | 	}, | ||||||
|  | 
 | ||||||
|  | 	.usermode.class = AMPERE_USERMODE_A, | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -17,6 +17,10 @@ struct nvkm_rm_gpu { | ||||||
| 			u32 curs; | 			u32 curs; | ||||||
| 		} class; | 		} class; | ||||||
| 	} disp; | 	} disp; | ||||||
|  | 
 | ||||||
|  | 	struct { | ||||||
|  | 		u32 class; | ||||||
|  | 	} usermode; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| extern const struct nvkm_rm_gpu tu1xx_gpu; | extern const struct nvkm_rm_gpu tu1xx_gpu; | ||||||
|  |  | ||||||
|  | @ -16,4 +16,6 @@ tu1xx_gpu = { | ||||||
| 		.wimm = TU102_DISP_WINDOW_IMM_CHANNEL_DMA, | 		.wimm = TU102_DISP_WINDOW_IMM_CHANNEL_DMA, | ||||||
| 		.curs = TU102_DISP_CURSOR, | 		.curs = TU102_DISP_CURSOR, | ||||||
| 	}, | 	}, | ||||||
|  | 
 | ||||||
|  | 	.usermode.class = TURING_USERMODE_A, | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -21,6 +21,8 @@ | ||||||
|  */ |  */ | ||||||
| #include "priv.h" | #include "priv.h" | ||||||
| 
 | 
 | ||||||
|  | #include <rm/gpu.h> | ||||||
|  | 
 | ||||||
| static void | static void | ||||||
| r535_vfn_dtor(struct nvkm_vfn *vfn) | r535_vfn_dtor(struct nvkm_vfn *vfn) | ||||||
| { | { | ||||||
|  | @ -32,6 +34,7 @@ r535_vfn_new(const struct nvkm_vfn_func *hw, | ||||||
| 	     struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u32 addr, | 	     struct nvkm_device *device, enum nvkm_subdev_type type, int inst, u32 addr, | ||||||
| 	     struct nvkm_vfn **pvfn) | 	     struct nvkm_vfn **pvfn) | ||||||
| { | { | ||||||
|  | 	const struct nvkm_rm_gpu *gpu = device->gsp->rm->gpu; | ||||||
| 	struct nvkm_vfn_func *rm; | 	struct nvkm_vfn_func *rm; | ||||||
| 	int ret; | 	int ret; | ||||||
| 
 | 
 | ||||||
|  | @ -39,8 +42,12 @@ r535_vfn_new(const struct nvkm_vfn_func *hw, | ||||||
| 		return -ENOMEM; | 		return -ENOMEM; | ||||||
| 
 | 
 | ||||||
| 	rm->dtor = r535_vfn_dtor; | 	rm->dtor = r535_vfn_dtor; | ||||||
| 	rm->intr = hw->intr; | 	rm->intr = &tu102_vfn_intr, | ||||||
| 	rm->user = hw->user; | 	rm->user.addr = 0x030000; | ||||||
|  | 	rm->user.size = 0x010000; | ||||||
|  | 	rm->user.base.minver = -1; | ||||||
|  | 	rm->user.base.maxver = -1; | ||||||
|  | 	rm->user.base.oclass = gpu->usermode.class; | ||||||
| 
 | 
 | ||||||
| 	ret = nvkm_vfn_new_(rm, device, type, inst, addr, pvfn); | 	ret = nvkm_vfn_new_(rm, device, type, inst, addr, pvfn); | ||||||
| 	if (ret) | 	if (ret) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Ben Skeggs
						Ben Skeggs