sync with OpenBSD -current
This commit is contained in:
parent
ae019f102d
commit
bc7421a947
142 changed files with 4267 additions and 1365 deletions
|
@ -100,7 +100,7 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
|
|||
adev->ip_blocks[i].status.hw = false;
|
||||
}
|
||||
|
||||
return r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -2052,12 +2052,13 @@ static ssize_t amdgpu_reset_dump_register_list_write(struct file *f,
|
|||
struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)->i_private;
|
||||
char reg_offset[11];
|
||||
uint32_t *new = NULL, *tmp = NULL;
|
||||
int ret, i = 0, len = 0;
|
||||
unsigned int len = 0;
|
||||
int ret, i = 0;
|
||||
|
||||
do {
|
||||
memset(reg_offset, 0, 11);
|
||||
if (copy_from_user(reg_offset, buf + len,
|
||||
min(10, ((int)size-len)))) {
|
||||
min(10, (size-len)))) {
|
||||
ret = -EFAULT;
|
||||
goto error_free;
|
||||
}
|
||||
|
|
|
@ -1187,7 +1187,8 @@ void amdgpu_gfx_cp_init_microcode(struct amdgpu_device *adev,
|
|||
fw_size = le32_to_cpu(cp_hdr_v2_0->data_size_bytes);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
dev_err(adev->dev, "Invalid ucode id %u\n", ucode_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
|
||||
|
|
|
@ -446,6 +446,14 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
|
|||
|
||||
entry.ih = ih;
|
||||
entry.iv_entry = (const uint32_t *)&ih->ring[ring_index];
|
||||
|
||||
/*
|
||||
* timestamp is not supported on some legacy SOCs (cik, cz, iceland,
|
||||
* si and tonga), so initialize timestamp and timestamp_src to 0
|
||||
*/
|
||||
entry.timestamp = 0;
|
||||
entry.timestamp_src = 0;
|
||||
|
||||
amdgpu_ih_decode_iv(adev, &entry);
|
||||
|
||||
trace_amdgpu_iv(ih - &adev->irq.ih, &entry);
|
||||
|
|
|
@ -742,7 +742,8 @@ int amdgpu_vce_ring_parse_cs(struct amdgpu_cs_parser *p,
|
|||
uint32_t created = 0;
|
||||
uint32_t allocated = 0;
|
||||
uint32_t tmp, handle = 0;
|
||||
uint32_t *size = &tmp;
|
||||
uint32_t dummy = 0xffffffff;
|
||||
uint32_t *size = &dummy;
|
||||
unsigned int idx;
|
||||
int i, r = 0;
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ static int sienna_cichlid_mode2_suspend_ip(struct amdgpu_device *adev)
|
|||
adev->ip_blocks[i].status.hw = false;
|
||||
}
|
||||
|
||||
return r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -264,7 +264,7 @@ static u32 dm_vblank_get_counter(struct amdgpu_device *adev, int crtc)
|
|||
static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc,
|
||||
u32 *vbl, u32 *position)
|
||||
{
|
||||
u32 v_blank_start, v_blank_end, h_position, v_position;
|
||||
u32 v_blank_start = 0, v_blank_end = 0, h_position = 0, v_position = 0;
|
||||
struct amdgpu_crtc *acrtc = NULL;
|
||||
|
||||
if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc))
|
||||
|
@ -801,7 +801,7 @@ static void dm_handle_hpd_work(struct work_struct *work)
|
|||
*/
|
||||
static void dm_dmub_outbox1_low_irq(void *interrupt_params)
|
||||
{
|
||||
struct dmub_notification notify;
|
||||
struct dmub_notification notify = {0};
|
||||
struct common_irq_params *irq_params = interrupt_params;
|
||||
struct amdgpu_device *adev = irq_params->adev;
|
||||
struct amdgpu_display_manager *dm = &adev->dm;
|
||||
|
@ -6899,7 +6899,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,
|
|||
struct amdgpu_dm_connector *aconnector;
|
||||
struct dm_connector_state *dm_conn_state;
|
||||
int i, j, ret;
|
||||
int vcpi, pbn_div, pbn, slot_num = 0;
|
||||
int vcpi, pbn_div, pbn = 0, slot_num = 0;
|
||||
|
||||
for_each_new_connector_in_state(state, connector, new_con_state, i) {
|
||||
|
||||
|
@ -10070,7 +10070,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
|
|||
struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;
|
||||
struct drm_dp_mst_topology_mgr *mgr;
|
||||
struct drm_dp_mst_topology_state *mst_state;
|
||||
struct dsc_mst_fairness_vars vars[MAX_PIPES];
|
||||
struct dsc_mst_fairness_vars vars[MAX_PIPES] = {0};
|
||||
|
||||
trace_amdgpu_dm_atomic_check_begin(state);
|
||||
|
||||
|
|
|
@ -1219,7 +1219,7 @@ static ssize_t dp_sdp_message_debugfs_write(struct file *f, const char __user *b
|
|||
size_t size, loff_t *pos)
|
||||
{
|
||||
int r;
|
||||
uint8_t data[36];
|
||||
uint8_t data[36] = {0};
|
||||
struct amdgpu_dm_connector *connector = file_inode(f)->i_private;
|
||||
struct dm_crtc_state *acrtc_state;
|
||||
uint32_t write_size = 36;
|
||||
|
@ -2929,7 +2929,7 @@ static int psr_read_residency(void *data, u64 *val)
|
|||
{
|
||||
struct amdgpu_dm_connector *connector = data;
|
||||
struct dc_link *link = connector->dc_link;
|
||||
u32 residency;
|
||||
u32 residency = 0;
|
||||
|
||||
link->dc->link_srv->edp_get_psr_residency(link, &residency);
|
||||
|
||||
|
|
|
@ -2385,6 +2385,9 @@ static struct audio *find_first_free_audio(
|
|||
{
|
||||
int i, available_audio_count;
|
||||
|
||||
if (id == ENGINE_ID_UNKNOWN)
|
||||
return NULL;
|
||||
|
||||
available_audio_count = pool->audio_count;
|
||||
|
||||
for (i = 0; i < available_audio_count; i++) {
|
||||
|
|
|
@ -211,8 +211,12 @@ bool dce110_vblank_set(struct irq_service *irq_service,
|
|||
info->ext_id);
|
||||
uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
|
||||
|
||||
struct timing_generator *tg =
|
||||
dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
|
||||
struct timing_generator *tg;
|
||||
|
||||
if (pipe_offset >= MAX_PIPES)
|
||||
return false;
|
||||
|
||||
tg = dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
|
||||
|
||||
if (enable) {
|
||||
if (!tg || !tg->funcs->arm_vert_intr(tg, 2)) {
|
||||
|
|
|
@ -158,6 +158,10 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp,
|
|||
uint32_t cur_size = 0;
|
||||
uint32_t data_offset = 0;
|
||||
|
||||
if (msg_id == MOD_HDCP_MESSAGE_ID_INVALID) {
|
||||
return MOD_HDCP_STATUS_DDC_FAILURE;
|
||||
}
|
||||
|
||||
if (is_dp_hdcp(hdcp)) {
|
||||
while (buf_len > 0) {
|
||||
cur_size = MIN(buf_len, HDCP_MAX_AUX_TRANSACTION_SIZE);
|
||||
|
@ -217,6 +221,10 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp,
|
|||
uint32_t cur_size = 0;
|
||||
uint32_t data_offset = 0;
|
||||
|
||||
if (msg_id == MOD_HDCP_MESSAGE_ID_INVALID) {
|
||||
return MOD_HDCP_STATUS_DDC_FAILURE;
|
||||
}
|
||||
|
||||
if (is_dp_hdcp(hdcp)) {
|
||||
while (buf_len > 0) {
|
||||
cur_size = MIN(buf_len, HDCP_MAX_AUX_TRANSACTION_SIZE);
|
||||
|
|
|
@ -702,7 +702,7 @@ struct atom_gpio_pin_lut_v2_1
|
|||
{
|
||||
struct atom_common_table_header table_header;
|
||||
/*the real number of this included in the structure is calcualted by using the (whole structure size - the header size)/size of atom_gpio_pin_lut */
|
||||
struct atom_gpio_pin_assignment gpio_pin[8];
|
||||
struct atom_gpio_pin_assignment gpio_pin[];
|
||||
};
|
||||
|
||||
|
||||
|
@ -3551,7 +3551,7 @@ struct atom_gpio_voltage_object_v4
|
|||
uint8_t phase_delay_us; // phase delay in unit of micro second
|
||||
uint8_t reserved;
|
||||
uint32_t gpio_mask_val; // GPIO Mask value
|
||||
struct atom_voltage_gpio_map_lut voltage_gpio_lut[1];
|
||||
struct atom_voltage_gpio_map_lut voltage_gpio_lut[] __counted_by(gpio_entry_num);
|
||||
};
|
||||
|
||||
struct atom_svid2_voltage_object_v4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: apldcp.c,v 1.1 2024/01/22 18:54:01 kettenis Exp $ */
|
||||
/* $OpenBSD: apldcp.c,v 1.2 2024/07/12 10:01:28 tobhe Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2023 Mark Kettenis <kettenis@openbsd.org>
|
||||
*
|
||||
|
@ -18,6 +18,7 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/pool.h>
|
||||
|
||||
#include <machine/intr.h>
|
||||
#include <machine/bus.h>
|
||||
|
@ -103,14 +104,19 @@ apldcp_activate(struct device *self, int act)
|
|||
|
||||
#include <arm64/dev/rtkit.h>
|
||||
|
||||
struct apple_rtkit_ep {
|
||||
struct apple_rtkit *rtk;
|
||||
uint8_t ep;
|
||||
|
||||
struct apple_rtkit_task {
|
||||
struct apple_rtkit_ep *rtkep;
|
||||
struct task task;
|
||||
uint64_t msg;
|
||||
};
|
||||
|
||||
struct apple_rtkit_ep {
|
||||
struct apple_rtkit *rtk;
|
||||
uint8_t ep;
|
||||
};
|
||||
|
||||
static struct pool rtktask_pool;
|
||||
|
||||
struct apple_rtkit {
|
||||
struct rtkit_state *state;
|
||||
struct apple_rtkit_ep ep[64];
|
||||
|
@ -170,10 +176,12 @@ apple_rtkit_logmap(void *cookie, bus_addr_t addr)
|
|||
void
|
||||
apple_rtkit_do_recv(void *arg)
|
||||
{
|
||||
struct apple_rtkit_ep *rtkep = arg;
|
||||
struct apple_rtkit_task *rtktask = arg;
|
||||
struct apple_rtkit_ep *rtkep = rtktask->rtkep;
|
||||
struct apple_rtkit *rtk = rtkep->rtk;
|
||||
|
||||
rtk->ops->recv_message(rtk->cookie, rtkep->ep, rtkep->msg);
|
||||
rtk->ops->recv_message(rtk->cookie, rtkep->ep, rtktask->msg);
|
||||
pool_put(&rtktask_pool, rtktask);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -181,9 +189,15 @@ apple_rtkit_recv(void *cookie, uint64_t msg)
|
|||
{
|
||||
struct apple_rtkit_ep *rtkep = cookie;
|
||||
struct apple_rtkit *rtk = rtkep->rtk;
|
||||
struct apple_rtkit_task *rtktask;
|
||||
|
||||
rtkep->msg = msg;
|
||||
task_add(rtk->tq, &rtkep->task);
|
||||
rtktask = pool_get(&rtktask_pool, PR_NOWAIT | PR_ZERO);
|
||||
KASSERT(rtktask != NULL);
|
||||
|
||||
rtktask->rtkep = rtkep;
|
||||
rtktask->msg = msg;
|
||||
task_set(&rtktask->task, apple_rtkit_do_recv, rtktask);
|
||||
task_add(rtk->tq, &rtktask->task);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -195,8 +209,6 @@ apple_rtkit_start_ep(struct apple_rtkit *rtk, uint8_t ep)
|
|||
rtkep = &rtk->ep[ep];
|
||||
rtkep->rtk = rtk;
|
||||
rtkep->ep = ep;
|
||||
task_set(&rtkep->task, apple_rtkit_do_recv, rtkep);
|
||||
|
||||
error = rtkit_start_endpoint(rtk->state, ep, apple_rtkit_recv, rtkep);
|
||||
return -error;
|
||||
}
|
||||
|
@ -239,6 +251,9 @@ devm_apple_rtkit_init(struct device *dev, void *cookie,
|
|||
return ERR_PTR(ENOMEM);
|
||||
}
|
||||
|
||||
pool_init(&rtktask_pool, sizeof(struct apple_rtkit_task), 0, IPL_TTY,
|
||||
0, "apldcp_rtkit", NULL);
|
||||
|
||||
rk = malloc(sizeof(*rk), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
rk->rk_cookie = rtk;
|
||||
rk->rk_dmat = pdev->dmat;
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include <linux/pseudo_fs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/srcu.h>
|
||||
#include <linux/suspend.h>
|
||||
|
||||
#include <drm/drm_accel.h>
|
||||
#include <drm/drm_cache.h>
|
||||
|
@ -1548,10 +1549,19 @@ drm_activate(struct device *self, int act)
|
|||
|
||||
switch (act) {
|
||||
case DVACT_QUIESCE:
|
||||
#ifdef CONFIG_ACPI
|
||||
if (acpi_softc && acpi_softc->sc_state == ACPI_STATE_S3)
|
||||
pm_suspend_target_state = PM_SUSPEND_MEM;
|
||||
else
|
||||
pm_suspend_target_state = PM_SUSPEND_TO_IDLE;
|
||||
#else
|
||||
pm_suspend_target_state = PM_SUSPEND_TO_IDLE;
|
||||
#endif
|
||||
drm_quiesce(dev);
|
||||
break;
|
||||
case DVACT_WAKEUP:
|
||||
drm_wakeup(dev);
|
||||
pm_suspend_target_state = PM_SUSPEND_ON;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: drm_linux.c,v 1.114 2024/06/13 18:05:54 kettenis Exp $ */
|
||||
/* $OpenBSD: drm_linux.c,v 1.115 2024/07/13 15:38:21 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
|
||||
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
|
||||
|
@ -51,6 +51,7 @@
|
|||
#include <linux/kthread.h>
|
||||
#include <linux/processor.h>
|
||||
#include <linux/sync_file.h>
|
||||
#include <linux/suspend.h>
|
||||
|
||||
#include <drm/drm_device.h>
|
||||
#include <drm/drm_connector.h>
|
||||
|
@ -1345,6 +1346,8 @@ vga_put(struct pci_dev *pdev, int rsrc)
|
|||
|
||||
#endif
|
||||
|
||||
suspend_state_t pm_suspend_target_state;
|
||||
|
||||
/*
|
||||
* ACPI types and interfaces.
|
||||
*/
|
||||
|
@ -1360,6 +1363,8 @@ vga_put(struct pci_dev *pdev, int rsrc)
|
|||
#include <dev/acpi/amltypes.h>
|
||||
#include <dev/acpi/dsdt.h>
|
||||
|
||||
struct acpi_fadt acpi_gbl_FADT;
|
||||
|
||||
acpi_status
|
||||
acpi_get_table(const char *sig, int instance,
|
||||
struct acpi_table_header **hdr)
|
||||
|
@ -2851,6 +2856,13 @@ drm_linux_init(void)
|
|||
|
||||
kmap_atomic_va =
|
||||
(vaddr_t)km_alloc(PAGE_SIZE, &kv_any, &kp_none, &kd_waitok);
|
||||
|
||||
#if NACPI > 0
|
||||
if (acpi_softc) {
|
||||
memcpy(&acpi_gbl_FADT, acpi_softc->sc_fadt,
|
||||
sizeof(acpi_gbl_FADT));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -427,6 +427,13 @@ static const struct dmi_system_id orientation_data[] = {
|
|||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"),
|
||||
},
|
||||
.driver_data = (void *)&lcd800x1280_rightside_up,
|
||||
}, { /* Valve Steam Deck */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Galileo"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"),
|
||||
},
|
||||
.driver_data = (void *)&lcd800x1280_rightside_up,
|
||||
}, { /* VIOS LTH17 */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VIOS"),
|
||||
|
|
|
@ -326,7 +326,6 @@ void intel_gt_suspend_prepare(struct intel_gt *gt)
|
|||
wait_for_suspend(gt);
|
||||
}
|
||||
|
||||
#ifdef notyet
|
||||
static suspend_state_t pm_suspend_target(void)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_SUSPEND) && IS_ENABLED(CONFIG_PM_SLEEP)
|
||||
|
@ -335,7 +334,6 @@ static suspend_state_t pm_suspend_target(void)
|
|||
return PM_SUSPEND_TO_IDLE;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void intel_gt_suspend_late(struct intel_gt *gt)
|
||||
{
|
||||
|
@ -361,10 +359,8 @@ void intel_gt_suspend_late(struct intel_gt *gt)
|
|||
* powermanagement enabled, but we also retain system state and so
|
||||
* it remains safe to keep on using our allocated memory.
|
||||
*/
|
||||
#ifdef notyet
|
||||
if (pm_suspend_target() == PM_SUSPEND_TO_IDLE)
|
||||
return;
|
||||
#endif
|
||||
|
||||
with_intel_runtime_pm(gt->uncore->rpm, wakeref) {
|
||||
intel_rps_disable(>->rps);
|
||||
|
|
|
@ -93,5 +93,6 @@
|
|||
#endif
|
||||
|
||||
#if defined(SUSPEND) || defined(HIBERNATE)
|
||||
#define CONFIG_SUSPEND 1
|
||||
#define CONFIG_PM_SLEEP 1
|
||||
#endif
|
||||
|
|
|
@ -88,4 +88,7 @@ int unregister_acpi_notifier(struct notifier_block *);
|
|||
|
||||
int acpi_target_system_state(void);
|
||||
|
||||
extern struct acpi_fadt acpi_gbl_FADT;
|
||||
#define ACPI_FADT_LOW_POWER_S0 (1 << 21)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/* Public domain. */
|
||||
|
||||
#ifndef _LINUX_SUSPEND_H
|
||||
#define _LINUX_SUSPEND_H
|
||||
|
||||
typedef int suspend_state_t;
|
||||
|
||||
#define PM_SUSPEND_ON 0
|
||||
#define PM_SUSPEND_MEM 1
|
||||
#define PM_SUSPEND_TO_IDLE 2
|
||||
|
||||
extern suspend_state_t pm_suspend_target_state;
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue