aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/amdgpu: add cgs interface for enter/exit rlc safe mode.Rex Zhu2017-01-271-0/+18
| | | | | | Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/powerplay: fix request smc_sk firmware caseHuang Rui2017-01-271-0/+4
| | | | | | | | | | | This patch fixes firmware request error on polaris protection mode. Because we need load smc_sk instead of smc under security protection mode. Signed-off-by: Huang Rui <[email protected]> Tested-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: use designated initializersKees Cook2017-01-271-42/+42
| | | | | | | | | | Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu: add Polaris12 support (v3)Junwei Zhang2017-01-061-0/+3
| | | | | | | | | | | | v2: agd: squash in various fixes v3: agd: squash in: drm/amdgpu: remove unnecessary smc sk firmware for polaris12 Signed-off-by: Junwei Zhang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Ken Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove error message when loading driverXiangliang Yu2016-12-061-2/+4
| | | | | | | | | Forget to check UCODE_ID_STORAGE case and will cause to print error message when loading driver, correct it. Signed-off-by: Xiangliang Yu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* Merge tag 'drm-qemu-20161121' of git://git.kraxel.org/linux into drm-nextDave Airlie2016-11-301-2/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drm/virtio: fix busid in a different way, allocate more vbufs. drm/qxl: various bugfixes and cleanups, * tag 'drm-qemu-20161121' of git://git.kraxel.org/linux: (224 commits) drm/virtio: allocate some extra bufs qxl: Allow resolution which are not multiple of 8 qxl: Don't notify userspace when monitors config is unchanged qxl: Remove qxl_bo_init() return value qxl: Call qxl_gem_{init, fini} qxl: Add missing '\n' to qxl_io_log() call qxl: Remove unused prototype qxl: Mark some internal functions as static Revert "drm: virtio: reinstate drm_virtio_set_busid()" drm/virtio: fix busid regression drm: re-export drm_dev_set_unique Linux 4.9-rc5 gp8psk: Fix DVB frontend attach gp8psk: fix gp8psk_usb_in_op() logic dvb-usb: move data_mutex to struct dvb_usb_device iio: maxim_thermocouple: detect invalid storage size in read() aoe: fix crash in page count manipulation lightnvm: invalid offset calculation for lba_shift Kbuild: enable -Wmaybe-uninitialized warnings by default pcmcia: fix return value of soc_pcmcia_regulator_set ...
| * drm/amdgpu: add support for new smc firmware on icelandAlex Deucher2016-10-281-1/+6
| | | | | | | | | | | | | | | | Newer iceland parts require new smc firmware. Reviewed-by: Huang Rui <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
| * drm/amdgpu: add support for new smc firmware on tongaAlex Deucher2016-10-281-1/+5
| | | | | | | | | | | | | | | | | | Newer tonga parts require new smc firmware. Reviewed-by: Huang Rui <[email protected]> Reviewed-by: Eric Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
* | drm/amdgpu: rework IP block registration (v2)Alex Deucher2016-10-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to replace specific IP blocks on asics for handling virtual_dce, DAL, etc. and for building IP lists for hw or tables. This also stored the status information in the same structure. v2: split out spelling fix into a separate patch add a function to add IPs to the list Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* | drm/amdgpu:properly fix some JumpTable issuesMonk Liu2016-10-251-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we found some MEC ucode leads to IB test fail or even ring test fail if Jump Table of it is not start in FW bo with page aligned address, fixed by always make JT address page aligned. we don't need to patch JT2 for MEC2, because for VI, MEC2 is a copy of MEC1, thus when converting fw_type for MEC_JT2 we just return MEC1,hw can use the same JT for both MEC1 & MEC2. above two change fixed some ring/ib test failure issue for some version of MEC ucode. Signed-off-by: Frank Min <[email protected]> Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* | drm/amdgpu:add MEC_STORAGE ucode id for sriovMonk Liu2016-10-251-0/+3
| | | | | | | | | | | | | | | | | | for sriov, SMC need MEC_STORAGE reserved in fw bo. Signed-off-by: Monk Liu <[email protected]> Signed-off-by: Frank Min <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* | drm/amdgpu:add callback in cgs for sriov detectFrank Min2016-10-251-0/+7
| | | | | | | | | | | | Signed-off-by: Frank Min <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* | drm/amdgpu:keep bo pinned in prefered domainFrank Min2016-10-251-1/+1
| | | | | | | | | | | | Signed-off-by: Frank Min <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* | drm/amdgpu: add AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag v3Christian König2016-10-251-2/+4
|/ | | | | | | | | | | | | | | Add a flag noting that a BO must be created using linear VRAM and set this flag on all in kernel users where appropriate. Hopefully I haven't missed anything. v2: add it in a few more places, fix CPU mapping. v3: rename to VRAM_CONTIGUOUS, fix typo in CS code. Signed-off-by: Christian König <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Tested-by: Mike Lothian <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu:add fw version entry to infoFrank Min2016-09-221-0/+42
| | | | | | Signed-off-by: Frank Min <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: mark symbols static where possibleBaoyou Xie2016-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | We get a few warnings when building kernel with W=1: drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 'cz_send_msg_to_smc_async' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 'cz_write_smc_sram_dword' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous prototype for 'iceland_start_smc' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype for 'amdgpu_job_free_cb' [-Wmissing-prototypes] .... In fact, these functions are only used in the file in which they are declared and don't need a declaration, but can be made static. So this patch marks these functions with 'static'. Reviewed-by: Christian König <[email protected]> Acked-by: Huang Rui <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Baoyou Xie <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add support for getting sub_device id andRex Zhu2016-08-251-0/+6
| | | | | | | | sub_vendor_id in cgs interface. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add query device id and revision id into system info entry at CGSHuang Rui2016-07-291-1/+7
| | | | | | | | | | | | | This patch adds device id and revision into system info entry at CGS, it's able to get PCI device id and revision id from amdgpu, it might get more info in future. PCI device id will be also used on powerplay part at current. Suggested-by: Alex Deucher <[email protected]> Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: make amdgpu_cgs_call_acpi_method as staticHuang Rui2016-07-291-1/+1
| | | | | | Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Change assignment for a variable in amdgpu_cgs_acpi_eval_object()Markus Elfring2016-07-291-1/+2
| | | | | | | | | Indicate successful function execution only at the end. Thus omit initialisation for the variable "result" at the beginning. Reviewed-by: Christian König <[email protected]> Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Delete an unnecessary variable initialisation in ↵Markus Elfring2016-07-291-1/+1
| | | | | | | | | | | amdgpu_cgs_acpi_eval_object() The variable "argument" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Reviewed-by: Christian König <[email protected]> Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object()Markus Elfring2016-07-291-2/+0
| | | | | | | | | The local variable "func_no" was assigned a value at two places. But it was not read within this function. Thus delete it. Reviewed-by: Christian König <[email protected]> Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: One function call less in amdgpu_cgs_acpi_eval_object() after ↵Markus Elfring2016-07-291-9/+9
| | | | | | | | | | | | | | | | | error detection The kfree() function was called in one case by the amdgpu_cgs_acpi_eval_object() function during error handling even if the passed variable "obj" contained a null pointer. * Adjust jump targets according to the Linux coding style convention. * Delete unnecessary initialisations for the variables "obj" and "params" then. Reviewed-by: Christian König <[email protected]> Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drivers/amdgpu: Remove redundant NULL check before kfree()Edward O'Callaghan2016-07-291-2/+1
| | | | | | | | Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <[email protected]> Reviewed-by: Tom St Denis <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add ucode_start_address into cgs_firmware_infoHuang Rui2016-07-151-0/+4
| | | | | | | | The ucode_start_address would be used on powerplay of iceland. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add read/write function for GC CAC programmingRex Zhu2016-07-071-0/+4
| | | | | | | | | Create a GC_CAC_IND_INDEX/DATA pair of funcitons to program all the CAC registers Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: get number of shade engine by cgs interface.Rex Zhu2016-07-071-0/+3
| | | | | | | | | | the num of shade engine was needed to measure the activity of the graphics core and to enable di/dt feature. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove cgs_acpi_method_argument member method_lengthNicolai Hähnle2016-07-071-5/+2
| | | | | | | | | | It was redundant with data_length, and in fact set incorrectly in one case leading to an out-of-bound read by memcpy in acpi_ut_copy_esimple_to_isimple, reported by CONFIG_KASAN=y. Signed-off-by: Nicolai Hähnle <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: print smc fw info in CGS.yanyang12016-07-071-0/+1
| | | | | | | | | The non-powerplay code handles this directly. Do it in cgs for powerplay. Signed-off-by: yanyang1 <[email protected]> Reviewed-by: Rex Zhu [email protected] Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: initialize amdgpu_cgs_acpi_eval_object result valueNicolas Iooss2016-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | amdgpu_cgs_acpi_eval_object() returned the value of variable "result" without initializing it first. This bug has been found by compiling the kernel with clang. The compiler complained: drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:972:14: error: variable 'result' is used uninitialized whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized] for (i = 0; i < count; i++) { ^~~~~~~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:1011:9: note: uninitialized use occurs here return result; ^~~~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:972:14: note: remove the condition if it is always true for (i = 0; i < count; i++) { ^~~~~~~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:864:12: note: initialize the variable 'result' to silence this warning int result; ^ = 0 Fixes: 3f1d35a03b3c ("drm/amdgpu: implement new cgs interface for acpi function") Signed-off-by: Nicolas Iooss <[email protected]> Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add release firmware for cgsMonk Liu2016-06-091-0/+12
| | | | | | | | | Powerplay uses cgs to load the firmware so add a function to release it as well to avoid leaking it on driver unload. Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: fetch cu_info once at initAlex Deucher2016-05-111-3/+1
| | | | | | | | Fetch this info once at init and just store the results for future requests. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix memory leak in CGS (FW info)Mykola Lysenko2016-05-051-34/+36
| | | | | | | | | Previously requested FW pointer should not be overwritten on a subsequent call. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Mykola Lysenko <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: change ELM/BAF to Polaris10/Polaris11Flora Cui2016-05-051-8/+8
| | | | | | | | Adjust to preferred code names. Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu: add query GFX cu info in CGS query system infoEric Huang2016-05-051-0/+5
| | | | | | | | | Needed for per CU powergating. Reviewed-by: Alex Deucher <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Eric Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu: Add smc_sk firmware in baffin & ellesmere.yanyang12016-05-051-3/+9
| | | | | | | | add CGS_UCODE_ID_SMU_SK. Signed-off-by: yanyang1 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/powerplay: add smu support for ellesmere/baffinrezhu2016-05-051-2/+9
| | | | | | Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd: make a type-safe cgs_device struct. (v2)Dave Airlie2016-05-051-46/+46
| | | | | | | | | | 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 <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add an cgs interface to notify amdgpu the dpm state.Rex Zhu2016-04-011-0/+11
| | | | | | Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/powerplay: fix segment fault issue in multi-display case.Rex Zhu2016-04-011-5/+8
| | | | | | | Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
* drm/amdgpu: add a cgs interface to fetch cg and pg flagsAlex Deucher2016-02-081-0/+6
| | | | | | | Needed to pass the cg and pg info to powerplay. Reviewed-by: Eric Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/cgs: add an interface to access PCI resourcesAlex Deucher2016-01-111-0/+36
| | | | | | | | | | | | | | This provides an interface to get access to the base address of PCI resources (MMIO, DOORBELL, etc.). Only MMIO and DOORBELL are implemented right now. This is necessary to properly utilize shared drivers on platform devices. IP modules can use this interface to get the base address of the resource and add any additional offset and set the size when setting up the platform driver(s). Acked-by: Dave Airlie <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/cgs: cleanup some indentingDan Carpenter2016-01-041-9/+9
| | | | | | | | This code is indented too far. Also we normally use spaces to align if statement conditions. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/cgs: add sys info query for pcie gen and link widthAlex Deucher2015-12-211-0/+6
| | | | | | | Needed by powerplay to properly handle pcie dpm switching. Reviewed-by: Jammy Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/amdgpu: enable powerplay and smc firmware loading for Fiji.Eric Huang2015-12-211-0/+3
| | | | | | | Switch over to handling in the powerplay module. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Eric Huang <[email protected]>
* drm/amdgpu: add new cgs interface to get display info (v2)Rex Zhu2015-12-211-0/+40
| | | | | | | | | | | | Add new CGS interfaces to query display info across modules. This is nedded by the powerplay module for synchronizing with the display module. v2: (agd): fold in refresh rate fix, rebase Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: implement cgs interface to query system infoRex Zhu2015-12-211-0/+23
| | | | | | | | Add a query to get the bus number and function of the device. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: implement new cgs interface for acpi functionRex Zhu2015-12-211-2/+218
| | | | | | | | | | Add a new driver internal interface for accessing ACPI methods. These will be used by various new components including powerplay. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu/cgs: remove import_gpu_memAlex Deucher2015-09-301-39/+0
| | | | | | | | | It was added for completeness, but we don't have any users for it yet. Daniel noted that it may be racy. Remove it. Change-Id: I5f5546f8911a4f294008a62dc86a73f3face38d1 Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: export reservation_object from dmabuf to ttm (v2)Christian König2015-09-231-2/+3
| | | | | | | | | | | | Adds an extra argument to amdgpu_bo_create, which is only used in amdgpu_prime.c. Port of radeon commit 831b6966a60fe72d85ae3576056b4e4e0775b112. v2: fix up kfd. Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>