mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 18:53:52 +08:00
drm fixes for 5.7-rc1
core: - fix race in connectors sending hotplug i915: - Avoid use after free in cmdparser - Avoid NULL dereference when probing all display encoders - Fixup to module parameter type sun4i: - clock divider fix ast: - 24/32 bpp mode setting fix -----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJe4ec6AAoJEAx081l5xIa+nlwQAJbFmInMITfkNoLwh/x7MPZt MUbpO/cZqE/WaNTN8rLOMtU074yav+7YUSnvdjbTfZSy0+/f+aRzGRIL7BkckMmU NJVGU4lB7HeGmdafIdwe11+jCOEv4DLNNqFx2xk+Frp2cRTisF10uaXrTQKQZD1N E2kROWIuWD3cM4lqho4fhETm3HmMc62H3udgHJjMRI5lF0Gj+7uE4Eva08SPTr5E ogC0+R+kkJdzc3iXE/kBkh65Gsygh9x3NkCd62SDHMu8SAZ00YTCn3C1FZ6w0XrB GjaRd6NtlMElLuWy/DAcTxxOorCXVz1XslbGPcogG/lmjsIV8vzf/mTlH70sp9Ex qGbGj1i4sn4HUzOZi7Q4IR+9NVN15r9USSMgQT+nleQXFTq2rk8lctPvF7NtQYIm vHtieo73FjNcA7+ewI9b/2zDaOX2CxrjphCFGPMYneZQ61vYZXiJaV4ir0/k1XNv mQwv0riIXqQrRRlWVJz+wGBLtNgzKnxpZE0V9b2kpvcYpfqMmsXGcaUIpj+ufSmQ ERwS76aJ2QhsGRkvz8Ys9meK1K84wWWWaxDNozeQFRLd4Rjpa0cBjL41pX7RwD/+ WFsWg+ujt4slxZNvRUakO9LeQCV0GvL7WpMbdmCIJKYyTC3erf8j72H9AMxvwz9X 1V/7G+LUo863IOkaVjlG =IBzW -----END PGP SIGNATURE----- Merge tag 'drm-next-2020-06-11-1' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "One sun4i fix and a connector hotplug race The ast fix is for a regression in 5.6, and one of the i915 ones fixes an oops reported by dhowells. core: - fix race in connectors sending hotplug i915: - Avoid use after free in cmdparser - Avoid NULL dereference when probing all display encoders - Fixup to module parameter type sun4i: - clock divider fix ast: - 24/32 bpp mode setting fix" * tag 'drm-next-2020-06-11-1' of git://anongit.freedesktop.org/drm/drm: drm/ast: fix missing break in switch statement for format->cpp[0] case 4 drm/sun4i: hdmi ddc clk: Fix size of m divider drm/i915/display: Only query DP state of a DDI encoder drm/i915/params: fix i915.reset module param type drm/i915/gem: Mark the buffer pool as active for the cmdparser drm/connector: notify userspace on hotplug after register complete
This commit is contained in:
commit
d4e181f204
@ -226,6 +226,7 @@ static void ast_set_vbios_color_reg(struct ast_private *ast,
|
||||
case 3:
|
||||
case 4:
|
||||
color_index = TrueCModeIndex;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_file.h>
|
||||
#include <drm/drm_sysfs.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
@ -523,6 +524,10 @@ int drm_connector_register(struct drm_connector *connector)
|
||||
drm_mode_object_register(connector->dev, &connector->base);
|
||||
|
||||
connector->registration_state = DRM_CONNECTOR_REGISTERED;
|
||||
|
||||
/* Let userspace know we have a new connector */
|
||||
drm_sysfs_hotplug_event(connector->dev);
|
||||
|
||||
goto unlock;
|
||||
|
||||
err_debugfs:
|
||||
|
@ -291,9 +291,6 @@ int drm_sysfs_connector_add(struct drm_connector *connector)
|
||||
return PTR_ERR(connector->kdev);
|
||||
}
|
||||
|
||||
/* Let userspace know we have a new connector */
|
||||
drm_sysfs_hotplug_event(dev);
|
||||
|
||||
if (connector->ddc)
|
||||
return sysfs_create_link(&connector->kdev->kobj,
|
||||
&connector->ddc->dev.kobj, "ddc");
|
||||
|
@ -5206,6 +5206,9 @@ void intel_read_dp_sdp(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *crtc_state,
|
||||
unsigned int type)
|
||||
{
|
||||
if (encoder->type != INTEL_OUTPUT_DDI)
|
||||
return;
|
||||
|
||||
switch (type) {
|
||||
case DP_SDP_VSC:
|
||||
intel_read_dp_vsc_sdp(encoder, crtc_state,
|
||||
|
@ -1988,6 +1988,38 @@ static const struct dma_fence_work_ops eb_parse_ops = {
|
||||
.release = __eb_parse_release,
|
||||
};
|
||||
|
||||
static inline int
|
||||
__parser_mark_active(struct i915_vma *vma,
|
||||
struct intel_timeline *tl,
|
||||
struct dma_fence *fence)
|
||||
{
|
||||
struct intel_gt_buffer_pool_node *node = vma->private;
|
||||
|
||||
return i915_active_ref(&node->active, tl, fence);
|
||||
}
|
||||
|
||||
static int
|
||||
parser_mark_active(struct eb_parse_work *pw, struct intel_timeline *tl)
|
||||
{
|
||||
int err;
|
||||
|
||||
mutex_lock(&tl->mutex);
|
||||
|
||||
err = __parser_mark_active(pw->shadow, tl, &pw->base.dma);
|
||||
if (err)
|
||||
goto unlock;
|
||||
|
||||
if (pw->trampoline) {
|
||||
err = __parser_mark_active(pw->trampoline, tl, &pw->base.dma);
|
||||
if (err)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&tl->mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int eb_parse_pipeline(struct i915_execbuffer *eb,
|
||||
struct i915_vma *shadow,
|
||||
struct i915_vma *trampoline)
|
||||
@ -2022,20 +2054,25 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,
|
||||
pw->shadow = shadow;
|
||||
pw->trampoline = trampoline;
|
||||
|
||||
/* Mark active refs early for this worker, in case we get interrupted */
|
||||
err = parser_mark_active(pw, eb->context->timeline);
|
||||
if (err)
|
||||
goto err_commit;
|
||||
|
||||
err = dma_resv_lock_interruptible(pw->batch->resv, NULL);
|
||||
if (err)
|
||||
goto err_trampoline;
|
||||
goto err_commit;
|
||||
|
||||
err = dma_resv_reserve_shared(pw->batch->resv, 1);
|
||||
if (err)
|
||||
goto err_batch_unlock;
|
||||
goto err_commit_unlock;
|
||||
|
||||
/* Wait for all writes (and relocs) into the batch to complete */
|
||||
err = i915_sw_fence_await_reservation(&pw->base.chain,
|
||||
pw->batch->resv, NULL, false,
|
||||
0, I915_FENCE_GFP);
|
||||
if (err < 0)
|
||||
goto err_batch_unlock;
|
||||
goto err_commit_unlock;
|
||||
|
||||
/* Keep the batch alive and unwritten as we parse */
|
||||
dma_resv_add_shared_fence(pw->batch->resv, &pw->base.dma);
|
||||
@ -2050,11 +2087,13 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,
|
||||
dma_fence_work_commit_imm(&pw->base);
|
||||
return 0;
|
||||
|
||||
err_batch_unlock:
|
||||
err_commit_unlock:
|
||||
dma_resv_unlock(pw->batch->resv);
|
||||
err_trampoline:
|
||||
if (trampoline)
|
||||
i915_active_release(&trampoline->active);
|
||||
err_commit:
|
||||
i915_sw_fence_set_error_once(&pw->base.chain, err);
|
||||
dma_fence_work_commit_imm(&pw->base);
|
||||
return err;
|
||||
|
||||
err_shadow:
|
||||
i915_active_release(&shadow->active);
|
||||
err_batch:
|
||||
@ -2100,6 +2139,7 @@ static int eb_parse(struct i915_execbuffer *eb)
|
||||
goto err;
|
||||
}
|
||||
i915_gem_object_set_readonly(shadow->obj);
|
||||
shadow->private = pool;
|
||||
|
||||
trampoline = NULL;
|
||||
if (CMDPARSER_USES_GGTT(eb->i915)) {
|
||||
@ -2113,6 +2153,7 @@ static int eb_parse(struct i915_execbuffer *eb)
|
||||
shadow = trampoline;
|
||||
goto err_shadow;
|
||||
}
|
||||
shadow->private = pool;
|
||||
|
||||
eb->batch_flags |= I915_DISPATCH_SECURE;
|
||||
}
|
||||
@ -2129,7 +2170,6 @@ static int eb_parse(struct i915_execbuffer *eb)
|
||||
eb->trampoline = trampoline;
|
||||
eb->batch_start_offset = 0;
|
||||
|
||||
shadow->private = pool;
|
||||
return 0;
|
||||
|
||||
err_trampoline:
|
||||
|
@ -65,7 +65,7 @@ i915_param_named_unsafe(vbt_sdvo_panel_type, int, 0400,
|
||||
"Override/Ignore selection of SDVO panel mode in the VBT "
|
||||
"(-2=ignore, -1=auto [default], index in VBT BIOS table)");
|
||||
|
||||
i915_param_named_unsafe(reset, int, 0600,
|
||||
i915_param_named_unsafe(reset, uint, 0600,
|
||||
"Attempt GPU resets (0=disabled, 1=full gpu reset, 2=engine reset [default])");
|
||||
|
||||
i915_param_named_unsafe(vbt_firmware, charp, 0400,
|
||||
|
@ -148,7 +148,7 @@
|
||||
#define SUN4I_HDMI_DDC_CMD_IMPLICIT_WRITE 3
|
||||
|
||||
#define SUN4I_HDMI_DDC_CLK_REG 0x528
|
||||
#define SUN4I_HDMI_DDC_CLK_M(m) (((m) & 0x7) << 3)
|
||||
#define SUN4I_HDMI_DDC_CLK_M(m) (((m) & 0xf) << 3)
|
||||
#define SUN4I_HDMI_DDC_CLK_N(n) ((n) & 0x7)
|
||||
|
||||
#define SUN4I_HDMI_DDC_LINE_CTRL_REG 0x540
|
||||
|
@ -33,7 +33,7 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,
|
||||
unsigned long best_rate = 0;
|
||||
u8 best_m = 0, best_n = 0, _m, _n;
|
||||
|
||||
for (_m = 0; _m < 8; _m++) {
|
||||
for (_m = 0; _m < 16; _m++) {
|
||||
for (_n = 0; _n < 8; _n++) {
|
||||
unsigned long tmp_rate;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user