sync with OpenBSD -current
This commit is contained in:
parent
0fd478b49f
commit
de73a2419b
15 changed files with 233 additions and 88 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_jpeg.h"
|
||||
#include "amdgpu_cs.h"
|
||||
#include "soc15.h"
|
||||
#include "soc15d.h"
|
||||
#include "vcn_v1_0.h"
|
||||
|
@ -34,6 +35,9 @@
|
|||
static void jpeg_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev);
|
||||
static void jpeg_v1_0_set_irq_funcs(struct amdgpu_device *adev);
|
||||
static void jpeg_v1_0_ring_begin_use(struct amdgpu_ring *ring);
|
||||
static int jpeg_v1_dec_ring_parse_cs(struct amdgpu_cs_parser *parser,
|
||||
struct amdgpu_job *job,
|
||||
struct amdgpu_ib *ib);
|
||||
|
||||
static void jpeg_v1_0_decode_ring_patch_wreg(struct amdgpu_ring *ring, uint32_t *ptr, uint32_t reg_offset, uint32_t val)
|
||||
{
|
||||
|
@ -300,7 +304,10 @@ static void jpeg_v1_0_decode_ring_emit_ib(struct amdgpu_ring *ring,
|
|||
|
||||
amdgpu_ring_write(ring,
|
||||
PACKETJ(SOC15_REG_OFFSET(JPEG, 0, mmUVD_LMI_JRBC_IB_VMID), 0, 0, PACKETJ_TYPE0));
|
||||
amdgpu_ring_write(ring, (vmid | (vmid << 4)));
|
||||
if (ring->funcs->parse_cs)
|
||||
amdgpu_ring_write(ring, 0);
|
||||
else
|
||||
amdgpu_ring_write(ring, (vmid | (vmid << 4)));
|
||||
|
||||
amdgpu_ring_write(ring,
|
||||
PACKETJ(SOC15_REG_OFFSET(JPEG, 0, mmUVD_LMI_JPEG_VMID), 0, 0, PACKETJ_TYPE0));
|
||||
|
@ -554,6 +561,7 @@ static const struct amdgpu_ring_funcs jpeg_v1_0_decode_ring_vm_funcs = {
|
|||
.get_rptr = jpeg_v1_0_decode_ring_get_rptr,
|
||||
.get_wptr = jpeg_v1_0_decode_ring_get_wptr,
|
||||
.set_wptr = jpeg_v1_0_decode_ring_set_wptr,
|
||||
.parse_cs = jpeg_v1_dec_ring_parse_cs,
|
||||
.emit_frame_size =
|
||||
6 + 6 + /* hdp invalidate / flush */
|
||||
SOC15_FLUSH_GPU_TLB_NUM_WREG * 6 +
|
||||
|
@ -612,3 +620,69 @@ static void jpeg_v1_0_ring_begin_use(struct amdgpu_ring *ring)
|
|||
|
||||
vcn_v1_0_set_pg_for_begin_use(ring, set_clocks);
|
||||
}
|
||||
|
||||
/**
|
||||
* jpeg_v1_dec_ring_parse_cs - command submission parser
|
||||
*
|
||||
* @parser: Command submission parser context
|
||||
* @job: the job to parse
|
||||
* @ib: the IB to parse
|
||||
*
|
||||
* Parse the command stream, return -EINVAL for invalid packet,
|
||||
* 0 otherwise
|
||||
*/
|
||||
static int jpeg_v1_dec_ring_parse_cs(struct amdgpu_cs_parser *parser,
|
||||
struct amdgpu_job *job,
|
||||
struct amdgpu_ib *ib)
|
||||
{
|
||||
u32 i, reg, res, cond, type;
|
||||
int ret = 0;
|
||||
struct amdgpu_device *adev = parser->adev;
|
||||
|
||||
for (i = 0; i < ib->length_dw ; i += 2) {
|
||||
reg = CP_PACKETJ_GET_REG(ib->ptr[i]);
|
||||
res = CP_PACKETJ_GET_RES(ib->ptr[i]);
|
||||
cond = CP_PACKETJ_GET_COND(ib->ptr[i]);
|
||||
type = CP_PACKETJ_GET_TYPE(ib->ptr[i]);
|
||||
|
||||
if (res || cond != PACKETJ_CONDITION_CHECK0) /* only allow 0 for now */
|
||||
return -EINVAL;
|
||||
|
||||
if (reg >= JPEG_V1_REG_RANGE_START && reg <= JPEG_V1_REG_RANGE_END)
|
||||
continue;
|
||||
|
||||
switch (type) {
|
||||
case PACKETJ_TYPE0:
|
||||
if (reg != JPEG_V1_LMI_JPEG_WRITE_64BIT_BAR_HIGH &&
|
||||
reg != JPEG_V1_LMI_JPEG_WRITE_64BIT_BAR_LOW &&
|
||||
reg != JPEG_V1_LMI_JPEG_READ_64BIT_BAR_HIGH &&
|
||||
reg != JPEG_V1_LMI_JPEG_READ_64BIT_BAR_LOW &&
|
||||
reg != JPEG_V1_REG_CTX_INDEX &&
|
||||
reg != JPEG_V1_REG_CTX_DATA) {
|
||||
ret = -EINVAL;
|
||||
}
|
||||
break;
|
||||
case PACKETJ_TYPE1:
|
||||
if (reg != JPEG_V1_REG_CTX_DATA)
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
case PACKETJ_TYPE3:
|
||||
if (reg != JPEG_V1_REG_SOFT_RESET)
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
case PACKETJ_TYPE6:
|
||||
if (ib->ptr[i] != CP_PACKETJ_NOP)
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
dev_err(adev->dev, "Invalid packet [0x%08x]!\n", ib->ptr[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -29,4 +29,15 @@ int jpeg_v1_0_sw_init(void *handle);
|
|||
void jpeg_v1_0_sw_fini(void *handle);
|
||||
void jpeg_v1_0_start(struct amdgpu_device *adev, int mode);
|
||||
|
||||
#define JPEG_V1_REG_RANGE_START 0x8000
|
||||
#define JPEG_V1_REG_RANGE_END 0x803f
|
||||
|
||||
#define JPEG_V1_LMI_JPEG_WRITE_64BIT_BAR_HIGH 0x8238
|
||||
#define JPEG_V1_LMI_JPEG_WRITE_64BIT_BAR_LOW 0x8239
|
||||
#define JPEG_V1_LMI_JPEG_READ_64BIT_BAR_HIGH 0x825a
|
||||
#define JPEG_V1_LMI_JPEG_READ_64BIT_BAR_LOW 0x825b
|
||||
#define JPEG_V1_REG_CTX_INDEX 0x8328
|
||||
#define JPEG_V1_REG_CTX_DATA 0x8329
|
||||
#define JPEG_V1_REG_SOFT_RESET 0x83a0
|
||||
|
||||
#endif /*__JPEG_V1_0_H__*/
|
||||
|
|
|
@ -143,32 +143,25 @@ enum dc_status dp_set_fec_ready(struct dc_link *link, const struct link_resource
|
|||
|
||||
link_enc = link_enc_cfg_get_link_enc(link);
|
||||
ASSERT(link_enc);
|
||||
if (link_enc->funcs->fec_set_ready == NULL)
|
||||
return DC_NOT_SUPPORTED;
|
||||
|
||||
if (!dp_should_enable_fec(link))
|
||||
return status;
|
||||
if (ready && dp_should_enable_fec(link)) {
|
||||
fec_config = 1;
|
||||
|
||||
if (link_enc->funcs->fec_set_ready &&
|
||||
link->dpcd_caps.fec_cap.bits.FEC_CAPABLE) {
|
||||
if (ready) {
|
||||
fec_config = 1;
|
||||
status = core_link_write_dpcd(link,
|
||||
DP_FEC_CONFIGURATION,
|
||||
&fec_config,
|
||||
sizeof(fec_config));
|
||||
if (status == DC_OK) {
|
||||
link_enc->funcs->fec_set_ready(link_enc, true);
|
||||
link->fec_state = dc_link_fec_ready;
|
||||
} else {
|
||||
link_enc->funcs->fec_set_ready(link_enc, false);
|
||||
link->fec_state = dc_link_fec_not_ready;
|
||||
dm_error("dpcd write failed to set fec_ready");
|
||||
}
|
||||
} else if (link->fec_state == dc_link_fec_ready) {
|
||||
status = core_link_write_dpcd(link, DP_FEC_CONFIGURATION,
|
||||
&fec_config, sizeof(fec_config));
|
||||
|
||||
if (status == DC_OK) {
|
||||
link_enc->funcs->fec_set_ready(link_enc, true);
|
||||
link->fec_state = dc_link_fec_ready;
|
||||
}
|
||||
} else {
|
||||
if (link->fec_state == dc_link_fec_ready) {
|
||||
fec_config = 0;
|
||||
status = core_link_write_dpcd(link,
|
||||
DP_FEC_CONFIGURATION,
|
||||
&fec_config,
|
||||
sizeof(fec_config));
|
||||
core_link_write_dpcd(link, DP_FEC_CONFIGURATION,
|
||||
&fec_config, sizeof(fec_config));
|
||||
|
||||
link_enc->funcs->fec_set_ready(link_enc, false);
|
||||
link->fec_state = dc_link_fec_not_ready;
|
||||
}
|
||||
|
@ -183,14 +176,12 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)
|
|||
|
||||
link_enc = link_enc_cfg_get_link_enc(link);
|
||||
ASSERT(link_enc);
|
||||
|
||||
if (!dp_should_enable_fec(link))
|
||||
if (link_enc->funcs->fec_set_enable == NULL)
|
||||
return;
|
||||
|
||||
if (link_enc->funcs->fec_set_enable &&
|
||||
link->dpcd_caps.fec_cap.bits.FEC_CAPABLE) {
|
||||
if (link->fec_state == dc_link_fec_ready && enable) {
|
||||
/* Accord to DP spec, FEC enable sequence can first
|
||||
if (enable && dp_should_enable_fec(link)) {
|
||||
if (link->fec_state == dc_link_fec_ready) {
|
||||
/* According to DP spec, FEC enable sequence can first
|
||||
* be transmitted anytime after 1000 LL codes have
|
||||
* been transmitted on the link after link training
|
||||
* completion. Using 1 lane RBR should have the maximum
|
||||
|
@ -200,7 +191,9 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)
|
|||
udelay(7);
|
||||
link_enc->funcs->fec_set_enable(link_enc, true);
|
||||
link->fec_state = dc_link_fec_enabled;
|
||||
} else if (link->fec_state == dc_link_fec_enabled && !enable) {
|
||||
}
|
||||
} else {
|
||||
if (link->fec_state == dc_link_fec_enabled) {
|
||||
link_enc->funcs->fec_set_enable(link_enc, false);
|
||||
link->fec_state = dc_link_fec_ready;
|
||||
}
|
||||
|
|
|
@ -1006,7 +1006,7 @@ struct display_object_info_table_v1_4
|
|||
uint16_t supporteddevices;
|
||||
uint8_t number_of_path;
|
||||
uint8_t reserved;
|
||||
struct atom_display_object_path_v2 display_path[8]; //the real number of this included in the structure is calculated by using the (whole structure size - the header size- number_of_path)/size of atom_display_object_path
|
||||
struct atom_display_object_path_v2 display_path[]; //the real number of this included in the structure is calculated by using the (whole structure size - the header size- number_of_path)/size of atom_display_object_path
|
||||
};
|
||||
|
||||
struct display_object_info_table_v1_5 {
|
||||
|
@ -1016,7 +1016,7 @@ struct display_object_info_table_v1_5 {
|
|||
uint8_t reserved;
|
||||
// the real number of this included in the structure is calculated by using the
|
||||
// (whole structure size - the header size- number_of_path)/size of atom_display_object_path
|
||||
struct atom_display_object_path_v3 display_path[8];
|
||||
struct atom_display_object_path_v3 display_path[];
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -208,6 +208,18 @@ static const struct dmi_system_id orientation_data[] = {
|
|||
DMI_MATCH(DMI_BOARD_NAME, "KUN"),
|
||||
},
|
||||
.driver_data = (void *)&lcd1600x2560_rightside_up,
|
||||
}, { /* AYN Loki Max */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Loki Max"),
|
||||
},
|
||||
.driver_data = (void *)&lcd1080x1920_leftside_up,
|
||||
}, { /* AYN Loki Zero */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Loki Zero"),
|
||||
},
|
||||
.driver_data = (void *)&lcd1080x1920_leftside_up,
|
||||
}, { /* Chuwi HiBook (CWI514) */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
|
||||
|
|
|
@ -1489,6 +1489,7 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
|
|||
struct drm_syncobj *syncobj;
|
||||
struct eventfd_ctx *ev_fd_ctx;
|
||||
struct syncobj_eventfd_entry *entry;
|
||||
int ret;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_SYNCOBJ_TIMELINE))
|
||||
return -EOPNOTSUPP;
|
||||
|
@ -1504,13 +1505,15 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
|
|||
return -ENOENT;
|
||||
|
||||
ev_fd_ctx = eventfd_ctx_fdget(args->fd);
|
||||
if (IS_ERR(ev_fd_ctx))
|
||||
return PTR_ERR(ev_fd_ctx);
|
||||
if (IS_ERR(ev_fd_ctx)) {
|
||||
ret = PTR_ERR(ev_fd_ctx);
|
||||
goto err_fdget;
|
||||
}
|
||||
|
||||
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
||||
if (!entry) {
|
||||
eventfd_ctx_put(ev_fd_ctx);
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto err_kzalloc;
|
||||
}
|
||||
entry->syncobj = syncobj;
|
||||
entry->ev_fd_ctx = ev_fd_ctx;
|
||||
|
@ -1521,6 +1524,12 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
|
|||
drm_syncobj_put(syncobj);
|
||||
|
||||
return 0;
|
||||
|
||||
err_kzalloc:
|
||||
eventfd_ctx_put(ev_fd_ctx);
|
||||
err_fdget:
|
||||
drm_syncobj_put(syncobj);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -2695,9 +2695,9 @@ static void prepare_context_registration_info_v70(struct intel_context *ce,
|
|||
ce->parallel.guc.wqi_tail = 0;
|
||||
ce->parallel.guc.wqi_head = 0;
|
||||
|
||||
wq_desc_offset = i915_ggtt_offset(ce->state) +
|
||||
wq_desc_offset = (u64)i915_ggtt_offset(ce->state) +
|
||||
__get_parent_scratch_offset(ce);
|
||||
wq_base_offset = i915_ggtt_offset(ce->state) +
|
||||
wq_base_offset = (u64)i915_ggtt_offset(ce->state) +
|
||||
__get_wq_offset(ce);
|
||||
info->wq_desc_lo = lower_32_bits(wq_desc_offset);
|
||||
info->wq_desc_hi = upper_32_bits(wq_desc_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue