8000 sys/external/bsd/drm2/dist/drm/i915 subdirectory: Linux 5.6.19 merge by dettus · Pull Request #44 · NetBSD/src · GitHub
[go: up one dir, main page]

Skip to content

sys/external/bsd/drm2/dist/drm/i915 subdirectory: Linux 5.6.19 merge #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sys/external/bsd/drm2/dist/drm/i915/Kconfig.profile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ config DRM_I915_PREEMPT_TIMEOUT

May be 0 to disable the timeout.

The compiled in default may get overridden at driver probe time on
certain platforms and certain engines which will be reflected in the
sysfs control.

config DRM_I915_SPIN_REQUEST
int "Busywait for request completion (us)"
default 5 # microseconds
Expand Down
20 changes: 16 additions & 4 deletions sys/external/bsd/drm2/dist/drm/i915/display/intel_ddi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,11 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder,
return;

dig_port = enc_to_dig_port(encoder);
intel_display_power_get(dev_priv, dig_port->ddi_io_power_domain);

if (!intel_phy_is_tc(dev_priv, phy) ||
dig_port->tc_mode != TC_PORT_TBT_ALT)
intel_display_power_get(dev_priv,
dig_port->ddi_io_power_domain);

/*
* AUX power is only needed for (e)DP mode, and for HDMI mode on TC
Expand Down Expand Up @@ -3546,9 +3550,6 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder,
intel_dp_set_link_params(intel_dp, crtc_state->port_clock,
crtc_state->lane_count, is_mst);

intel_dp->regs.dp_tp_ctl = DP_TP_CTL(port);
intel_dp->regs.dp_tp_status = DP_TP_STATUS(port);

intel_edp_panel_on(intel_dp);

intel_ddi_clk_select(encoder, crtc_state);
Expand Down Expand Up @@ -4270,12 +4271,18 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
u32 temp, flags = 0;

/* XXX: DSI transcoder paranoia */
if (WARN_ON(transcoder_is_dsi(cpu_transcoder)))
return;

if (INTEL_GEN(dev_priv) >= 12) {
intel_dp->regs.dp_tp_ctl = TGL_DP_TP_CTL(cpu_transcoder);
intel_dp->regs.dp_tp_status = TGL_DP_TP_STATUS(cpu_transcoder);
}

intel_dsc_get_config(encoder, pipe_config);

temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
Expand Down Expand Up @@ -4493,6 +4500,7 @@ static const struct drm_encoder_funcs intel_ddi_funcs = {
static struct intel_connector *
intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port)
{
struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
struct intel_connector *connector;
enum port port = intel_dig_port->base.port;

Expand All @@ -4503,6 +4511,10 @@ intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port)
intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
intel_dig_port->dp.prepare_link_retrain =
intel_ddi_prepare_link_retrain;
if (INTEL_GEN(dev_priv) < 12) {
intel_dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
intel_dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
}

if (!intel_dp_init_connector(intel_dig_port, connector)) {
kfree(connector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4081,7 +4081,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
{
.name = "AUX D TBT1",
.domains = TGL_AUX_D_TBT1_IO_POWER_DOMAINS,
.ops = &hsw_power_well_ops,
.ops = &icl_tc_phy_aux_power_well_ops,
.id = DISP_PW_ID_NONE,
{
.hsw.regs = &icl_aux_power_well_regs,
Expand All @@ -4092,7 +4092,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
{
.name = "AUX E TBT2",
.domains = TGL_AUX_E_TBT2_IO_POWER_DOMAINS,
.ops = &hsw_power_well_ops,
.ops = &icl_tc_phy_aux_power_well_ops,
.id = DISP_PW_ID_NONE,
{
.hsw.regs = &icl_aux_power_well_regs,
Expand All @@ -4103,7 +4103,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
{
.name = "AUX F TBT3",
.domains = TGL_AUX_F_TBT3_IO_POWER_DOMAINS,
.ops = &hsw_power_well_ops,
.ops = &icl_tc_phy_aux_power_well_ops,
.id = DISP_PW_ID_NONE,
{
.hsw.regs = &icl_aux_power_well_regs,
Expand All @@ -4114,7 +4114,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
{
.name = "AUX G TBT4",
.domains = TGL_AUX_G_TBT4_IO_POWER_DOMAINS,
.ops = &hsw_power_well_ops,
.ops = &icl_tc_phy_aux_power_well_ops,
.id = DISP_PW_ID_NONE,
{
.hsw.regs = &icl_aux_power_well_regs,
Expand All @@ -4125,7 +4125,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
{
.name = "AUX H TBT5",
.domains = TGL_AUX_H_TBT5_IO_POWER_DOMAINS,
.ops = &hsw_power_well_ops,
.ops = &icl_tc_phy_aux_power_well_ops,
.id = DISP_PW_ID_NONE,
{
.hsw.regs = &icl_aux_power_well_regs,
Expand All @@ -4136,7 +4136,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
{
.name = "AUX I TBT6",
.domains = TGL_AUX_I_TBT6_IO_POWER_DOMAINS,
.ops = &hsw_power_well_ops,
.ops = &icl_tc_phy_aux_power_well_ops,
.id = DISP_PW_ID_NONE,
{
.hsw.regs = &icl_aux_power_well_regs,
Expand Down
5 changes: 2 additions & 3 deletions sys/external/bsd/drm2/dist/drm/i915/display/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2519,9 +2519,6 @@ static void intel_dp_prepare(struct intel_encoder *encoder,
intel_crtc_has_type(pipe_config,
INTEL_OUTPUT_DP_MST));

intel_dp->regs.dp_tp_ctl = DP_TP_CTL(port);
intel_dp->regs.dp_tp_status = DP_TP_STATUS(port);

/*
* There are four kinds of DP registers:
*
Expand Down Expand Up @@ -7651,6 +7648,8 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,

intel_dig_port->dp.output_reg = output_reg;
intel_dig_port->max_lanes = 4;
intel_dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
intel_dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);

intel_encoder->type = INTEL_OUTPUT_DP;
intel_encoder->power_domain = intel_port_to_power_domain(port);
Expand Down
3 changes: 1 addition & 2 deletions sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,7 @@ static int intel_fbc_alloc_cfb(struct drm_i915_private *dev_priv,
if (!ret)
goto err_llb;
else if (ret > 1) {
DRM_INFO("Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.\n");

DRM_INFO_ONCE("Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.\n");
}

fbc->threshold = ret;
Expand Down
17 changes: 12 additions & 5 deletions sys/external/bsd/drm2/dist/drm/i915/display/intel_sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -2738,19 +2738,25 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
}
}

static bool gen12_plane_supports_mc_ccs(enum plane_id plane_id)
static bool gen12_plane_supports_mc_ccs(struct drm_i915_private *dev_priv,
enum plane_id plane_id)
{
/* Wa_14010477008:tgl[a0..c0] */
if (IS_TGL_REVID(dev_priv, TGL_REVID_A0, TGL_REVID_C0))
return false;

return plane_id < PLANE_SPRITE4;
}

static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
u32 format, u64 modifier)
{
struct drm_i915_private *dev_priv = to_i915(_plane->dev);
struct intel_plane *plane = to_intel_plane(_plane);

switch (modifier) {
case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
if (!gen12_plane_supports_mc_ccs(plane->id))
if (!gen12_plane_supports_mc_ccs(dev_priv, plane->id))
return false;
/* fall through */
case DRM_FORMAT_MOD_LINEAR:
Expand Down Expand Up @@ -2919,9 +2925,10 @@ static const u32 *icl_get_plane_formats(struct drm_i915_private *dev_priv,
}
}

static const u64 *gen12_get_plane_modifiers(enum plane_id plane_id)
static const u64 *gen12_get_plane_modifiers(struct drm_i915_private *dev_priv,
enum plane_id plane_id)
{
if (gen12_plane_supports_mc_ccs(plane_id))
if (gen12_plane_supports_mc_ccs(dev_priv, plane_id))
return gen12_plane_format_modifiers_mc_ccs;
else
return gen12_plane_format_modifiers_rc_ccs;
Expand Down Expand Up @@ -2992,7 +2999,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,

plane->has_ccs = skl_plane_has_ccs(dev_priv, pipe, plane_id);
if (INTEL_GEN(dev_priv) >= 12) {
modifiers = gen12_get_plane_modifiers(plane_id);
modifiers = gen12_get_plane_modifiers(dev_priv, plane_id);
plane_funcs = &gen12_plane_funcs;
} else {
if (plane->has_ccs)
Expand Down
7 changes: 1 addition & 6 deletions sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ static void i915_gem_object_bump_inactive_ggtt(struct drm_i915_gem_object *obj)
struct drm_i915_private *i915 = to_i915(obj->base.dev);
struct i915_vma *vma;

GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj));
if (!atomic_read(&obj->bind_count))
return;

Expand Down Expand Up @@ -405,12 +404,8 @@ static void i915_gem_object_bump_inactive_ggtt(struct drm_i915_gem_object *obj)
void
i915_gem_object_unpin_from_display_plane(struct i915_vma *vma)
{
struct drm_i915_gem_object *obj = vma->obj;

assert_object_held(obj);

/* Bump the LRU to try and avoid premature eviction whilst flipping */
i915_gem_object_bump_inactive_ggtt(obj);
i915_gem_object_bump_inactive_ggtt(vma->obj);

i915_vma_unpin(vma);
}
Expand Down
20 changes: 18 additions & 2 deletions sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_tiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,35 @@ i915_gem_object_fence_prepare(struct drm_i915_gem_object *obj,
int tiling_mode, unsigned int stride)
{
struct i915_ggtt *ggtt = &to_i915(obj->base.dev)->ggtt;
struct i915_vma *vma;
struct i915_vma *vma, *vn;
LINUX_LIST_HEAD(unbind);
int ret = 0;

if (tiling_mode == I915_TILING_NONE)
return 0;

mutex_lock(&ggtt->vm.mutex);

spin_lock(&obj->vma.lock);
for_each_ggtt_vma(vma, obj) {
GEM_BUG_ON(vma->vm != &ggtt->vm);

if (i915_vma_fence_prepare(vma, tiling_mode, stride))
continue;

list_move(&vma->vm_link, &unbind);
}
spin_unlock(&obj->vma.lock);

list_for_each_entry_safe(vma, vn, &unbind, vm_link) {
ret = __i915_vma_unbind(vma);
if (ret)
if (ret) {
/* Restore the remaining vma on an error */
list_splice(&unbind, &ggtt->vm.bound_list);
break;
}
}

mutex_unlock(&ggtt->vm.mutex);

return ret;
Expand Down Expand Up @@ -275,6 +289,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
}
mutex_unlock(&obj->mm.lock);

spin_lock(&obj->vma.lock);
for_each_ggtt_vma(vma, obj) {
vma->fence_size =
i915_gem_fence_size(i915, vma->size, tiling, stride);
Expand All @@ -285,6 +300,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
if (vma->fence)
vma->fence->dirty = true;
}
spin_unlock(&obj->vma.lock);

obj->tiling_and_stride = tiling | stride;
i915_gem_object_unlock(obj);
Expand Down
8 changes: 8 additions & 0 deletions sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_userptr.c
< F438 td class="blob-num blob-num-addition empty-cell">
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,14 @@ static int i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj)
GFP_KERNEL |
__GFP_NORETRY |
__GFP_NOWARN);
/*
* Using __get_user_pages_fast() with a read-only
* access is questionable. A read-only page may be
* COW-broken, and then this might end up giving
* the wrong side of the COW..
*
* We may or may not care.
*/
if (pvec) /* defer to worker if malloc fails */
pinned = __get_user_pages_fast(obj->userptr.ptr,
num_pages,
Expand Down
12 changes: 8 additions & 4 deletions sys/external/bsd/drm2/dist/drm/i915/gem/selftests/huge_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,8 +1583,10 @@ static int igt_ppgtt_pin_update(void *arg)
unsigned int page_size = BIT(first);

obj = i915_gem_object_create_internal(dev_priv, page_size);
if (IS_ERR(obj))
return PTR_ERR(obj);
if (IS_ERR(obj)) {
err = PTR_ERR(obj);
goto out_vm;
}

vma = i915_vma_instance(obj, vm, NULL);
if (IS_ERR(vma)) {
Expand Down Expand Up @@ -1637,8 +1639,10 @@ static int igt_ppgtt_pin_update(void *arg)
}

obj = i915_gem_object_create_internal(dev_priv, PAGE_SIZE);
if (IS_ERR(obj))
return PTR_ERR(obj);
if (IS_ERR(obj)) {
err = PTR_ERR(obj);
goto out_vm;
}

vma = i915_vma_instance(obj, vm, NULL);
if (IS_ERR(vma)) {
Expand Down
26 changes: 26 additions & 0 deletions sys/external/bsd/drm2/dist/drm/i915/gt/gen8_ppgtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ static u64 gen8_pde_encode(const dma_addr_t addr,
return pde;
}

static u64 gen8_pte_encode(dma_addr_t addr,
enum i915_cache_level level,
u32 flags)
{
gen8_pte_t pte = addr | _PAGE_PRESENT | _PAGE_RW;

if (unlikely(flags & PTE_READ_ONLY))
pte &= ~_PAGE_RW;

switch (level) {
case I915_CACHE_NONE:
pte |= PPAT_UNCACHED;
break;
case I915_CACHE_WT:
pte |= PPAT_DISPLAY_ELLC;
break;
default:
pte |= PPAT_CACHED;
break;
}

return pte;
}

static void gen8_ppgtt_notify_vgt(struct i915_ppgtt *ppgtt, bool create)
{
struct drm_i915_private *i915 = ppgtt->vm.i915;
Expand Down Expand Up @@ -805,6 +829,8 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt)
ppgtt->vm.allocate_va_range = gen8_ppgtt_alloc;
ppgtt->vm.clear_range = gen8_ppgtt_clear;

ppgtt->vm.pte_encode = gen8_pte_encode;

if (intel_vgpu_active(gt->i915))
gen8_ppgtt_notify_vgt(ppgtt, true);

Expand Down
9 changes: 0 additions & 9 deletions sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,4 @@ intel_engine_has_preempt_reset(const struct intel_engine_cs *engine)
return intel_engine_has_preemption(engine);
}

static inline bool
intel_engine_has_timeslices(const struct intel_engine_cs *engine)
{
if (!IS_ACTIVE(CONFIG_DRM_I915_TIMESLICE_DURATION))
return false;

return intel_engine_has_semaphores(engine);
}

#endif /* _INTEL_RINGBUFFER_H_ */
Loading
0