diff options
author | Dave Airlie <airlied@redhat.com> | 2016-04-11 23:25:48 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-04 20:20:28 -0400 |
commit | 110e6f26af80dfd90b6e5c645b1aed7228aa580d (patch) | |
tree | a7e5d99bc6b2fc49461902fac77bdbd5496da5c1 | |
parent | c036554170fcc2238c32a7edd72c1b61b886428a (diff) |
drm/amd: make a type-safe cgs_device struct. (v2)
This is just a type-safety things to avoid everyone taking void *,
it doesn't change anything.
v2: agd5f: split out the dal changes into a separate patch.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/acp/acp_hw.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/acp/include/acp_gfx_if.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acp.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 92 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/include/cgs_common.h | 76 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/include/cgs_linux.h | 6 |
7 files changed, 93 insertions, 98 deletions
diff --git a/drivers/gpu/drm/amd/acp/acp_hw.c b/drivers/gpu/drm/amd/acp/acp_hw.c index 7af83f142b4b..c7d7205c9b11 100644 --- a/drivers/gpu/drm/amd/acp/acp_hw.c +++ b/drivers/gpu/drm/amd/acp/acp_hw.c | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #define mmACP_AZALIA_I2S_SELECT 0x51d4 | 35 | #define mmACP_AZALIA_I2S_SELECT 0x51d4 |
36 | 36 | ||
37 | int amd_acp_hw_init(void *cgs_device, | 37 | int amd_acp_hw_init(struct cgs_device *cgs_device, |
38 | unsigned acp_version_major, unsigned acp_version_minor) | 38 | unsigned acp_version_major, unsigned acp_version_minor) |
39 | { | 39 | { |
40 | unsigned int acp_mode = ACP_MODE_I2S; | 40 | unsigned int acp_mode = ACP_MODE_I2S; |
diff --git a/drivers/gpu/drm/amd/acp/include/acp_gfx_if.h b/drivers/gpu/drm/amd/acp/include/acp_gfx_if.h index bccf47b63899..a72ddb2f69ac 100644 --- a/drivers/gpu/drm/amd/acp/include/acp_gfx_if.h +++ b/drivers/gpu/drm/amd/acp/include/acp_gfx_if.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "cgs_linux.h" | 28 | #include "cgs_linux.h" |
29 | #include "cgs_common.h" | 29 | #include "cgs_common.h" |
30 | 30 | ||
31 | int amd_acp_hw_init(void *cgs_device, | 31 | int amd_acp_hw_init(struct cgs_device *cgs_device, |
32 | unsigned acp_version_major, unsigned acp_version_minor); | 32 | unsigned acp_version_major, unsigned acp_version_minor); |
33 | 33 | ||
34 | #endif /* _ACP_GFX_IF_H */ | 34 | #endif /* _ACP_GFX_IF_H */ |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c9fe2d56cebf..a7a53ac5f413 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1868,15 +1868,8 @@ struct amdgpu_atcs { | |||
1868 | /* | 1868 | /* |
1869 | * CGS | 1869 | * CGS |
1870 | */ | 1870 | */ |
1871 | void *amdgpu_cgs_create_device(struct amdgpu_device *adev); | 1871 | struct cgs_device *amdgpu_cgs_create_device(struct amdgpu_device *adev); |
1872 | void amdgpu_cgs_destroy_device(void *cgs_device); | 1872 | void amdgpu_cgs_destroy_device(struct cgs_device *cgs_device); |
1873 | |||
1874 | |||
1875 | /* | ||
1876 | * CGS | ||
1877 | */ | ||
1878 | void *amdgpu_cgs_create_device(struct amdgpu_device *adev); | ||
1879 | void amdgpu_cgs_destroy_device(void *cgs_device); | ||
1880 | 1873 | ||
1881 | 1874 | ||
1882 | /* GPU virtualization */ | 1875 | /* GPU virtualization */ |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.h index f6e32a639107..8a396313c86f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.h | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | struct amdgpu_acp { | 31 | struct amdgpu_acp { |
32 | struct device *parent; | 32 | struct device *parent; |
33 | void *cgs_device; | 33 | struct cgs_device *cgs_device; |
34 | struct amd_acp_private *private; | 34 | struct amd_acp_private *private; |
35 | struct mfd_cell *acp_cell; | 35 | struct mfd_cell *acp_cell; |
36 | struct resource *acp_res; | 36 | struct resource *acp_res; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index 6043dc7c3a94..8b653f2c7086 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | |||
@@ -42,7 +42,7 @@ struct amdgpu_cgs_device { | |||
42 | struct amdgpu_device *adev = \ | 42 | struct amdgpu_device *adev = \ |
43 | ((struct amdgpu_cgs_device *)cgs_device)->adev | 43 | ((struct amdgpu_cgs_device *)cgs_device)->adev |
44 | 44 | ||
45 | static int amdgpu_cgs_gpu_mem_info(void *cgs_device, enum cgs_gpu_mem_type type, | 45 | static int amdgpu_cgs_gpu_mem_info(struct cgs_device *cgs_device, enum cgs_gpu_mem_type type, |
46 | uint64_t *mc_start, uint64_t *mc_size, | 46 | uint64_t *mc_start, uint64_t *mc_size, |
47 | uint64_t *mem_size) | 47 | uint64_t *mem_size) |
48 | { | 48 | { |
@@ -73,7 +73,7 @@ static int amdgpu_cgs_gpu_mem_info(void *cgs_device, enum cgs_gpu_mem_type type, | |||
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | static int amdgpu_cgs_gmap_kmem(void *cgs_device, void *kmem, | 76 | static int amdgpu_cgs_gmap_kmem(struct cgs_device *cgs_device, void *kmem, |
77 | uint64_t size, | 77 | uint64_t size, |
78 | uint64_t min_offset, uint64_t max_offset, | 78 | uint64_t min_offset, uint64_t max_offset, |
79 | cgs_handle_t *kmem_handle, uint64_t *mcaddr) | 79 | cgs_handle_t *kmem_handle, uint64_t *mcaddr) |
@@ -102,7 +102,7 @@ static int amdgpu_cgs_gmap_kmem(void *cgs_device, void *kmem, | |||
102 | return ret; | 102 | return ret; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int amdgpu_cgs_gunmap_kmem(void *cgs_device, cgs_handle_t kmem_handle) | 105 | static int amdgpu_cgs_gunmap_kmem(struct cgs_device *cgs_device, cgs_handle_t kmem_handle) |
106 | { | 106 | { |
107 | struct amdgpu_bo *obj = (struct amdgpu_bo *)kmem_handle; | 107 | struct amdgpu_bo *obj = (struct amdgpu_bo *)kmem_handle; |
108 | 108 | ||
@@ -118,7 +118,7 @@ static int amdgpu_cgs_gunmap_kmem(void *cgs_device, cgs_handle_t kmem_handle) | |||
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | static int amdgpu_cgs_alloc_gpu_mem(void *cgs_device, | 121 | static int amdgpu_cgs_alloc_gpu_mem(struct cgs_device *cgs_device, |
122 | enum cgs_gpu_mem_type type, | 122 | enum cgs_gpu_mem_type type, |
123 | uint64_t size, uint64_t align, | 123 | uint64_t size, uint64_t align, |
124 | uint64_t min_offset, uint64_t max_offset, | 124 | uint64_t min_offset, uint64_t max_offset, |
@@ -208,7 +208,7 @@ static int amdgpu_cgs_alloc_gpu_mem(void *cgs_device, | |||
208 | return ret; | 208 | return ret; |
209 | } | 209 | } |
210 | 210 | ||
211 | static int amdgpu_cgs_free_gpu_mem(void *cgs_device, cgs_handle_t handle) | 211 | static int amdgpu_cgs_free_gpu_mem(struct cgs_device *cgs_device, cgs_handle_t handle) |
212 | { | 212 | { |
213 | struct amdgpu_bo *obj = (struct amdgpu_bo *)handle; | 213 | struct amdgpu_bo *obj = (struct amdgpu_bo *)handle; |
214 | 214 | ||
@@ -225,7 +225,7 @@ static int amdgpu_cgs_free_gpu_mem(void *cgs_device, cgs_handle_t handle) | |||
225 | return 0; | 225 | return 0; |
226 | } | 226 | } |
227 | 227 | ||
228 | static int amdgpu_cgs_gmap_gpu_mem(void *cgs_device, cgs_handle_t handle, | 228 | static int amdgpu_cgs_gmap_gpu_mem(struct cgs_device *cgs_device, cgs_handle_t handle, |
229 | uint64_t *mcaddr) | 229 | uint64_t *mcaddr) |
230 | { | 230 | { |
231 | int r; | 231 | int r; |
@@ -246,7 +246,7 @@ static int amdgpu_cgs_gmap_gpu_mem(void *cgs_device, cgs_handle_t handle, | |||
246 | return r; | 246 | return r; |
247 | } | 247 | } |
248 | 248 | ||
249 | static int amdgpu_cgs_gunmap_gpu_mem(void *cgs_device, cgs_handle_t handle) | 249 | static int amdgpu_cgs_gunmap_gpu_mem(struct cgs_device *cgs_device, cgs_handle_t handle) |
250 | { | 250 | { |
251 | int r; | 251 | int r; |
252 | struct amdgpu_bo *obj = (struct amdgpu_bo *)handle; | 252 | struct amdgpu_bo *obj = (struct amdgpu_bo *)handle; |
@@ -258,7 +258,7 @@ static int amdgpu_cgs_gunmap_gpu_mem(void *cgs_device, cgs_handle_t handle) | |||
258 | return r; | 258 | return r; |
259 | } | 259 | } |
260 | 260 | ||
261 | static int amdgpu_cgs_kmap_gpu_mem(void *cgs_device, cgs_handle_t handle, | 261 | static int amdgpu_cgs_kmap_gpu_mem(struct cgs_device *cgs_device, cgs_handle_t handle, |
262 | void **map) | 262 | void **map) |
263 | { | 263 | { |
264 | int r; | 264 | int r; |
@@ -271,7 +271,7 @@ static int amdgpu_cgs_kmap_gpu_mem(void *cgs_device, cgs_handle_t handle, | |||
271 | return r; | 271 | return r; |
272 | } | 272 | } |
273 | 273 | ||
274 | static int amdgpu_cgs_kunmap_gpu_mem(void *cgs_device, cgs_handle_t handle) | 274 | static int amdgpu_cgs_kunmap_gpu_mem(struct cgs_device *cgs_device, cgs_handle_t handle) |
275 | { | 275 | { |
276 | int r; | 276 | int r; |
277 | struct amdgpu_bo *obj = (struct amdgpu_bo *)handle; | 277 | struct amdgpu_bo *obj = (struct amdgpu_bo *)handle; |
@@ -283,20 +283,20 @@ static int amdgpu_cgs_kunmap_gpu_mem(void *cgs_device, cgs_handle_t handle) | |||
283 | return r; | 283 | return r; |
284 | } | 284 | } |
285 | 285 | ||
286 | static uint32_t amdgpu_cgs_read_register(void *cgs_device, unsigned offset) | 286 | static uint32_t amdgpu_cgs_read_register(struct cgs_device *cgs_device, unsigned offset) |
287 | { | 287 | { |
288 | CGS_FUNC_ADEV; | 288 | CGS_FUNC_ADEV; |
289 | return RREG32(offset); | 289 | return RREG32(offset); |
290 | } | 290 | } |
291 | 291 | ||
292 | static void amdgpu_cgs_write_register(void *cgs_device, unsigned offset, | 292 | static void amdgpu_cgs_write_register(struct cgs_device *cgs_device, unsigned offset, |
293 | uint32_t value) | 293 | uint32_t value) |
294 | { | 294 | { |
295 | CGS_FUNC_ADEV; | 295 | CGS_FUNC_ADEV; |
296 | WREG32(offset, value); | 296 | WREG32(offset, value); |
297 | } | 297 | } |
298 | 298 | ||
299 | static uint32_t amdgpu_cgs_read_ind_register(void *cgs_device, | 299 | static uint32_t amdgpu_cgs_read_ind_register(struct cgs_device *cgs_device, |
300 | enum cgs_ind_reg space, | 300 | enum cgs_ind_reg space, |
301 | unsigned index) | 301 | unsigned index) |
302 | { | 302 | { |
@@ -320,7 +320,7 @@ static uint32_t amdgpu_cgs_read_ind_register(void *cgs_device, | |||
320 | return 0; | 320 | return 0; |
321 | } | 321 | } |
322 | 322 | ||
323 | static void amdgpu_cgs_write_ind_register(void *cgs_device, | 323 | static void amdgpu_cgs_write_ind_register(struct cgs_device *cgs_device, |
324 | enum cgs_ind_reg space, | 324 | enum cgs_ind_reg space, |
325 | unsigned index, uint32_t value) | 325 | unsigned index, uint32_t value) |
326 | { | 326 | { |
@@ -343,7 +343,7 @@ static void amdgpu_cgs_write_ind_register(void *cgs_device, | |||
343 | WARN(1, "Invalid indirect register space"); | 343 | WARN(1, "Invalid indirect register space"); |
344 | } | 344 | } |
345 | 345 | ||
346 | static uint8_t amdgpu_cgs_read_pci_config_byte(void *cgs_device, unsigned addr) | 346 | static uint8_t amdgpu_cgs_read_pci_config_byte(struct cgs_device *cgs_device, unsigned addr) |
347 | { | 347 | { |
348 | CGS_FUNC_ADEV; | 348 | CGS_FUNC_ADEV; |
349 | uint8_t val; | 349 | uint8_t val; |
@@ -353,7 +353,7 @@ static uint8_t amdgpu_cgs_read_pci_config_byte(void *cgs_device, unsigned addr) | |||
353 | return val; | 353 | return val; |
354 | } | 354 | } |
355 | 355 | ||
356 | static uint16_t amdgpu_cgs_read_pci_config_word(void *cgs_device, unsigned addr) | 356 | static uint16_t amdgpu_cgs_read_pci_config_word(struct cgs_device *cgs_device, unsigned addr) |
357 | { | 357 | { |
358 | CGS_FUNC_ADEV; | 358 | CGS_FUNC_ADEV; |
359 | uint16_t val; | 359 | uint16_t val; |
@@ -363,7 +363,7 @@ static uint16_t amdgpu_cgs_read_pci_config_word(void *cgs_device, unsigned addr) | |||
363 | return val; | 363 | return val; |
364 | } | 364 | } |
365 | 365 | ||
366 | static uint32_t amdgpu_cgs_read_pci_config_dword(void *cgs_device, | 366 | static uint32_t amdgpu_cgs_read_pci_config_dword(struct cgs_device *cgs_device, |
367 | unsigned addr) | 367 | unsigned addr) |
368 | { | 368 | { |
369 | CGS_FUNC_ADEV; | 369 | CGS_FUNC_ADEV; |
@@ -374,7 +374,7 @@ static uint32_t amdgpu_cgs_read_pci_config_dword(void *cgs_device, | |||
374 | return val; | 374 | return val; |
375 | } | 375 | } |
376 | 376 | ||
377 | static void amdgpu_cgs_write_pci_config_byte(void *cgs_device, unsigned addr, | 377 | static void amdgpu_cgs_write_pci_config_byte(struct cgs_device *cgs_device, unsigned addr, |
378 | uint8_t value) | 378 | uint8_t value) |
379 | { | 379 | { |
380 | CGS_FUNC_ADEV; | 380 | CGS_FUNC_ADEV; |
@@ -382,7 +382,7 @@ static void amdgpu_cgs_write_pci_config_byte(void *cgs_device, unsigned addr, | |||
382 | WARN(ret, "pci_write_config_byte error"); | 382 | WARN(ret, "pci_write_config_byte error"); |
383 | } | 383 | } |
384 | 384 | ||
385 | static void amdgpu_cgs_write_pci_config_word(void *cgs_device, unsigned addr, | 385 | static void amdgpu_cgs_write_pci_config_word(struct cgs_device *cgs_device, unsigned addr, |
386 | uint16_t value) | 386 | uint16_t value) |
387 | { | 387 | { |
388 | CGS_FUNC_ADEV; | 388 | CGS_FUNC_ADEV; |
@@ -390,7 +390,7 @@ static void amdgpu_cgs_write_pci_config_word(void *cgs_device, unsigned addr, | |||
390 | WARN(ret, "pci_write_config_word error"); | 390 | WARN(ret, "pci_write_config_word error"); |
391 | } | 391 | } |
392 | 392 | ||
393 | static void amdgpu_cgs_write_pci_config_dword(void *cgs_device, unsigned addr, | 393 | static void amdgpu_cgs_write_pci_config_dword(struct cgs_device *cgs_device, unsigned addr, |
394 | uint32_t value) | 394 | uint32_t value) |
395 | { | 395 | { |
396 | CGS_FUNC_ADEV; | 396 | CGS_FUNC_ADEV; |
@@ -399,7 +399,7 @@ static void amdgpu_cgs_write_pci_config_dword(void *cgs_device, unsigned addr, | |||
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | static int amdgpu_cgs_get_pci_resource(void *cgs_device, | 402 | static int amdgpu_cgs_get_pci_resource(struct cgs_device *cgs_device, |
403 | enum cgs_resource_type resource_type, | 403 | enum cgs_resource_type resource_type, |
404 | uint64_t size, | 404 | uint64_t size, |
405 | uint64_t offset, | 405 | uint64_t offset, |
@@ -433,7 +433,7 @@ static int amdgpu_cgs_get_pci_resource(void *cgs_device, | |||
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
436 | static const void *amdgpu_cgs_atom_get_data_table(void *cgs_device, | 436 | static const void *amdgpu_cgs_atom_get_data_table(struct cgs_device *cgs_device, |
437 | unsigned table, uint16_t *size, | 437 | unsigned table, uint16_t *size, |
438 | uint8_t *frev, uint8_t *crev) | 438 | uint8_t *frev, uint8_t *crev) |
439 | { | 439 | { |
@@ -449,7 +449,7 @@ static const void *amdgpu_cgs_atom_get_data_table(void *cgs_device, | |||
449 | return NULL; | 449 | return NULL; |
450 | } | 450 | } |
451 | 451 | ||
452 | static int amdgpu_cgs_atom_get_cmd_table_revs(void *cgs_device, unsigned table, | 452 | static int amdgpu_cgs_atom_get_cmd_table_revs(struct cgs_device *cgs_device, unsigned table, |
453 | uint8_t *frev, uint8_t *crev) | 453 | uint8_t *frev, uint8_t *crev) |
454 | { | 454 | { |
455 | CGS_FUNC_ADEV; | 455 | CGS_FUNC_ADEV; |
@@ -462,7 +462,7 @@ static int amdgpu_cgs_atom_get_cmd_table_revs(void *cgs_device, unsigned table, | |||
462 | return -EINVAL; | 462 | return -EINVAL; |
463 | } | 463 | } |
464 | 464 | ||
465 | static int amdgpu_cgs_atom_exec_cmd_table(void *cgs_device, unsigned table, | 465 | static int amdgpu_cgs_atom_exec_cmd_table(struct cgs_device *cgs_device, unsigned table, |
466 | void *args) | 466 | void *args) |
467 | { | 467 | { |
468 | CGS_FUNC_ADEV; | 468 | CGS_FUNC_ADEV; |
@@ -471,33 +471,33 @@ static int amdgpu_cgs_atom_exec_cmd_table(void *cgs_device, unsigned table, | |||
471 | adev->mode_info.atom_context, table, args); | 471 | adev->mode_info.atom_context, table, args); |
472 | } | 472 | } |
473 | 473 | ||
474 | static int amdgpu_cgs_create_pm_request(void *cgs_device, cgs_handle_t *request) | 474 | static int amdgpu_cgs_create_pm_request(struct cgs_device *cgs_device, cgs_handle_t *request) |
475 | { | 475 | { |
476 | /* TODO */ | 476 | /* TODO */ |
477 | return 0; | 477 | return 0; |
478 | } | 478 | } |
479 | 479 | ||
480 | static int amdgpu_cgs_destroy_pm_request(void *cgs_device, cgs_handle_t request) | 480 | static int amdgpu_cgs_destroy_pm_request(struct cgs_device *cgs_device, cgs_handle_t request) |
481 | { | 481 | { |
482 | /* TODO */ | 482 | /* TODO */ |
483 | return 0; | 483 | return 0; |
484 | } | 484 | } |
485 | 485 | ||
486 | static int amdgpu_cgs_set_pm_request(void *cgs_device, cgs_handle_t request, | 486 | static int amdgpu_cgs_set_pm_request(struct cgs_device *cgs_device, cgs_handle_t request, |
487 | int active) | 487 | int active) |
488 | { | 488 | { |
489 | /* TODO */ | 489 | /* TODO */ |
490 | return 0; | 490 | return 0; |
491 | } | 491 | } |
492 | 492 | ||
493 | static int amdgpu_cgs_pm_request_clock(void *cgs_device, cgs_handle_t request, | 493 | static int amdgpu_cgs_pm_request_clock(struct cgs_device *cgs_device, cgs_handle_t request, |
494 | enum cgs_clock clock, unsigned freq) | 494 | enum cgs_clock clock, unsigned freq) |
495 | { | 495 | { |
496 | /* TODO */ | 496 | /* TODO */ |
497 | return 0; | 497 | return 0; |
498 | } | 498 | } |
499 | 499 | ||
500 | static int amdgpu_cgs_pm_request_engine(void *cgs_device, cgs_handle_t request, | 500 | static int amdgpu_cgs_pm_request_engine(struct cgs_device *cgs_device, cgs_handle_t request, |
501 | enum cgs_engine engine, int powered) | 501 | enum cgs_engine engine, int powered) |
502 | { | 502 | { |
503 | /* TODO */ | 503 | /* TODO */ |
@@ -506,7 +506,7 @@ static int amdgpu_cgs_pm_request_engine(void *cgs_device, cgs_handle_t request, | |||
506 | 506 | ||
507 | 507 | ||
508 | 508 | ||
509 | static int amdgpu_cgs_pm_query_clock_limits(void *cgs_device, | 509 | static int amdgpu_cgs_pm_query_clock_limits(struct cgs_device *cgs_device, |
510 | enum cgs_clock clock, | 510 | enum cgs_clock clock, |
511 | struct cgs_clock_limits *limits) | 511 | struct cgs_clock_limits *limits) |
512 | { | 512 | { |
@@ -514,7 +514,7 @@ static int amdgpu_cgs_pm_query_clock_limits(void *cgs_device, | |||
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
517 | static int amdgpu_cgs_set_camera_voltages(void *cgs_device, uint32_t mask, | 517 | static int amdgpu_cgs_set_camera_voltages(struct cgs_device *cgs_device, uint32_t mask, |
518 | const uint32_t *voltages) | 518 | const uint32_t *voltages) |
519 | { | 519 | { |
520 | DRM_ERROR("not implemented"); | 520 | DRM_ERROR("not implemented"); |
@@ -565,7 +565,7 @@ static const struct amdgpu_irq_src_funcs cgs_irq_funcs = { | |||
565 | .process = cgs_process_irq, | 565 | .process = cgs_process_irq, |
566 | }; | 566 | }; |
567 | 567 | ||
568 | static int amdgpu_cgs_add_irq_source(void *cgs_device, unsigned src_id, | 568 | static int amdgpu_cgs_add_irq_source(struct cgs_device *cgs_device, unsigned src_id, |
569 | unsigned num_types, | 569 | unsigned num_types, |
570 | cgs_irq_source_set_func_t set, | 570 | cgs_irq_source_set_func_t set, |
571 | cgs_irq_handler_func_t handler, | 571 | cgs_irq_handler_func_t handler, |
@@ -600,19 +600,19 @@ static int amdgpu_cgs_add_irq_source(void *cgs_device, unsigned src_id, | |||
600 | return ret; | 600 | return ret; |
601 | } | 601 | } |
602 | 602 | ||
603 | static int amdgpu_cgs_irq_get(void *cgs_device, unsigned src_id, unsigned type) | 603 | static int amdgpu_cgs_irq_get(struct cgs_device *cgs_device, unsigned src_id, unsigned type) |
604 | { | 604 | { |
605 | CGS_FUNC_ADEV; | 605 | CGS_FUNC_ADEV; |
606 | return amdgpu_irq_get(adev, adev->irq.sources[src_id], type); | 606 | return amdgpu_irq_get(adev, adev->irq.sources[src_id], type); |
607 | } | 607 | } |
608 | 608 | ||
609 | static int amdgpu_cgs_irq_put(void *cgs_device, unsigned src_id, unsigned type) | 609 | static int amdgpu_cgs_irq_put(struct cgs_device *cgs_device, unsigned src_id, unsigned type) |
610 | { | 610 | { |
611 | CGS_FUNC_ADEV; | 611 | CGS_FUNC_ADEV; |
612 | return amdgpu_irq_put(adev, adev->irq.sources[src_id], type); | 612 | return amdgpu_irq_put(adev, adev->irq.sources[src_id], type); |
613 | } | 613 | } |
614 | 614 | ||
615 | int amdgpu_cgs_set_clockgating_state(void *cgs_device, | 615 | int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device, |
616 | enum amd_ip_block_type block_type, | 616 | enum amd_ip_block_type block_type, |
617 | enum amd_clockgating_state state) | 617 | enum amd_clockgating_state state) |
618 | { | 618 | { |
@@ -633,7 +633,7 @@ int amdgpu_cgs_set_clockgating_state(void *cgs_device, | |||
633 | return r; | 633 | return r; |
634 | } | 634 | } |
635 | 635 | ||
636 | int amdgpu_cgs_set_powergating_state(void *cgs_device, | 636 | int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device, |
637 | enum amd_ip_block_type block_type, | 637 | enum amd_ip_block_type block_type, |
638 | enum amd_powergating_state state) | 638 | enum amd_powergating_state state) |
639 | { | 639 | { |
@@ -655,7 +655,7 @@ int amdgpu_cgs_set_powergating_state(void *cgs_device, | |||
655 | } | 655 | } |
656 | 656 | ||
657 | 657 | ||
658 | static uint32_t fw_type_convert(void *cgs_device, uint32_t fw_type) | 658 | static uint32_t fw_type_convert(struct cgs_device *cgs_device, uint32_t fw_type) |
659 | { | 659 | { |
660 | CGS_FUNC_ADEV; | 660 | CGS_FUNC_ADEV; |
661 | enum AMDGPU_UCODE_ID result = AMDGPU_UCODE_ID_MAXIMUM; | 661 | enum AMDGPU_UCODE_ID result = AMDGPU_UCODE_ID_MAXIMUM; |
@@ -695,7 +695,7 @@ static uint32_t fw_type_convert(void *cgs_device, uint32_t fw_type) | |||
695 | return result; | 695 | return result; |
696 | } | 696 | } |
697 | 697 | ||
698 | static int amdgpu_cgs_get_firmware_info(void *cgs_device, | 698 | static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, |
699 | enum cgs_ucode_id type, | 699 | enum cgs_ucode_id type, |
700 | struct cgs_firmware_info *info) | 700 | struct cgs_firmware_info *info) |
701 | { | 701 | { |
@@ -774,7 +774,7 @@ static int amdgpu_cgs_get_firmware_info(void *cgs_device, | |||
774 | return 0; | 774 | return 0; |
775 | } | 775 | } |
776 | 776 | ||
777 | static int amdgpu_cgs_query_system_info(void *cgs_device, | 777 | static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device, |
778 | struct cgs_system_info *sys_info) | 778 | struct cgs_system_info *sys_info) |
779 | { | 779 | { |
780 | CGS_FUNC_ADEV; | 780 | CGS_FUNC_ADEV; |
@@ -808,7 +808,7 @@ static int amdgpu_cgs_query_system_info(void *cgs_device, | |||
808 | return 0; | 808 | return 0; |
809 | } | 809 | } |
810 | 810 | ||
811 | static int amdgpu_cgs_get_active_displays_info(void *cgs_device, | 811 | static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device, |
812 | struct cgs_display_info *info) | 812 | struct cgs_display_info *info) |
813 | { | 813 | { |
814 | CGS_FUNC_ADEV; | 814 | CGS_FUNC_ADEV; |
@@ -851,7 +851,7 @@ static int amdgpu_cgs_get_active_displays_info(void *cgs_device, | |||
851 | } | 851 | } |
852 | 852 | ||
853 | 853 | ||
854 | static int amdgpu_cgs_notify_dpm_enabled(void *cgs_device, bool enabled) | 854 | static int amdgpu_cgs_notify_dpm_enabled(struct cgs_device *cgs_device, bool enabled) |
855 | { | 855 | { |
856 | CGS_FUNC_ADEV; | 856 | CGS_FUNC_ADEV; |
857 | 857 | ||
@@ -867,7 +867,7 @@ static int amdgpu_cgs_notify_dpm_enabled(void *cgs_device, bool enabled) | |||
867 | */ | 867 | */ |
868 | 868 | ||
869 | #if defined(CONFIG_ACPI) | 869 | #if defined(CONFIG_ACPI) |
870 | static int amdgpu_cgs_acpi_eval_object(void *cgs_device, | 870 | static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device, |
871 | struct cgs_acpi_method_info *info) | 871 | struct cgs_acpi_method_info *info) |
872 | { | 872 | { |
873 | CGS_FUNC_ADEV; | 873 | CGS_FUNC_ADEV; |
@@ -1030,14 +1030,14 @@ error: | |||
1030 | return result; | 1030 | return result; |
1031 | } | 1031 | } |
1032 | #else | 1032 | #else |
1033 | static int amdgpu_cgs_acpi_eval_object(void *cgs_device, | 1033 | static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device, |
1034 | struct cgs_acpi_method_info *info) | 1034 | struct cgs_acpi_method_info *info) |
1035 | { | 1035 | { |
1036 | return -EIO; | 1036 | return -EIO; |
1037 | } | 1037 | } |
1038 | #endif | 1038 | #endif |
1039 | 1039 | ||
1040 | int amdgpu_cgs_call_acpi_method(void *cgs_device, | 1040 | int amdgpu_cgs_call_acpi_method(struct cgs_device *cgs_device, |
1041 | uint32_t acpi_method, | 1041 | uint32_t acpi_method, |
1042 | uint32_t acpi_function, | 1042 | uint32_t acpi_function, |
1043 | void *pinput, void *poutput, | 1043 | void *pinput, void *poutput, |
@@ -1121,7 +1121,7 @@ static const struct cgs_os_ops amdgpu_cgs_os_ops = { | |||
1121 | amdgpu_cgs_irq_put | 1121 | amdgpu_cgs_irq_put |
1122 | }; | 1122 | }; |
1123 | 1123 | ||
1124 | void *amdgpu_cgs_create_device(struct amdgpu_device *adev) | 1124 | struct cgs_device *amdgpu_cgs_create_device(struct amdgpu_device *adev) |
1125 | { | 1125 | { |
1126 | struct amdgpu_cgs_device *cgs_device = | 1126 | struct amdgpu_cgs_device *cgs_device = |
1127 | kmalloc(sizeof(*cgs_device), GFP_KERNEL); | 1127 | kmalloc(sizeof(*cgs_device), GFP_KERNEL); |
@@ -1135,10 +1135,10 @@ void *amdgpu_cgs_create_device(struct amdgpu_device *adev) | |||
1135 | cgs_device->base.os_ops = &amdgpu_cgs_os_ops; | 1135 | cgs_device->base.os_ops = &amdgpu_cgs_os_ops; |
1136 | cgs_device->adev = adev; | 1136 | cgs_device->adev = adev; |
1137 | 1137 | ||
1138 | return cgs_device; | 1138 | return (struct cgs_device *)cgs_device; |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | void amdgpu_cgs_destroy_device(void *cgs_device) | 1141 | void amdgpu_cgs_destroy_device(struct cgs_device *cgs_device) |
1142 | { | 1142 | { |
1143 | kfree(cgs_device); | 1143 | kfree(cgs_device); |
1144 | } | 1144 | } |
diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h index ab84d4947247..ca1e22917e84 100644 --- a/drivers/gpu/drm/amd/include/cgs_common.h +++ b/drivers/gpu/drm/amd/include/cgs_common.h | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | #include "amd_shared.h" | 27 | #include "amd_shared.h" |
28 | 28 | ||
29 | struct cgs_device; | ||
30 | |||
29 | /** | 31 | /** |
30 | * enum cgs_gpu_mem_type - GPU memory types | 32 | * enum cgs_gpu_mem_type - GPU memory types |
31 | */ | 33 | */ |
@@ -223,7 +225,7 @@ struct cgs_acpi_method_info { | |||
223 | * | 225 | * |
224 | * Return: 0 on success, -errno otherwise | 226 | * Return: 0 on success, -errno otherwise |
225 | */ | 227 | */ |
226 | typedef int (*cgs_gpu_mem_info_t)(void *cgs_device, enum cgs_gpu_mem_type type, | 228 | typedef int (*cgs_gpu_mem_info_t)(struct cgs_device *cgs_device, enum cgs_gpu_mem_type type, |
227 | uint64_t *mc_start, uint64_t *mc_size, | 229 | uint64_t *mc_start, uint64_t *mc_size, |
228 | uint64_t *mem_size); | 230 | uint64_t *mem_size); |
229 | 231 | ||
@@ -239,7 +241,7 @@ typedef int (*cgs_gpu_mem_info_t)(void *cgs_device, enum cgs_gpu_mem_type type, | |||
239 | * | 241 | * |
240 | * Return: 0 on success, -errno otherwise | 242 | * Return: 0 on success, -errno otherwise |
241 | */ | 243 | */ |
242 | typedef int (*cgs_gmap_kmem_t)(void *cgs_device, void *kmem, uint64_t size, | 244 | typedef int (*cgs_gmap_kmem_t)(struct cgs_device *cgs_device, void *kmem, uint64_t size, |
243 | uint64_t min_offset, uint64_t max_offset, | 245 | uint64_t min_offset, uint64_t max_offset, |
244 | cgs_handle_t *kmem_handle, uint64_t *mcaddr); | 246 | cgs_handle_t *kmem_handle, uint64_t *mcaddr); |
245 | 247 | ||
@@ -250,7 +252,7 @@ typedef int (*cgs_gmap_kmem_t)(void *cgs_device, void *kmem, uint64_t size, | |||
250 | * | 252 | * |
251 | * Return: 0 on success, -errno otherwise | 253 | * Return: 0 on success, -errno otherwise |
252 | */ | 254 | */ |
253 | typedef int (*cgs_gunmap_kmem_t)(void *cgs_device, cgs_handle_t kmem_handle); | 255 | typedef int (*cgs_gunmap_kmem_t)(struct cgs_device *cgs_device, cgs_handle_t kmem_handle); |
254 | 256 | ||
255 | /** | 257 | /** |
256 | * cgs_alloc_gpu_mem() - Allocate GPU memory | 258 | * cgs_alloc_gpu_mem() - Allocate GPU memory |
@@ -279,7 +281,7 @@ typedef int (*cgs_gunmap_kmem_t)(void *cgs_device, cgs_handle_t kmem_handle); | |||
279 | * | 281 | * |
280 | * Return: 0 on success, -errno otherwise | 282 | * Return: 0 on success, -errno otherwise |
281 | */ | 283 | */ |
282 | typedef int (*cgs_alloc_gpu_mem_t)(void *cgs_device, enum cgs_gpu_mem_type type, | 284 | typedef int (*cgs_alloc_gpu_mem_t)(struct cgs_device *cgs_device, enum cgs_gpu_mem_type type, |
283 | uint64_t size, uint64_t align, | 285 | uint64_t size, uint64_t align, |
284 | uint64_t min_offset, uint64_t max_offset, | 286 | uint64_t min_offset, uint64_t max_offset, |
285 | cgs_handle_t *handle); | 287 | cgs_handle_t *handle); |
@@ -291,7 +293,7 @@ typedef int (*cgs_alloc_gpu_mem_t)(void *cgs_device, enum cgs_gpu_mem_type type, | |||
291 | * | 293 | * |
292 | * Return: 0 on success, -errno otherwise | 294 | * Return: 0 on success, -errno otherwise |
293 | */ | 295 | */ |
294 | typedef int (*cgs_free_gpu_mem_t)(void *cgs_device, cgs_handle_t handle); | 296 | typedef int (*cgs_free_gpu_mem_t)(struct cgs_device *cgs_device, cgs_handle_t handle); |
295 | 297 | ||
296 | /** | 298 | /** |
297 | * cgs_gmap_gpu_mem() - GPU-map GPU memory | 299 | * cgs_gmap_gpu_mem() - GPU-map GPU memory |
@@ -303,7 +305,7 @@ typedef int (*cgs_free_gpu_mem_t)(void *cgs_device, cgs_handle_t handle); | |||
303 | * | 305 | * |
304 | * Return: 0 on success, -errno otherwise | 306 | * Return: 0 on success, -errno otherwise |
305 | */ | 307 | */ |
306 | typedef int (*cgs_gmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle, | 308 | typedef int (*cgs_gmap_gpu_mem_t)(struct cgs_device *cgs_device, cgs_handle_t handle, |
307 | uint64_t *mcaddr); | 309 | uint64_t *mcaddr); |
308 | 310 | ||
309 | /** | 311 | /** |
@@ -315,7 +317,7 @@ typedef int (*cgs_gmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle, | |||
315 | * | 317 | * |
316 | * Return: 0 on success, -errno otherwise | 318 | * Return: 0 on success, -errno otherwise |
317 | */ | 319 | */ |
318 | typedef int (*cgs_gunmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle); | 320 | typedef int (*cgs_gunmap_gpu_mem_t)(struct cgs_device *cgs_device, cgs_handle_t handle); |
319 | 321 | ||
320 | /** | 322 | /** |
321 | * cgs_kmap_gpu_mem() - Kernel-map GPU memory | 323 | * cgs_kmap_gpu_mem() - Kernel-map GPU memory |
@@ -326,7 +328,7 @@ typedef int (*cgs_gunmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle); | |||
326 | * | 328 | * |
327 | * Return: 0 on success, -errno otherwise | 329 | * Return: 0 on success, -errno otherwise |
328 | */ | 330 | */ |
329 | typedef int (*cgs_kmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle, | 331 | typedef int (*cgs_kmap_gpu_mem_t)(struct cgs_device *cgs_device, cgs_handle_t handle, |
330 | void **map); | 332 | void **map); |
331 | 333 | ||
332 | /** | 334 | /** |
@@ -336,7 +338,7 @@ typedef int (*cgs_kmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle, | |||
336 | * | 338 | * |
337 | * Return: 0 on success, -errno otherwise | 339 | * Return: 0 on success, -errno otherwise |
338 | */ | 340 | */ |
339 | typedef int (*cgs_kunmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle); | 341 | typedef int (*cgs_kunmap_gpu_mem_t)(struct cgs_device *cgs_device, cgs_handle_t handle); |
340 | 342 | ||
341 | /** | 343 | /** |
342 | * cgs_read_register() - Read an MMIO register | 344 | * cgs_read_register() - Read an MMIO register |
@@ -345,7 +347,7 @@ typedef int (*cgs_kunmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle); | |||
345 | * | 347 | * |
346 | * Return: register value | 348 | * Return: register value |
347 | */ | 349 | */ |
348 | typedef uint32_t (*cgs_read_register_t)(void *cgs_device, unsigned offset); | 350 | typedef uint32_t (*cgs_read_register_t)(struct cgs_device *cgs_device, unsigned offset); |
349 | 351 | ||
350 | /** | 352 | /** |
351 | * cgs_write_register() - Write an MMIO register | 353 | * cgs_write_register() - Write an MMIO register |
@@ -353,7 +355,7 @@ typedef uint32_t (*cgs_read_register_t)(void *cgs_device, unsigned offset); | |||
353 | * @offset: register offset | 355 | * @offset: register offset |
354 | * @value: register value | 356 | * @value: register value |
355 | */ | 357 | */ |
356 | typedef void (*cgs_write_register_t)(void *cgs_device, unsigned offset, | 358 | typedef void (*cgs_write_register_t)(struct cgs_device *cgs_device, unsigned offset, |
357 | uint32_t value); | 359 | uint32_t value); |
358 | 360 | ||
359 | /** | 361 | /** |
@@ -363,7 +365,7 @@ typedef void (*cgs_write_register_t)(void *cgs_device, unsigned offset, | |||
363 | * | 365 | * |
364 | * Return: register value | 366 | * Return: register value |
365 | */ | 367 | */ |
366 | typedef uint32_t (*cgs_read_ind_register_t)(void *cgs_device, enum cgs_ind_reg space, | 368 | typedef uint32_t (*cgs_read_ind_register_t)(struct cgs_device *cgs_device, enum cgs_ind_reg space, |
367 | unsigned index); | 369 | unsigned index); |
368 | 370 | ||
369 | /** | 371 | /** |
@@ -372,7 +374,7 @@ typedef uint32_t (*cgs_read_ind_register_t)(void *cgs_device, enum cgs_ind_reg s | |||
372 | * @offset: register offset | 374 | * @offset: register offset |
373 | * @value: register value | 375 | * @value: register value |
374 | */ | 376 | */ |
375 | typedef void (*cgs_write_ind_register_t)(void *cgs_device, enum cgs_ind_reg space, | 377 | typedef void (*cgs_write_ind_register_t)(struct cgs_device *cgs_device, enum cgs_ind_reg space, |
376 | unsigned index, uint32_t value); | 378 | unsigned index, uint32_t value); |
377 | 379 | ||
378 | /** | 380 | /** |
@@ -382,7 +384,7 @@ typedef void (*cgs_write_ind_register_t)(void *cgs_device, enum cgs_ind_reg spac | |||
382 | * | 384 | * |
383 | * Return: Value read | 385 | * Return: Value read |
384 | */ | 386 | */ |
385 | typedef uint8_t (*cgs_read_pci_config_byte_t)(void *cgs_device, unsigned addr); | 387 | typedef uint8_t (*cgs_read_pci_config_byte_t)(struct cgs_device *cgs_device, unsigned addr); |
386 | 388 | ||
387 | /** | 389 | /** |
388 | * cgs_read_pci_config_word() - Read word from PCI configuration space | 390 | * cgs_read_pci_config_word() - Read word from PCI configuration space |
@@ -391,7 +393,7 @@ typedef uint8_t (*cgs_read_pci_config_byte_t)(void *cgs_device, unsigned addr); | |||
391 | * | 393 | * |
392 | * Return: Value read | 394 | * Return: Value read |
393 | */ | 395 | */ |
394 | typedef uint16_t (*cgs_read_pci_config_word_t)(void *cgs_device, unsigned addr); | 396 | typedef uint16_t (*cgs_read_pci_config_word_t)(struct cgs_device *cgs_device, unsigned addr); |
395 | 397 | ||
396 | /** | 398 | /** |
397 | * cgs_read_pci_config_dword() - Read dword from PCI configuration space | 399 | * cgs_read_pci_config_dword() - Read dword from PCI configuration space |
@@ -400,7 +402,7 @@ typedef uint16_t (*cgs_read_pci_config_word_t)(void *cgs_device, unsigned addr); | |||
400 | * | 402 | * |
401 | * Return: Value read | 403 | * Return: Value read |
402 | */ | 404 | */ |
403 | typedef uint32_t (*cgs_read_pci_config_dword_t)(void *cgs_device, | 405 | typedef uint32_t (*cgs_read_pci_config_dword_t)(struct cgs_device *cgs_device, |
404 | unsigned addr); | 406 | unsigned addr); |
405 | 407 | ||
406 | /** | 408 | /** |
@@ -409,7 +411,7 @@ typedef uint32_t (*cgs_read_pci_config_dword_t)(void *cgs_device, | |||
409 | * @addr: address | 411 | * @addr: address |
410 | * @value: value to write | 412 | * @value: value to write |
411 | */ | 413 | */ |
412 | typedef void (*cgs_write_pci_config_byte_t)(void *cgs_device, unsigned addr, | 414 | typedef void (*cgs_write_pci_config_byte_t)(struct cgs_device *cgs_device, unsigned addr, |
413 | uint8_t value); | 415 | uint8_t value); |
414 | 416 | ||
415 | /** | 417 | /** |
@@ -418,7 +420,7 @@ typedef void (*cgs_write_pci_config_byte_t)(void *cgs_device, unsigned addr, | |||
418 | * @addr: address, must be word-aligned | 420 | * @addr: address, must be word-aligned |
419 | * @value: value to write | 421 | * @value: value to write |
420 | */ | 422 | */ |
421 | typedef void (*cgs_write_pci_config_word_t)(void *cgs_device, unsigned addr, | 423 | typedef void (*cgs_write_pci_config_word_t)(struct cgs_device *cgs_device, unsigned addr, |
422 | uint16_t value); | 424 | uint16_t value); |
423 | 425 | ||
424 | /** | 426 | /** |
@@ -427,7 +429,7 @@ typedef void (*cgs_write_pci_config_word_t)(void *cgs_device, unsigned addr, | |||
427 | * @addr: address, must be dword-aligned | 429 | * @addr: address, must be dword-aligned |
428 | * @value: value to write | 430 | * @value: value to write |
429 | */ | 431 | */ |
430 | typedef void (*cgs_write_pci_config_dword_t)(void *cgs_device, unsigned addr, | 432 | typedef void (*cgs_write_pci_config_dword_t)(struct cgs_device *cgs_device, unsigned addr, |
431 | uint32_t value); | 433 | uint32_t value); |
432 | 434 | ||
433 | 435 | ||
@@ -441,7 +443,7 @@ typedef void (*cgs_write_pci_config_dword_t)(void *cgs_device, unsigned addr, | |||
441 | * | 443 | * |
442 | * Return: 0 on success, -errno otherwise | 444 | * Return: 0 on success, -errno otherwise |
443 | */ | 445 | */ |
444 | typedef int (*cgs_get_pci_resource_t)(void *cgs_device, | 446 | typedef int (*cgs_get_pci_resource_t)(struct cgs_device *cgs_device, |
445 | enum cgs_resource_type resource_type, | 447 | enum cgs_resource_type resource_type, |
446 | uint64_t size, | 448 | uint64_t size, |
447 | uint64_t offset, | 449 | uint64_t offset, |
@@ -458,7 +460,7 @@ typedef int (*cgs_get_pci_resource_t)(void *cgs_device, | |||
458 | * Return: Pointer to start of the table, or NULL on failure | 460 | * Return: Pointer to start of the table, or NULL on failure |
459 | */ | 461 | */ |
460 | typedef const void *(*cgs_atom_get_data_table_t)( | 462 | typedef const void *(*cgs_atom_get_data_table_t)( |
461 | void *cgs_device, unsigned table, | 463 | struct cgs_device *cgs_device, unsigned table, |
462 | uint16_t *size, uint8_t *frev, uint8_t *crev); | 464 | uint16_t *size, uint8_t *frev, uint8_t *crev); |
463 | 465 | ||
464 | /** | 466 | /** |
@@ -470,7 +472,7 @@ typedef const void *(*cgs_atom_get_data_table_t)( | |||
470 | * | 472 | * |
471 | * Return: 0 on success, -errno otherwise | 473 | * Return: 0 on success, -errno otherwise |
472 | */ | 474 | */ |
473 | typedef int (*cgs_atom_get_cmd_table_revs_t)(void *cgs_device, unsigned table, | 475 | typedef int (*cgs_atom_get_cmd_table_revs_t)(struct cgs_device *cgs_device, unsigned table, |
474 | uint8_t *frev, uint8_t *crev); | 476 | uint8_t *frev, uint8_t *crev); |
475 | 477 | ||
476 | /** | 478 | /** |
@@ -481,7 +483,7 @@ typedef int (*cgs_atom_get_cmd_table_revs_t)(void *cgs_device, unsigned table, | |||
481 | * | 483 | * |
482 | * Return: 0 on success, -errno otherwise | 484 | * Return: 0 on success, -errno otherwise |
483 | */ | 485 | */ |
484 | typedef int (*cgs_atom_exec_cmd_table_t)(void *cgs_device, | 486 | typedef int (*cgs_atom_exec_cmd_table_t)(struct cgs_device *cgs_device, |
485 | unsigned table, void *args); | 487 | unsigned table, void *args); |
486 | 488 | ||
487 | /** | 489 | /** |
@@ -491,7 +493,7 @@ typedef int (*cgs_atom_exec_cmd_table_t)(void *cgs_device, | |||
491 | * | 493 | * |
492 | * Return: 0 on success, -errno otherwise | 494 | * Return: 0 on success, -errno otherwise |
493 | */ | 495 | */ |
494 | typedef int (*cgs_create_pm_request_t)(void *cgs_device, cgs_handle_t *request); | 496 | typedef int (*cgs_create_pm_request_t)(struct cgs_device *cgs_device, cgs_handle_t *request); |
495 | 497 | ||
496 | /** | 498 | /** |
497 | * cgs_destroy_pm_request() - Destroy a power management request | 499 | * cgs_destroy_pm_request() - Destroy a power management request |
@@ -500,7 +502,7 @@ typedef int (*cgs_create_pm_request_t)(void *cgs_device, cgs_handle_t *request); | |||
500 | * | 502 | * |
501 | * Return: 0 on success, -errno otherwise | 503 | * Return: 0 on success, -errno otherwise |
502 | */ | 504 | */ |
503 | typedef int (*cgs_destroy_pm_request_t)(void *cgs_device, cgs_handle_t request); | 505 | typedef int (*cgs_destroy_pm_request_t)(struct cgs_device *cgs_device, cgs_handle_t request); |
504 | 506 | ||
505 | /** | 507 | /** |
506 | * cgs_set_pm_request() - Activate or deactiveate a PM request | 508 | * cgs_set_pm_request() - Activate or deactiveate a PM request |
@@ -516,7 +518,7 @@ typedef int (*cgs_destroy_pm_request_t)(void *cgs_device, cgs_handle_t request); | |||
516 | * | 518 | * |
517 | * Return: 0 on success, -errno otherwise | 519 | * Return: 0 on success, -errno otherwise |
518 | */ | 520 | */ |
519 | typedef int (*cgs_set_pm_request_t)(void *cgs_device, cgs_handle_t request, | 521 | typedef int (*cgs_set_pm_request_t)(struct cgs_device *cgs_device, cgs_handle_t request, |
520 | int active); | 522 | int active); |
521 | 523 | ||
522 | /** | 524 | /** |
@@ -528,7 +530,7 @@ typedef int (*cgs_set_pm_request_t)(void *cgs_device, cgs_handle_t request, | |||
528 | * | 530 | * |
529 | * Return: 0 on success, -errno otherwise | 531 | * Return: 0 on success, -errno otherwise |
530 | */ | 532 | */ |
531 | typedef int (*cgs_pm_request_clock_t)(void *cgs_device, cgs_handle_t request, | 533 | typedef int (*cgs_pm_request_clock_t)(struct cgs_device *cgs_device, cgs_handle_t request, |
532 | enum cgs_clock clock, unsigned freq); | 534 | enum cgs_clock clock, unsigned freq); |
533 | 535 | ||
534 | /** | 536 | /** |
@@ -540,7 +542,7 @@ typedef int (*cgs_pm_request_clock_t)(void *cgs_device, cgs_handle_t request, | |||
540 | * | 542 | * |
541 | * Return: 0 on success, -errno otherwise | 543 | * Return: 0 on success, -errno otherwise |
542 | */ | 544 | */ |
543 | typedef int (*cgs_pm_request_engine_t)(void *cgs_device, cgs_handle_t request, | 545 | typedef int (*cgs_pm_request_engine_t)(struct cgs_device *cgs_device, cgs_handle_t request, |
544 | enum cgs_engine engine, int powered); | 546 | enum cgs_engine engine, int powered); |
545 | 547 | ||
546 | /** | 548 | /** |
@@ -551,7 +553,7 @@ typedef int (*cgs_pm_request_engine_t)(void *cgs_device, cgs_handle_t request, | |||
551 | * | 553 | * |
552 | * Return: 0 on success, -errno otherwise | 554 | * Return: 0 on success, -errno otherwise |
553 | */ | 555 | */ |
554 | typedef int (*cgs_pm_query_clock_limits_t)(void *cgs_device, | 556 | typedef int (*cgs_pm_query_clock_limits_t)(struct cgs_device *cgs_device, |
555 | enum cgs_clock clock, | 557 | enum cgs_clock clock, |
556 | struct cgs_clock_limits *limits); | 558 | struct cgs_clock_limits *limits); |
557 | 559 | ||
@@ -563,7 +565,7 @@ typedef int (*cgs_pm_query_clock_limits_t)(void *cgs_device, | |||
563 | * | 565 | * |
564 | * Return: 0 on success, -errno otherwise | 566 | * Return: 0 on success, -errno otherwise |
565 | */ | 567 | */ |
566 | typedef int (*cgs_set_camera_voltages_t)(void *cgs_device, uint32_t mask, | 568 | typedef int (*cgs_set_camera_voltages_t)(struct cgs_device *cgs_device, uint32_t mask, |
567 | const uint32_t *voltages); | 569 | const uint32_t *voltages); |
568 | /** | 570 | /** |
569 | * cgs_get_firmware_info - Get the firmware information from core driver | 571 | * cgs_get_firmware_info - Get the firmware information from core driver |
@@ -573,25 +575,25 @@ typedef int (*cgs_set_camera_voltages_t)(void *cgs_device, uint32_t mask, | |||
573 | * | 575 | * |
574 | * Return: 0 on success, -errno otherwise | 576 | * Return: 0 on success, -errno otherwise |
575 | */ | 577 | */ |
576 | typedef int (*cgs_get_firmware_info)(void *cgs_device, | 578 | typedef int (*cgs_get_firmware_info)(struct cgs_device *cgs_device, |
577 | enum cgs_ucode_id type, | 579 | enum cgs_ucode_id type, |
578 | struct cgs_firmware_info *info); | 580 | struct cgs_firmware_info *info); |
579 | 581 | ||
580 | typedef int(*cgs_set_powergating_state)(void *cgs_device, | 582 | typedef int(*cgs_set_powergating_state)(struct cgs_device *cgs_device, |
581 | enum amd_ip_block_type block_type, | 583 | enum amd_ip_block_type block_type, |
582 | enum amd_powergating_state state); | 584 | enum amd_powergating_state state); |
583 | 585 | ||
584 | typedef int(*cgs_set_clockgating_state)(void *cgs_device, | 586 | typedef int(*cgs_set_clockgating_state)(struct cgs_device *cgs_device, |
585 | enum amd_ip_block_type block_type, | 587 | enum amd_ip_block_type block_type, |
586 | enum amd_clockgating_state state); | 588 | enum amd_clockgating_state state); |
587 | 589 | ||
588 | typedef int(*cgs_get_active_displays_info)( | 590 | typedef int(*cgs_get_active_displays_info)( |
589 | void *cgs_device, | 591 | struct cgs_device *cgs_device, |
590 | struct cgs_display_info *info); | 592 | struct cgs_display_info *info); |
591 | 593 | ||
592 | typedef int (*cgs_notify_dpm_enabled)(void *cgs_device, bool enabled); | 594 | typedef int (*cgs_notify_dpm_enabled)(struct cgs_device *cgs_device, bool enabled); |
593 | 595 | ||
594 | typedef int (*cgs_call_acpi_method)(void *cgs_device, | 596 | typedef int (*cgs_call_acpi_method)(struct cgs_device *cgs_device, |
595 | uint32_t acpi_method, | 597 | uint32_t acpi_method, |
596 | uint32_t acpi_function, | 598 | uint32_t acpi_function, |
597 | void *pinput, void *poutput, | 599 | void *pinput, void *poutput, |
@@ -599,7 +601,7 @@ typedef int (*cgs_call_acpi_method)(void *cgs_device, | |||
599 | uint32_t input_size, | 601 | uint32_t input_size, |
600 | uint32_t output_size); | 602 | uint32_t output_size); |
601 | 603 | ||
602 | typedef int (*cgs_query_system_info)(void *cgs_device, | 604 | typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device, |
603 | struct cgs_system_info *sys_info); | 605 | struct cgs_system_info *sys_info); |
604 | 606 | ||
605 | struct cgs_ops { | 607 | struct cgs_ops { |
diff --git a/drivers/gpu/drm/amd/include/cgs_linux.h b/drivers/gpu/drm/amd/include/cgs_linux.h index 3b47ae313e36..ca4f6007a9b3 100644 --- a/drivers/gpu/drm/amd/include/cgs_linux.h +++ b/drivers/gpu/drm/amd/include/cgs_linux.h | |||
@@ -66,7 +66,7 @@ typedef int (*cgs_irq_handler_func_t)(void *private_data, | |||
66 | * | 66 | * |
67 | * Return: 0 on success, -errno otherwise | 67 | * Return: 0 on success, -errno otherwise |
68 | */ | 68 | */ |
69 | typedef int (*cgs_add_irq_source_t)(void *cgs_device, unsigned src_id, | 69 | typedef int (*cgs_add_irq_source_t)(struct cgs_device *cgs_device, unsigned src_id, |
70 | unsigned num_types, | 70 | unsigned num_types, |
71 | cgs_irq_source_set_func_t set, | 71 | cgs_irq_source_set_func_t set, |
72 | cgs_irq_handler_func_t handler, | 72 | cgs_irq_handler_func_t handler, |
@@ -83,7 +83,7 @@ typedef int (*cgs_add_irq_source_t)(void *cgs_device, unsigned src_id, | |||
83 | * | 83 | * |
84 | * Return: 0 on success, -errno otherwise | 84 | * Return: 0 on success, -errno otherwise |
85 | */ | 85 | */ |
86 | typedef int (*cgs_irq_get_t)(void *cgs_device, unsigned src_id, unsigned type); | 86 | typedef int (*cgs_irq_get_t)(struct cgs_device *cgs_device, unsigned src_id, unsigned type); |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * cgs_irq_put() - Indicate IRQ source is no longer needed | 89 | * cgs_irq_put() - Indicate IRQ source is no longer needed |
@@ -98,7 +98,7 @@ typedef int (*cgs_irq_get_t)(void *cgs_device, unsigned src_id, unsigned type); | |||
98 | * | 98 | * |
99 | * Return: 0 on success, -errno otherwise | 99 | * Return: 0 on success, -errno otherwise |
100 | */ | 100 | */ |
101 | typedef int (*cgs_irq_put_t)(void *cgs_device, unsigned src_id, unsigned type); | 101 | typedef int (*cgs_irq_put_t)(struct cgs_device *cgs_device, unsigned src_id, unsigned type); |
102 | 102 | ||
103 | struct cgs_os_ops { | 103 | struct cgs_os_ops { |
104 | /* IRQ handling */ | 104 | /* IRQ handling */ |