diff options
author | Dave Airlie <airlied@redhat.com> | 2015-05-20 09:20:48 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-05-20 09:20:48 +1000 |
commit | 91d9f9856f91c82ac6289a0fff65dd12cfa07e34 (patch) | |
tree | 319d029d1aa7501147f384ab6a4cfb331f1d8fb6 /drivers/gpu/drm/radeon | |
parent | 9c37bf2db0a707be4a3025240b009cf63691e0d7 (diff) | |
parent | 7591cd2cd59d77c52141d9c2c759c14f981c1a13 (diff) | |
download | blackbird-op-linux-91d9f9856f91c82ac6289a0fff65dd12cfa07e34.tar.gz blackbird-op-linux-91d9f9856f91c82ac6289a0fff65dd12cfa07e34.zip |
Merge tag 'drm-amdkfd-next-2015-05-19' of git://people.freedesktop.org/~gabbayo/linux into drm-next
- Add the interrupts & events modules, including new IOCTLs to create and wait
on events. The HSA RT open source stack is mainly using events to know when
a dispatched work has been completed. In addition, this module is
a pre-requisite for the next module I'm going to upstream - debugger support
This module also handles H/W exceptions, such as memory exception received
through the IOMMUv2 H/W and Bad Opcode exception receieved from the GPU.
- Adding a new kernel module parameter to let the user decide whether he wants
to receive a SIGTERM when a memory exception occurs inside the GPU kernel and
the HSA application doesn't wait on an appropriate event, or if he just want
to receive notification about this event in dmesg. The default is the latter.
- Additional improvements for SDMA code
- Update my email address in Maintainers file.
* tag 'drm-amdkfd-next-2015-05-19' of git://people.freedesktop.org/~gabbayo/linux:
drm/amdkfd: change driver version to 0.7.2
drm/amdkfd: Implement events IOCTLs
drm/amdkfd: Add module parameter of send_sigterm
drm/amdkfd: Add bad opcode exception handling
drm/amdkfd: Add memory exception handling
drm/amdkfd: Add the events module
drm/amdkfd: add events IOCTL set definitions
drm/amdkfd: Add interrupt handling module
drm/radeon: Add init interrupt kfd->kgd interface
MAINTAINERS: update amdkfd Oded's email address
drm/amdkfd: make the sdma vm init to be asic specific
drm/amdkfd: Use new struct for asic specific ops
drm/amdkfd: reformat some debug prints
drm/amdkfd: Remove unessary void pointer cast
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/cik_reg.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/cikd.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kfd.c | 21 |
3 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/cik_reg.h b/drivers/gpu/drm/radeon/cik_reg.h index f667347d8157..0ec5d53eb6fb 100644 --- a/drivers/gpu/drm/radeon/cik_reg.h +++ b/drivers/gpu/drm/radeon/cik_reg.h @@ -149,6 +149,8 @@ #define KFD_CIK_SDMA_QUEUE_OFFSET 0x200 +#define CPC_INT_CNTL 0xC2D0 + #define CP_HQD_IQ_RPTR 0xC970u #define AQL_ENABLE (1U << 0) #define SDMA0_RLC0_RB_CNTL 0xD400u diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h index 0089d837a8e3..b33ba3b0808b 100644 --- a/drivers/gpu/drm/radeon/cikd.h +++ b/drivers/gpu/drm/radeon/cikd.h @@ -1335,6 +1335,7 @@ # define CNTX_EMPTY_INT_ENABLE (1 << 20) # define PRIV_INSTR_INT_ENABLE (1 << 22) # define PRIV_REG_INT_ENABLE (1 << 23) +# define OPCODE_ERROR_INT_ENABLE (1 << 24) # define TIME_STAMP_INT_ENABLE (1 << 26) # define CP_RINGID2_INT_ENABLE (1 << 29) # define CP_RINGID1_INT_ENABLE (1 << 30) diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c index 3db23007cdf4..813a416db538 100644 --- a/drivers/gpu/drm/radeon/radeon_kfd.c +++ b/drivers/gpu/drm/radeon/radeon_kfd.c @@ -66,7 +66,7 @@ static int kgd_set_pasid_vmid_mapping(struct kgd_dev *kgd, unsigned int pasid, static int kgd_init_pipeline(struct kgd_dev *kgd, uint32_t pipe_id, uint32_t hpd_size, uint64_t hpd_gpu_addr); - +static int kgd_init_interrupts(struct kgd_dev *kgd, uint32_t pipe_id); static int kgd_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id, uint32_t queue_id, uint32_t __user *wptr); static int kgd_hqd_sdma_load(struct kgd_dev *kgd, void *mqd); @@ -89,6 +89,7 @@ static const struct kfd2kgd_calls kfd2kgd = { .program_sh_mem_settings = kgd_program_sh_mem_settings, .set_pasid_vmid_mapping = kgd_set_pasid_vmid_mapping, .init_pipeline = kgd_init_pipeline, + .init_interrupts = kgd_init_interrupts, .hqd_load = kgd_hqd_load, .hqd_sdma_load = kgd_hqd_sdma_load, .hqd_is_occupied = kgd_hqd_is_occupied, @@ -407,6 +408,24 @@ static int kgd_init_pipeline(struct kgd_dev *kgd, uint32_t pipe_id, return 0; } +static int kgd_init_interrupts(struct kgd_dev *kgd, uint32_t pipe_id) +{ + uint32_t mec; + uint32_t pipe; + + mec = (pipe_id / CIK_PIPE_PER_MEC) + 1; + pipe = (pipe_id % CIK_PIPE_PER_MEC); + + lock_srbm(kgd, mec, pipe, 0, 0); + + write_register(kgd, CPC_INT_CNTL, + TIME_STAMP_INT_ENABLE | OPCODE_ERROR_INT_ENABLE); + + unlock_srbm(kgd); + + return 0; +} + static inline uint32_t get_sdma_base_addr(struct cik_sdma_rlc_registers *m) { uint32_t retval; |