Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2016-12-08' of git://anongit.freedesktop.org…
Browse files Browse the repository at this point in the history
…/git/drm-misc into drm-next

Another pile of misc stuff, final one for 4.10. If there's some serious
bugfix still I'll send you a pull for drm-misc-next-fixes (like we do with
intel), otherwise this is it and next pull next year for 4.11.

Most interesting bits are probably Chris' fb helper fixes against mst
hotplug oopses.

* tag 'drm-misc-next-2016-12-08' of git://anongit.freedesktop.org/git/drm-misc: (22 commits)
  drm: Take ownership of the dmabuf->obj when exporting
  drm: Allow CAP_PRIME on !MODESET
  drm/fence: add drm_crtc_create_fence()
  drm/bridge: analogix: Don't return -EINVAL when panel doesn't support PSR
  drm/atomic: doc: remove old comment about nonblocking commits
  drm: Don't block the kworker waiting for mode_config.mutex in output_poll()
  drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver
  drm/amdgpu: don't add files at control minor debugfs directory
  drm: allow changing DPMS mode
  drm/qxl: fix use of uninitialized variable
  drm/qxl: Don't register debugfs for control minors
  drm/radeon: don't add files at control minor debugfs directory
  drm/vmwgfx: Switch to mode_cmd2
  drm/vgem: Use ww_mutex_(un)lock even with a NULL context
  drm: Make the connector .detect() callback optional
  drm/bridge: tc358767: don't warn if display side ASSR enable fails
  drm: Initialise drm_mm.head_node.allocated
  drm: Fix locking cargo-cult in encoder/plane init/cleanup
  drm/doc: Fix indenting in drm_modeset_lock.c comment
  drm: Protect fb_helper list manipulation with a mutex
  ...
  • Loading branch information
Dave Airlie committed Dec 9, 2016
2 parents bfd5be0 + 72a93e8 commit acc5ddd
Show file tree
Hide file tree
Showing 47 changed files with 188 additions and 414 deletions.
6 changes: 0 additions & 6 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2498,9 +2498,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev,
adev->debugfs[adev->debugfs_count].num_files = nfiles;
adev->debugfs_count = i;
#if defined(CONFIG_DEBUG_FS)
drm_debugfs_create_files(files, nfiles,
adev->ddev->control->debugfs_root,
adev->ddev->control);
drm_debugfs_create_files(files, nfiles,
adev->ddev->primary->debugfs_root,
adev->ddev->primary);
Expand All @@ -2514,9 +2511,6 @@ static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev)
unsigned i;

for (i = 0; i < adev->debugfs_count; i++) {
drm_debugfs_remove_files(adev->debugfs[i].files,
adev->debugfs[i].num_files,
adev->ddev->control);
drm_debugfs_remove_files(adev->debugfs[i].files,
adev->debugfs[i].num_files,
adev->ddev->primary);
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/amd/amdgpu/dce_virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,6 @@ dce_virtual_dpms(struct drm_connector *connector, int mode)
return 0;
}

static enum drm_connector_status
dce_virtual_detect(struct drm_connector *connector, bool force)
{
return connector_status_connected;
}

static int
dce_virtual_set_property(struct drm_connector *connector,
struct drm_property *property,
Expand Down Expand Up @@ -458,7 +452,6 @@ static const struct drm_connector_helper_funcs dce_virtual_connector_helper_func

static const struct drm_connector_funcs dce_virtual_connector_funcs = {
.dpms = dce_virtual_dpms,
.detect = dce_virtual_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.set_property = dce_virtual_set_property,
.destroy = dce_virtual_destroy,
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/arc/arcpgu_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
return count;
}

static enum drm_connector_status
arcpgu_drm_connector_detect(struct drm_connector *connector, bool force)
{
return connector_status_connected;
}

static void arcpgu_drm_connector_destroy(struct drm_connector *connector)
{
drm_connector_unregister(connector);
Expand All @@ -61,7 +55,6 @@ arcpgu_drm_connector_helper_funcs = {
static const struct drm_connector_funcs arcpgu_drm_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.reset = drm_atomic_helper_connector_reset,
.detect = arcpgu_drm_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = arcpgu_drm_connector_destroy,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/ast/ast_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,6 @@ static void ast_connector_destroy(struct drm_connector *connector)
kfree(connector);
}

static enum drm_connector_status
ast_connector_detect(struct drm_connector *connector, bool force)
{
return connector_status_connected;
}

static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {
.mode_valid = ast_mode_valid,
.get_modes = ast_get_modes,
Expand All @@ -853,7 +847,6 @@ static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {

static const struct drm_connector_funcs ast_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = ast_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = ast_connector_destroy,
};
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/bochs/bochs_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,6 @@ bochs_connector_best_encoder(struct drm_connector *connector)
return NULL;
}

static enum drm_connector_status bochs_connector_detect(struct drm_connector
*connector, bool force)
{
return connector_status_connected;
}

static const struct drm_connector_helper_funcs bochs_connector_connector_helper_funcs = {
.get_modes = bochs_connector_get_modes,
.mode_valid = bochs_connector_mode_valid,
Expand All @@ -230,7 +224,6 @@ static const struct drm_connector_helper_funcs bochs_connector_connector_helper_

static const struct drm_connector_funcs bochs_connector_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = bochs_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = drm_connector_cleanup,
};
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int analogix_dp_enable_psr(struct device *dev)
struct edp_vsc_psr psr_vsc;

if (!dp->psr_support)
return -EINVAL;
return 0;

/* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */
memset(&psr_vsc, 0, sizeof(psr_vsc));
Expand All @@ -135,7 +135,7 @@ int analogix_dp_disable_psr(struct device *dev)
struct edp_vsc_psr psr_vsc;

if (!dp->psr_support)
return -EINVAL;
return 0;

/* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */
memset(&psr_vsc, 0, sizeof(psr_vsc));
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/bridge/nxp-ptn3460.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,9 @@ static const struct drm_connector_helper_funcs ptn3460_connector_helper_funcs =
.get_modes = ptn3460_get_modes,
};

static enum drm_connector_status ptn3460_detect(struct drm_connector *connector,
bool force)
{
return connector_status_connected;
}

static const struct drm_connector_funcs ptn3460_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.fill_modes = drm_helper_probe_single_connector_modes,
.detect = ptn3460_detect,
.destroy = drm_connector_cleanup,
.reset = drm_atomic_helper_connector_reset,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/bridge/parade-ps8622.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,16 +477,9 @@ static const struct drm_connector_helper_funcs ps8622_connector_helper_funcs = {
.get_modes = ps8622_get_modes,
};

static enum drm_connector_status ps8622_detect(struct drm_connector *connector,
bool force)
{
return connector_status_connected;
}

static const struct drm_connector_funcs ps8622_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.fill_modes = drm_helper_probe_single_connector_modes,
.detect = ps8622_detect,
.destroy = drm_connector_cleanup,
.reset = drm_atomic_helper_connector_reset,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
Expand Down
9 changes: 1 addition & 8 deletions drivers/gpu/drm/bridge/tc358767.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ static int tc_main_link_setup(struct tc_data *tc)
goto err_dpcd_read;

if (tmp[0] != tc->assr) {
dev_warn(dev, "Failed to switch display ASSR to %d, falling back to unscrambled mode\n",
dev_dbg(dev, "Failed to switch display ASSR to %d, falling back to unscrambled mode\n",
tc->assr);
/* trying with disabled scrambler */
tc->link.scrambler_dis = 1;
Expand Down Expand Up @@ -1038,12 +1038,6 @@ static int tc_main_link_stream(struct tc_data *tc, int state)
return ret;
}

static enum drm_connector_status
tc_connector_detect(struct drm_connector *connector, bool force)
{
return connector_status_connected;
}

static void tc_bridge_pre_enable(struct drm_bridge *bridge)
{
struct tc_data *tc = bridge_to_tc(bridge);
Expand Down Expand Up @@ -1168,7 +1162,6 @@ static const struct drm_connector_helper_funcs tc_connector_helper_funcs = {
static const struct drm_connector_funcs tc_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.fill_modes = drm_helper_probe_single_connector_modes,
.detect = tc_connector_detect,
.destroy = drm_connector_cleanup,
.reset = drm_atomic_helper_connector_reset,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/cirrus/cirrus_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,6 @@ static struct drm_encoder *cirrus_connector_best_encoder(struct drm_connector
return NULL;
}

static enum drm_connector_status cirrus_vga_detect(struct drm_connector
*connector, bool force)
{
return connector_status_connected;
}

static void cirrus_connector_destroy(struct drm_connector *connector)
{
drm_connector_cleanup(connector);
Expand All @@ -517,7 +511,6 @@ static const struct drm_connector_helper_funcs cirrus_vga_connector_helper_funcs

static const struct drm_connector_funcs cirrus_vga_connector_funcs = {
.dpms = drm_helper_connector_dpms,
.detect = cirrus_vga_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = cirrus_connector_destroy,
};
Expand Down
16 changes: 1 addition & 15 deletions drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1864,20 +1864,6 @@ EXPORT_SYMBOL(drm_atomic_clean_old_fb);
* helpers and for the DRM event handling for existing userspace.
*/

static struct dma_fence *get_crtc_fence(struct drm_crtc *crtc)
{
struct dma_fence *fence;

fence = kzalloc(sizeof(*fence), GFP_KERNEL);
if (!fence)
return NULL;

dma_fence_init(fence, &drm_crtc_fence_ops, &crtc->fence_lock,
crtc->fence_context, ++crtc->fence_seqno);

return fence;
}

struct drm_out_fence_state {
s64 __user *out_fence_ptr;
struct sync_file *sync_file;
Expand Down Expand Up @@ -1959,7 +1945,7 @@ static int prepare_crtc_signaling(struct drm_device *dev,
f[*num_fences].out_fence_ptr = fence_ptr;
*fence_state = f;

fence = get_crtc_fence(crtc);
fence = drm_crtc_create_fence(crtc);
if (!fence)
return -ENOMEM;

Expand Down
7 changes: 2 additions & 5 deletions drivers/gpu/drm/drm_atomic_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,6 @@ static void commit_work(struct work_struct *work)
* function implements nonblocking commits, using
* drm_atomic_helper_setup_commit() and related functions.
*
* Note that right now this function does not support nonblocking commits, hence
* driver writers must implement their own version for now.
*
* Committing the actual hardware state is done through the
* ->atomic_commit_tail() callback of the &drm_mode_config_helper_funcs vtable,
* or it's default implementation drm_atomic_helper_commit_tail().
Expand Down Expand Up @@ -2885,8 +2882,8 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
fail:
if (ret == -EDEADLK)
goto backoff;

connector->dpms = old_mode;
if (ret != 0)
connector->dpms = old_mode;
drm_atomic_state_put(state);
return ret;

Expand Down
18 changes: 17 additions & 1 deletion drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ static void drm_crtc_crc_fini(struct drm_crtc *crtc)
#endif
}

static const struct dma_fence_ops drm_crtc_fence_ops;

static struct drm_crtc *fence_to_crtc(struct dma_fence *fence)
{
BUG_ON(fence->ops != &drm_crtc_fence_ops);
Expand All @@ -177,13 +179,27 @@ static bool drm_crtc_fence_enable_signaling(struct dma_fence *fence)
return true;
}

const struct dma_fence_ops drm_crtc_fence_ops = {
static const struct dma_fence_ops drm_crtc_fence_ops = {
.get_driver_name = drm_crtc_fence_get_driver_name,
.get_timeline_name = drm_crtc_fence_get_timeline_name,
.enable_signaling = drm_crtc_fence_enable_signaling,
.wait = dma_fence_default_wait,
};

struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc)
{
struct dma_fence *fence;

fence = kzalloc(sizeof(*fence), GFP_KERNEL);
if (!fence)
return NULL;

dma_fence_init(fence, &drm_crtc_fence_ops, &crtc->fence_lock,
crtc->fence_context, ++crtc->fence_seqno);

return fence;
}

/**
* drm_crtc_init_with_planes - Initialise a new CRTC object with
* specified primary and cursor planes.
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_crtc_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
int drm_crtc_register_all(struct drm_device *dev);
void drm_crtc_unregister_all(struct drm_device *dev);

extern const struct dma_fence_ops drm_crtc_fence_ops;
struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc);

/* IOCTLs */
int drm_mode_getcrtc(struct drm_device *dev,
Expand Down
9 changes: 1 addition & 8 deletions drivers/gpu/drm/drm_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ int drm_encoder_init(struct drm_device *dev,
{
int ret;

drm_modeset_lock_all(dev);

ret = drm_mode_object_get(dev, &encoder->base, DRM_MODE_OBJECT_ENCODER);
if (ret)
goto out_unlock;
return ret;

encoder->dev = dev;
encoder->encoder_type = encoder_type;
Expand Down Expand Up @@ -142,9 +140,6 @@ int drm_encoder_init(struct drm_device *dev,
if (ret)
drm_mode_object_unregister(dev, &encoder->base);

out_unlock:
drm_modeset_unlock_all(dev);

return ret;
}
EXPORT_SYMBOL(drm_encoder_init);
Expand All @@ -164,12 +159,10 @@ void drm_encoder_cleanup(struct drm_encoder *encoder)
* the indices on the drm_encoder after us in the encoder_list.
*/

drm_modeset_lock_all(dev);
drm_mode_object_unregister(dev, &encoder->base);
kfree(encoder->name);
list_del(&encoder->head);
dev->mode_config.num_encoder--;
drm_modeset_unlock_all(dev);

memset(encoder, 0, sizeof(*encoder));
}
Expand Down
Loading

0 comments on commit acc5ddd

Please sign in to comment.