Merge tag 'drm-misc-next-2019-08-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.4: UAPI Changes: - HDCP: Add a Content protection type property Cross-subsystem Changes: Core Changes: - Continue to rework the include dependencies - fb: Remove the unused drm_gem_fbdev_fb_create function - drm-dp-helper: Make the link rate calculation more tolerant to non-explicitly defined, yet supported, rates - fb-helper: Map DRM client buffer only when required, and instanciate a shadow buffer when the device has a dirty function or says so - connector: Add a helper to link the DDC adapter used by that connector to the userspace - vblank: Switch from DRM_WAIT_ON to wait_event_interruptible_timeout - dma-buf: Fix a stack corruption - ttm: Embed a drm_gem_object struct to make ttm_buffer_object a superclass of GEM, and convert drivers to use it. - hdcp: Improvements to report the content protection type to the userspace Driver Changes: - Remove drm_gem_prime_import/export from being defined in the drivers - Drop DRM_AUTH usage from drivers - Continue to drop drmP.h - Convert drivers to the connector ddc helper - ingenic: Add support for more panel-related cases - komeda: Support for dual-link - lima: Reduce logging - mpag200: Fix the cursor support - panfrost: Export GPU features register to userspace through an ioctl - pl111: Remove the CLD pads wiring support from the DT - rockchip: Rework to use DRM PSR helpers, fix a bug in the VOP_WIN_GET macro - sun4i: Improve support for color encoding and range - tinydrm: Rework SPI support, improve MIPI-DBI support, move to drm/tiny - vkms: Rework of the CRC tracking - bridges: - sii902x: Add support for audio graph card - tc358767: Rework AUX data handling code - ti-sn65dsi86: Add Debugfs and proper DSI mode flags support - panels - Support for GiantPlus GPM940B0, Sharp LQ070Y3DG3B, Ortustech COM37H3M, Novatek NT39016, Sharp LS020B1DD01D, Raydium RM67191, Boe Himax8279d, Sharp LD-D5116Z01B - Conversion of the device tree bindings to the YAML description - jh057n00900: Rework the enable / disable path - fbdev: - ssd1307fb: Support more devices based on that controller Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190808121423.xzpedzkpyecvsiy4@flea
This commit is contained in:
@@ -3562,7 +3562,8 @@ static void intel_enable_ddi(struct intel_encoder *encoder,
|
||||
/* Enable hdcp if it's desired */
|
||||
if (conn_state->content_protection ==
|
||||
DRM_MODE_CONTENT_PROTECTION_DESIRED)
|
||||
intel_hdcp_enable(to_intel_connector(conn_state->connector));
|
||||
intel_hdcp_enable(to_intel_connector(conn_state->connector),
|
||||
(u8)conn_state->hdcp_content_type);
|
||||
}
|
||||
|
||||
static void intel_disable_ddi_dp(struct intel_encoder *encoder,
|
||||
@@ -3631,15 +3632,41 @@ static void intel_ddi_update_pipe(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct intel_connector *connector =
|
||||
to_intel_connector(conn_state->connector);
|
||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||
bool content_protection_type_changed =
|
||||
(conn_state->hdcp_content_type != hdcp->content_type &&
|
||||
conn_state->content_protection !=
|
||||
DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
|
||||
|
||||
if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
intel_ddi_update_pipe_dp(encoder, crtc_state, conn_state);
|
||||
|
||||
/*
|
||||
* During the HDCP encryption session if Type change is requested,
|
||||
* disable the HDCP and reenable it with new TYPE value.
|
||||
*/
|
||||
if (conn_state->content_protection ==
|
||||
DRM_MODE_CONTENT_PROTECTION_DESIRED)
|
||||
intel_hdcp_enable(to_intel_connector(conn_state->connector));
|
||||
else if (conn_state->content_protection ==
|
||||
DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
|
||||
intel_hdcp_disable(to_intel_connector(conn_state->connector));
|
||||
DRM_MODE_CONTENT_PROTECTION_UNDESIRED ||
|
||||
content_protection_type_changed)
|
||||
intel_hdcp_disable(connector);
|
||||
|
||||
/*
|
||||
* Mark the hdcp state as DESIRED after the hdcp disable of type
|
||||
* change procedure.
|
||||
*/
|
||||
if (content_protection_type_changed) {
|
||||
mutex_lock(&hdcp->mutex);
|
||||
hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
|
||||
schedule_work(&hdcp->prop_work);
|
||||
mutex_unlock(&hdcp->mutex);
|
||||
}
|
||||
|
||||
if (conn_state->content_protection ==
|
||||
DRM_MODE_CONTENT_PROTECTION_DESIRED ||
|
||||
content_protection_type_changed)
|
||||
intel_hdcp_enable(connector, (u8)conn_state->hdcp_content_type);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -869,7 +869,6 @@ static void intel_hdcp_prop_work(struct work_struct *work)
|
||||
prop_work);
|
||||
struct intel_connector *connector = intel_hdcp_to_connector(hdcp);
|
||||
struct drm_device *dev = connector->base.dev;
|
||||
struct drm_connector_state *state;
|
||||
|
||||
drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
|
||||
mutex_lock(&hdcp->mutex);
|
||||
@@ -879,10 +878,9 @@ static void intel_hdcp_prop_work(struct work_struct *work)
|
||||
* those to UNDESIRED is handled by core. If value == UNDESIRED,
|
||||
* we're running just after hdcp has been disabled, so just exit
|
||||
*/
|
||||
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
|
||||
state = connector->base.state;
|
||||
state->content_protection = hdcp->value;
|
||||
}
|
||||
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
|
||||
drm_hdcp_update_content_protection(&connector->base,
|
||||
hdcp->value);
|
||||
|
||||
mutex_unlock(&hdcp->mutex);
|
||||
drm_modeset_unlock(&dev->mode_config.connection_mutex);
|
||||
@@ -1754,14 +1752,15 @@ static const struct component_ops i915_hdcp_component_ops = {
|
||||
.unbind = i915_hdcp_component_unbind,
|
||||
};
|
||||
|
||||
static inline int initialize_hdcp_port_data(struct intel_connector *connector)
|
||||
static inline int initialize_hdcp_port_data(struct intel_connector *connector,
|
||||
const struct intel_hdcp_shim *shim)
|
||||
{
|
||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||
struct hdcp_port_data *data = &hdcp->port_data;
|
||||
|
||||
data->port = connector->encoder->port;
|
||||
data->port_type = (u8)HDCP_PORT_TYPE_INTEGRATED;
|
||||
data->protocol = (u8)hdcp->shim->protocol;
|
||||
data->protocol = (u8)shim->protocol;
|
||||
|
||||
data->k = 1;
|
||||
if (!data->streams)
|
||||
@@ -1811,12 +1810,13 @@ void intel_hdcp_component_init(struct drm_i915_private *dev_priv)
|
||||
}
|
||||
}
|
||||
|
||||
static void intel_hdcp2_init(struct intel_connector *connector)
|
||||
static void intel_hdcp2_init(struct intel_connector *connector,
|
||||
const struct intel_hdcp_shim *shim)
|
||||
{
|
||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||
int ret;
|
||||
|
||||
ret = initialize_hdcp_port_data(connector);
|
||||
ret = initialize_hdcp_port_data(connector, shim);
|
||||
if (ret) {
|
||||
DRM_DEBUG_KMS("Mei hdcp data init failed\n");
|
||||
return;
|
||||
@@ -1835,23 +1835,28 @@ int intel_hdcp_init(struct intel_connector *connector,
|
||||
if (!shim)
|
||||
return -EINVAL;
|
||||
|
||||
ret = drm_connector_attach_content_protection_property(&connector->base);
|
||||
if (ret)
|
||||
if (is_hdcp2_supported(dev_priv))
|
||||
intel_hdcp2_init(connector, shim);
|
||||
|
||||
ret =
|
||||
drm_connector_attach_content_protection_property(&connector->base,
|
||||
hdcp->hdcp2_supported);
|
||||
if (ret) {
|
||||
hdcp->hdcp2_supported = false;
|
||||
kfree(hdcp->port_data.streams);
|
||||
return ret;
|
||||
}
|
||||
|
||||
hdcp->shim = shim;
|
||||
mutex_init(&hdcp->mutex);
|
||||
INIT_DELAYED_WORK(&hdcp->check_work, intel_hdcp_check_work);
|
||||
INIT_WORK(&hdcp->prop_work, intel_hdcp_prop_work);
|
||||
|
||||
if (is_hdcp2_supported(dev_priv))
|
||||
intel_hdcp2_init(connector);
|
||||
init_waitqueue_head(&hdcp->cp_irq_queue);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int intel_hdcp_enable(struct intel_connector *connector)
|
||||
int intel_hdcp_enable(struct intel_connector *connector, u8 content_type)
|
||||
{
|
||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||
unsigned long check_link_interval = DRM_HDCP_CHECK_PERIOD_MS;
|
||||
@@ -1862,6 +1867,7 @@ int intel_hdcp_enable(struct intel_connector *connector)
|
||||
|
||||
mutex_lock(&hdcp->mutex);
|
||||
WARN_ON(hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED);
|
||||
hdcp->content_type = content_type;
|
||||
|
||||
/*
|
||||
* Considering that HDCP2.2 is more secure than HDCP1.4, If the setup
|
||||
@@ -1873,8 +1879,12 @@ int intel_hdcp_enable(struct intel_connector *connector)
|
||||
check_link_interval = DRM_HDCP2_CHECK_PERIOD_MS;
|
||||
}
|
||||
|
||||
/* When HDCP2.2 fails, HDCP1.4 will be attempted */
|
||||
if (ret && intel_hdcp_capable(connector)) {
|
||||
/*
|
||||
* When HDCP2.2 fails and Content Type is not Type1, HDCP1.4 will
|
||||
* be attempted.
|
||||
*/
|
||||
if (ret && intel_hdcp_capable(connector) &&
|
||||
hdcp->content_type != DRM_MODE_HDCP_CONTENT_TYPE1) {
|
||||
ret = _intel_hdcp_enable(connector);
|
||||
}
|
||||
|
||||
@@ -1956,12 +1966,15 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
|
||||
|
||||
/*
|
||||
* Nothing to do if the state didn't change, or HDCP was activated since
|
||||
* the last commit
|
||||
* the last commit. And also no change in hdcp content type.
|
||||
*/
|
||||
if (old_cp == new_cp ||
|
||||
(old_cp == DRM_MODE_CONTENT_PROTECTION_DESIRED &&
|
||||
new_cp == DRM_MODE_CONTENT_PROTECTION_ENABLED))
|
||||
return;
|
||||
new_cp == DRM_MODE_CONTENT_PROTECTION_ENABLED)) {
|
||||
if (old_state->hdcp_content_type ==
|
||||
new_state->hdcp_content_type)
|
||||
return;
|
||||
}
|
||||
|
||||
crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
|
||||
new_state->crtc);
|
||||
|
@@ -21,7 +21,7 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
|
||||
struct drm_connector_state *new_state);
|
||||
int intel_hdcp_init(struct intel_connector *connector,
|
||||
const struct intel_hdcp_shim *hdcp_shim);
|
||||
int intel_hdcp_enable(struct intel_connector *connector);
|
||||
int intel_hdcp_enable(struct intel_connector *connector, u8 content_type);
|
||||
int intel_hdcp_disable(struct intel_connector *connector);
|
||||
bool is_hdcp_supported(struct drm_i915_private *dev_priv, enum port port);
|
||||
bool intel_hdcp_capable(struct intel_connector *connector);
|
||||
|
@@ -204,8 +204,7 @@ static const struct dma_buf_ops i915_dmabuf_ops = {
|
||||
.end_cpu_access = i915_gem_end_cpu_access,
|
||||
};
|
||||
|
||||
struct dma_buf *i915_gem_prime_export(struct drm_device *dev,
|
||||
struct drm_gem_object *gem_obj, int flags)
|
||||
struct dma_buf *i915_gem_prime_export(struct drm_gem_object *gem_obj, int flags)
|
||||
{
|
||||
struct drm_i915_gem_object *obj = to_intel_bo(gem_obj);
|
||||
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
|
||||
@@ -222,7 +221,7 @@ struct dma_buf *i915_gem_prime_export(struct drm_device *dev,
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return drm_gem_dmabuf_export(dev, &exp_info);
|
||||
return drm_gem_dmabuf_export(gem_obj->dev, &exp_info);
|
||||
}
|
||||
|
||||
static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj)
|
||||
|
@@ -35,7 +35,6 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
|
||||
unsigned int flags,
|
||||
long timeout)
|
||||
{
|
||||
unsigned int seq = __read_seqcount_begin(&resv->seq);
|
||||
struct dma_fence *excl;
|
||||
bool prune_fences = false;
|
||||
|
||||
@@ -83,15 +82,12 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
|
||||
|
||||
/*
|
||||
* Opportunistically prune the fences iff we know they have *all* been
|
||||
* signaled and that the reservation object has not been changed (i.e.
|
||||
* no new fences have been added).
|
||||
* signaled.
|
||||
*/
|
||||
if (prune_fences && !__read_seqcount_retry(&resv->seq, seq)) {
|
||||
if (reservation_object_trylock(resv)) {
|
||||
if (!__read_seqcount_retry(&resv->seq, seq))
|
||||
reservation_object_add_excl_fence(resv, NULL);
|
||||
reservation_object_unlock(resv);
|
||||
}
|
||||
if (prune_fences && reservation_object_trylock(resv)) {
|
||||
if (reservation_object_test_signaled_rcu(resv, true))
|
||||
reservation_object_add_excl_fence(resv, NULL);
|
||||
reservation_object_unlock(resv);
|
||||
}
|
||||
|
||||
return timeout;
|
||||
|
@@ -20,7 +20,7 @@ static int igt_dmabuf_export(void *arg)
|
||||
if (IS_ERR(obj))
|
||||
return PTR_ERR(obj);
|
||||
|
||||
dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0);
|
||||
dmabuf = i915_gem_prime_export(&obj->base, 0);
|
||||
i915_gem_object_put(obj);
|
||||
if (IS_ERR(dmabuf)) {
|
||||
pr_err("i915_gem_prime_export failed with err=%d\n",
|
||||
@@ -44,7 +44,7 @@ static int igt_dmabuf_import_self(void *arg)
|
||||
if (IS_ERR(obj))
|
||||
return PTR_ERR(obj);
|
||||
|
||||
dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0);
|
||||
dmabuf = i915_gem_prime_export(&obj->base, 0);
|
||||
if (IS_ERR(dmabuf)) {
|
||||
pr_err("i915_gem_prime_export failed with err=%d\n",
|
||||
(int)PTR_ERR(dmabuf));
|
||||
@@ -219,7 +219,7 @@ static int igt_dmabuf_export_vmap(void *arg)
|
||||
if (IS_ERR(obj))
|
||||
return PTR_ERR(obj);
|
||||
|
||||
dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0);
|
||||
dmabuf = i915_gem_prime_export(&obj->base, 0);
|
||||
if (IS_ERR(dmabuf)) {
|
||||
pr_err("i915_gem_prime_export failed with err=%d\n",
|
||||
(int)PTR_ERR(dmabuf));
|
||||
@@ -266,7 +266,7 @@ static int igt_dmabuf_export_kmap(void *arg)
|
||||
if (IS_ERR(obj))
|
||||
return PTR_ERR(obj);
|
||||
|
||||
dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0);
|
||||
dmabuf = i915_gem_prime_export(&obj->base, 0);
|
||||
i915_gem_object_put(obj);
|
||||
if (IS_ERR(dmabuf)) {
|
||||
err = PTR_ERR(dmabuf);
|
||||
|
@@ -491,7 +491,7 @@ int intel_vgpu_get_dmabuf(struct intel_vgpu *vgpu, unsigned int dmabuf_id)
|
||||
|
||||
obj->gvt_info = dmabuf_obj->info;
|
||||
|
||||
dmabuf = i915_gem_prime_export(dev, &obj->base, DRM_CLOEXEC | DRM_RDWR);
|
||||
dmabuf = i915_gem_prime_export(&obj->base, DRM_CLOEXEC | DRM_RDWR);
|
||||
if (IS_ERR(dmabuf)) {
|
||||
gvt_vgpu_err("export dma-buf failed\n");
|
||||
ret = PTR_ERR(dmabuf);
|
||||
|
@@ -3195,9 +3195,9 @@ static const struct drm_ioctl_desc i915_ioctls[] = {
|
||||
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_GETPARAM, i915_gem_context_getparam_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_SETPARAM, i915_gem_context_setparam_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_PERF_OPEN, i915_perf_open_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_PERF_ADD_CONFIG, i915_perf_add_config_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_PERF_REMOVE_CONFIG, i915_perf_remove_config_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_QUERY, i915_query_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_PERF_ADD_CONFIG, i915_perf_add_config_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_PERF_REMOVE_CONFIG, i915_perf_remove_config_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_QUERY, i915_query_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_GEM_VM_CREATE, i915_gem_vm_create_ioctl, DRM_RENDER_ALLOW),
|
||||
DRM_IOCTL_DEF_DRV(I915_GEM_VM_DESTROY, i915_gem_vm_destroy_ioctl, DRM_RENDER_ALLOW),
|
||||
};
|
||||
@@ -3207,7 +3207,7 @@ static struct drm_driver driver = {
|
||||
* deal with them for Intel hardware.
|
||||
*/
|
||||
.driver_features =
|
||||
DRIVER_GEM | DRIVER_PRIME |
|
||||
DRIVER_GEM |
|
||||
DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_SYNCOBJ,
|
||||
.release = i915_driver_release,
|
||||
.open = i915_driver_open,
|
||||
|
@@ -2495,8 +2495,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
|
||||
struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev,
|
||||
struct dma_buf *dma_buf);
|
||||
|
||||
struct dma_buf *i915_gem_prime_export(struct drm_device *dev,
|
||||
struct drm_gem_object *gem_obj, int flags);
|
||||
struct dma_buf *i915_gem_prime_export(struct drm_gem_object *gem_obj, int flags);
|
||||
|
||||
static inline struct i915_gem_context *
|
||||
__i915_gem_context_lookup_rcu(struct drm_i915_file_private *file_priv, u32 id)
|
||||
|
Reference in New Issue
Block a user