diff options
author | Dave Airlie <airlied@redhat.com> | 2016-09-27 21:09:59 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-09-27 21:09:59 -0400 |
commit | f8049dd865a1de8b494c16a4cd18ee15fa896810 (patch) | |
tree | 37b874acba1392e97864dc24692736210543a4e4 /drivers/gpu/drm | |
parent | 3f346d5dcb591c2a5a26653d093af710cf2e5a31 (diff) | |
parent | 7a3bcc0a8e2ad5fa7fe6d627e01c66b3488149b7 (diff) |
Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
A bit smaller pull-req this time around. Some continued DT binding
cleanup to get the corresponding dts bits merged upstream (through
other trees). And explicit fence-fd support for submit ioctl.
* 'msm-next' of git://people.freedesktop.org/~robclark/linux:
drm/msm: bump kernel api version for explicit fencing
drm/msm: submit support for out-fences
drm/msm: move fence allocation out of msm_gpu_submit()
drm/msm: submit support for in-fences
drm/msm: extend the submit ioctl to pass in flags
drm/msm/mdp5: Set rotation property initial value to DRM_ROTATE_0 insted of 0
drm/msm/hdmi: don't print error when adding i2c adapter fails
drm/msm/mdp4: mark symbols static where possible
drm/msm: Remove call to reservation_object_test_signaled_rcu before wait
drm/msm/hdmi: Clean up HDMI gpio DT bindings
drm/msm/mdp4: Fix issue with LCDC/LVDS port parsing
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/msm/Kconfig | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 73 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_gpu.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_gpu.h | 2 |
12 files changed, 120 insertions, 51 deletions
diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig index 7c7a0314a756..d96b2b6898a3 100644 --- a/drivers/gpu/drm/msm/Kconfig +++ b/drivers/gpu/drm/msm/Kconfig | |||
@@ -11,6 +11,7 @@ config DRM_MSM | |||
11 | select TMPFS | 11 | select TMPFS |
12 | select QCOM_SCM | 12 | select QCOM_SCM |
13 | select SND_SOC_HDMI_CODEC if SND_SOC | 13 | select SND_SOC_HDMI_CODEC if SND_SOC |
14 | select SYNC_FILE | ||
14 | default y | 15 | default y |
15 | help | 16 | help |
16 | DRM/KMS driver for MSM/snapdragon. | 17 | DRM/KMS driver for MSM/snapdragon. |
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 973720792236..a968cad509c2 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c | |||
@@ -422,12 +422,29 @@ static const struct { | |||
422 | 422 | ||
423 | static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name) | 423 | static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name) |
424 | { | 424 | { |
425 | int gpio = of_get_named_gpio(of_node, name, 0); | 425 | int gpio; |
426 | |||
427 | /* try with the gpio names as in the table (downstream bindings) */ | ||
428 | gpio = of_get_named_gpio(of_node, name, 0); | ||
426 | if (gpio < 0) { | 429 | if (gpio < 0) { |
427 | char name2[32]; | 430 | char name2[32]; |
428 | snprintf(name2, sizeof(name2), "%s-gpio", name); | 431 | |
432 | /* try with the gpio names as in the upstream bindings */ | ||
433 | snprintf(name2, sizeof(name2), "%s-gpios", name); | ||
429 | gpio = of_get_named_gpio(of_node, name2, 0); | 434 | gpio = of_get_named_gpio(of_node, name2, 0); |
430 | if (gpio < 0) { | 435 | if (gpio < 0) { |
436 | char name3[32]; | ||
437 | |||
438 | /* | ||
439 | * try again after stripping out the "qcom,hdmi-tx" | ||
440 | * prefix. This is mainly to match "hpd-gpios" used | ||
441 | * in the upstream bindings | ||
442 | */ | ||
443 | if (sscanf(name2, "qcom,hdmi-tx-%s", name3)) | ||
444 | gpio = of_get_named_gpio(of_node, name3, 0); | ||
445 | } | ||
446 | |||
447 | if (gpio < 0) { | ||
431 | DBG("failed to get gpio: %s (%d)", name, gpio); | 448 | DBG("failed to get gpio: %s (%d)", name, gpio); |
432 | gpio = -1; | 449 | gpio = -1; |
433 | } | 450 | } |
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c index de9007e72f4e..73e20219d431 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | |||
@@ -243,7 +243,6 @@ void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c) | |||
243 | 243 | ||
244 | struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) | 244 | struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) |
245 | { | 245 | { |
246 | struct drm_device *dev = hdmi->dev; | ||
247 | struct hdmi_i2c_adapter *hdmi_i2c; | 246 | struct hdmi_i2c_adapter *hdmi_i2c; |
248 | struct i2c_adapter *i2c = NULL; | 247 | struct i2c_adapter *i2c = NULL; |
249 | int ret; | 248 | int ret; |
@@ -267,10 +266,8 @@ struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) | |||
267 | i2c->algo = &msm_hdmi_i2c_algorithm; | 266 | i2c->algo = &msm_hdmi_i2c_algorithm; |
268 | 267 | ||
269 | ret = i2c_add_adapter(i2c); | 268 | ret = i2c_add_adapter(i2c); |
270 | if (ret) { | 269 | if (ret) |
271 | dev_err(dev->dev, "failed to register hdmi i2c: %d\n", ret); | ||
272 | goto fail; | 270 | goto fail; |
273 | } | ||
274 | 271 | ||
275 | return i2c; | 272 | return i2c; |
276 | 273 | ||
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c index 7b39e89fbc2b..571a91ee9607 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | |||
@@ -228,18 +228,21 @@ static struct device_node *mdp4_detect_lcdc_panel(struct drm_device *dev) | |||
228 | struct device_node *endpoint, *panel_node; | 228 | struct device_node *endpoint, *panel_node; |
229 | struct device_node *np = dev->dev->of_node; | 229 | struct device_node *np = dev->dev->of_node; |
230 | 230 | ||
231 | endpoint = of_graph_get_next_endpoint(np, NULL); | 231 | /* |
232 | * LVDS/LCDC is the first port described in the list of ports in the | ||
233 | * MDP4 DT node. | ||
234 | */ | ||
235 | endpoint = of_graph_get_endpoint_by_regs(np, 0, -1); | ||
232 | if (!endpoint) { | 236 | if (!endpoint) { |
233 | DBG("no endpoint in MDP4 to fetch LVDS panel\n"); | 237 | DBG("no LVDS remote endpoint\n"); |
234 | return NULL; | 238 | return NULL; |
235 | } | 239 | } |
236 | 240 | ||
237 | /* don't proceed if we have an endpoint but no panel_node tied to it */ | ||
238 | panel_node = of_graph_get_remote_port_parent(endpoint); | 241 | panel_node = of_graph_get_remote_port_parent(endpoint); |
239 | if (!panel_node) { | 242 | if (!panel_node) { |
240 | dev_err(dev->dev, "no valid panel node\n"); | 243 | DBG("no valid panel node in LVDS endpoint\n"); |
241 | of_node_put(endpoint); | 244 | of_node_put(endpoint); |
242 | return ERR_PTR(-ENODEV); | 245 | return NULL; |
243 | } | 246 | } |
244 | 247 | ||
245 | of_node_put(endpoint); | 248 | of_node_put(endpoint); |
@@ -262,14 +265,12 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, | |||
262 | switch (intf_type) { | 265 | switch (intf_type) { |
263 | case DRM_MODE_ENCODER_LVDS: | 266 | case DRM_MODE_ENCODER_LVDS: |
264 | /* | 267 | /* |
265 | * bail out early if: | 268 | * bail out early if there is no panel node (no need to |
266 | * - there is no panel node (no need to initialize lcdc | 269 | * initialize LCDC encoder and LVDS connector) |
267 | * encoder and lvds connector), or | ||
268 | * - panel node is a bad pointer | ||
269 | */ | 270 | */ |
270 | panel_node = mdp4_detect_lcdc_panel(dev); | 271 | panel_node = mdp4_detect_lcdc_panel(dev); |
271 | if (IS_ERR_OR_NULL(panel_node)) | 272 | if (!panel_node) |
272 | return PTR_ERR(panel_node); | 273 | return 0; |
273 | 274 | ||
274 | encoder = mdp4_lcdc_encoder_init(dev, panel_node); | 275 | encoder = mdp4_lcdc_encoder_init(dev, panel_node); |
275 | if (IS_ERR(encoder)) { | 276 | if (IS_ERR(encoder)) { |
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c index bc3d8e719c6c..a06b064f86c1 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c | |||
@@ -93,7 +93,7 @@ static const struct drm_encoder_funcs mdp4_lcdc_encoder_funcs = { | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | /* this should probably be a helper: */ | 95 | /* this should probably be a helper: */ |
96 | struct drm_connector *get_connector(struct drm_encoder *encoder) | 96 | static struct drm_connector *get_connector(struct drm_encoder *encoder) |
97 | { | 97 | { |
98 | struct drm_device *dev = encoder->dev; | 98 | struct drm_device *dev = encoder->dev; |
99 | struct drm_connector *connector; | 99 | struct drm_connector *connector; |
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c index 7c9626d92019..3903dbcda763 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c | |||
@@ -81,7 +81,7 @@ static void mdp4_plane_install_properties(struct drm_plane *plane, | |||
81 | // XXX | 81 | // XXX |
82 | } | 82 | } |
83 | 83 | ||
84 | int mdp4_plane_set_property(struct drm_plane *plane, | 84 | static int mdp4_plane_set_property(struct drm_plane *plane, |
85 | struct drm_property *property, uint64_t val) | 85 | struct drm_property *property, uint64_t val) |
86 | { | 86 | { |
87 | // XXX | 87 | // XXX |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index ba8f43278a44..951c002b05df 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | |||
@@ -78,12 +78,12 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev, | |||
78 | if (!dev->mode_config.rotation_property) | 78 | if (!dev->mode_config.rotation_property) |
79 | dev->mode_config.rotation_property = | 79 | dev->mode_config.rotation_property = |
80 | drm_mode_create_rotation_property(dev, | 80 | drm_mode_create_rotation_property(dev, |
81 | DRM_REFLECT_X | DRM_REFLECT_Y); | 81 | DRM_ROTATE_0 | DRM_REFLECT_X | DRM_REFLECT_Y); |
82 | 82 | ||
83 | if (dev->mode_config.rotation_property) | 83 | if (dev->mode_config.rotation_property) |
84 | drm_object_attach_property(&plane->base, | 84 | drm_object_attach_property(&plane->base, |
85 | dev->mode_config.rotation_property, | 85 | dev->mode_config.rotation_property, |
86 | 0); | 86 | DRM_ROTATE_0); |
87 | } | 87 | } |
88 | 88 | ||
89 | /* helper to install properties which are common to planes and crtcs */ | 89 | /* helper to install properties which are common to planes and crtcs */ |
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 042bde48200d..fb5c0b0a7594 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c | |||
@@ -26,9 +26,10 @@ | |||
26 | * MSM driver version: | 26 | * MSM driver version: |
27 | * - 1.0.0 - initial interface | 27 | * - 1.0.0 - initial interface |
28 | * - 1.1.0 - adds madvise, and support for submits with > 4 cmd buffers | 28 | * - 1.1.0 - adds madvise, and support for submits with > 4 cmd buffers |
29 | * - 1.2.0 - adds explicit fence support for submit ioctl | ||
29 | */ | 30 | */ |
30 | #define MSM_VERSION_MAJOR 1 | 31 | #define MSM_VERSION_MAJOR 1 |
31 | #define MSM_VERSION_MINOR 1 | 32 | #define MSM_VERSION_MINOR 2 |
32 | #define MSM_VERSION_PATCHLEVEL 0 | 33 | #define MSM_VERSION_PATCHLEVEL 0 |
33 | 34 | ||
34 | static void msm_fb_output_poll_changed(struct drm_device *dev) | 35 | static void msm_fb_output_poll_changed(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 6cd4af443139..0a9b5580b2e9 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c | |||
@@ -584,18 +584,16 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) | |||
584 | { | 584 | { |
585 | struct msm_gem_object *msm_obj = to_msm_bo(obj); | 585 | struct msm_gem_object *msm_obj = to_msm_bo(obj); |
586 | bool write = !!(op & MSM_PREP_WRITE); | 586 | bool write = !!(op & MSM_PREP_WRITE); |
587 | 587 | unsigned long remain = | |
588 | if (op & MSM_PREP_NOSYNC) { | 588 | op & MSM_PREP_NOSYNC ? 0 : timeout_to_jiffies(timeout); |
589 | if (!reservation_object_test_signaled_rcu(msm_obj->resv, write)) | 589 | long ret; |
590 | return -EBUSY; | 590 | |
591 | } else { | 591 | ret = reservation_object_wait_timeout_rcu(msm_obj->resv, write, |
592 | int ret; | 592 | true, remain); |
593 | 593 | if (ret == 0) | |
594 | ret = reservation_object_wait_timeout_rcu(msm_obj->resv, write, | 594 | return remain == 0 ? -EBUSY : -ETIMEDOUT; |
595 | true, timeout_to_jiffies(timeout)); | 595 | else if (ret < 0) |
596 | if (ret <= 0) | 596 | return ret; |
597 | return ret == 0 ? -ETIMEDOUT : ret; | ||
598 | } | ||
599 | 597 | ||
600 | /* TODO cache maintenance */ | 598 | /* TODO cache maintenance */ |
601 | 599 | ||
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 9766f9ae4b7d..3ac14cd1e5b9 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/sync_file.h> | ||
19 | |||
18 | #include "msm_drv.h" | 20 | #include "msm_drv.h" |
19 | #include "msm_gpu.h" | 21 | #include "msm_gpu.h" |
20 | #include "msm_gem.h" | 22 | #include "msm_gem.h" |
@@ -361,6 +363,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, | |||
361 | struct msm_file_private *ctx = file->driver_priv; | 363 | struct msm_file_private *ctx = file->driver_priv; |
362 | struct msm_gem_submit *submit; | 364 | struct msm_gem_submit *submit; |
363 | struct msm_gpu *gpu = priv->gpu; | 365 | struct msm_gpu *gpu = priv->gpu; |
366 | struct fence *in_fence = NULL; | ||
367 | struct sync_file *sync_file = NULL; | ||
368 | int out_fence_fd = -1; | ||
364 | unsigned i; | 369 | unsigned i; |
365 | int ret; | 370 | int ret; |
366 | 371 | ||
@@ -370,13 +375,24 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, | |||
370 | /* for now, we just have 3d pipe.. eventually this would need to | 375 | /* for now, we just have 3d pipe.. eventually this would need to |
371 | * be more clever to dispatch to appropriate gpu module: | 376 | * be more clever to dispatch to appropriate gpu module: |
372 | */ | 377 | */ |
373 | if (args->pipe != MSM_PIPE_3D0) | 378 | if (MSM_PIPE_ID(args->flags) != MSM_PIPE_3D0) |
379 | return -EINVAL; | ||
380 | |||
381 | if (MSM_PIPE_FLAGS(args->flags) & ~MSM_SUBMIT_FLAGS) | ||
374 | return -EINVAL; | 382 | return -EINVAL; |
375 | 383 | ||
376 | ret = mutex_lock_interruptible(&dev->struct_mutex); | 384 | ret = mutex_lock_interruptible(&dev->struct_mutex); |
377 | if (ret) | 385 | if (ret) |
378 | return ret; | 386 | return ret; |
379 | 387 | ||
388 | if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) { | ||
389 | out_fence_fd = get_unused_fd_flags(O_CLOEXEC); | ||
390 | if (out_fence_fd < 0) { | ||
391 | ret = out_fence_fd; | ||
392 | goto out_unlock; | ||
393 | } | ||
394 | } | ||
395 | |||
380 | submit = submit_create(dev, gpu, args->nr_bos, args->nr_cmds); | 396 | submit = submit_create(dev, gpu, args->nr_bos, args->nr_cmds); |
381 | if (!submit) { | 397 | if (!submit) { |
382 | ret = -ENOMEM; | 398 | ret = -ENOMEM; |
@@ -391,9 +407,32 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, | |||
391 | if (ret) | 407 | if (ret) |
392 | goto out; | 408 | goto out; |
393 | 409 | ||
394 | ret = submit_fence_sync(submit); | 410 | if (args->flags & MSM_SUBMIT_FENCE_FD_IN) { |
395 | if (ret) | 411 | in_fence = sync_file_get_fence(args->fence_fd); |
396 | goto out; | 412 | |
413 | if (!in_fence) { | ||
414 | ret = -EINVAL; | ||
415 | goto out; | ||
416 | } | ||
417 | |||
418 | /* TODO if we get an array-fence due to userspace merging multiple | ||
419 | * fences, we need a way to determine if all the backing fences | ||
420 | * are from our own context.. | ||
421 | */ | ||
422 | |||
423 | if (in_fence->context != gpu->fctx->context) { | ||
424 | ret = fence_wait(in_fence, true); | ||
425 | if (ret) | ||
426 | goto out; | ||
427 | } | ||
428 | |||
429 | } | ||
430 | |||
431 | if (!(args->fence & MSM_SUBMIT_NO_IMPLICIT)) { | ||
432 | ret = submit_fence_sync(submit); | ||
433 | if (ret) | ||
434 | goto out; | ||
435 | } | ||
397 | 436 | ||
398 | ret = submit_pin_objects(submit); | 437 | ret = submit_pin_objects(submit); |
399 | if (ret) | 438 | if (ret) |
@@ -459,15 +498,39 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, | |||
459 | 498 | ||
460 | submit->nr_cmds = i; | 499 | submit->nr_cmds = i; |
461 | 500 | ||
462 | ret = msm_gpu_submit(gpu, submit, ctx); | 501 | submit->fence = msm_fence_alloc(gpu->fctx); |
502 | if (IS_ERR(submit->fence)) { | ||
503 | ret = PTR_ERR(submit->fence); | ||
504 | submit->fence = NULL; | ||
505 | goto out; | ||
506 | } | ||
507 | |||
508 | if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) { | ||
509 | sync_file = sync_file_create(submit->fence); | ||
510 | if (!sync_file) { | ||
511 | ret = -ENOMEM; | ||
512 | goto out; | ||
513 | } | ||
514 | } | ||
515 | |||
516 | msm_gpu_submit(gpu, submit, ctx); | ||
463 | 517 | ||
464 | args->fence = submit->fence->seqno; | 518 | args->fence = submit->fence->seqno; |
465 | 519 | ||
520 | if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) { | ||
521 | fd_install(out_fence_fd, sync_file->file); | ||
522 | args->fence_fd = out_fence_fd; | ||
523 | } | ||
524 | |||
466 | out: | 525 | out: |
526 | if (in_fence) | ||
527 | fence_put(in_fence); | ||
467 | submit_cleanup(submit); | 528 | submit_cleanup(submit); |
468 | if (ret) | 529 | if (ret) |
469 | msm_gem_submit_free(submit); | 530 | msm_gem_submit_free(submit); |
470 | out_unlock: | 531 | out_unlock: |
532 | if (ret && (out_fence_fd >= 0)) | ||
533 | put_unused_fd(out_fence_fd); | ||
471 | mutex_unlock(&dev->struct_mutex); | 534 | mutex_unlock(&dev->struct_mutex); |
472 | return ret; | 535 | return ret; |
473 | } | 536 | } |
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 36ed53e661fe..5bb09838b5ae 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c | |||
@@ -509,22 +509,15 @@ void msm_gpu_retire(struct msm_gpu *gpu) | |||
509 | } | 509 | } |
510 | 510 | ||
511 | /* add bo's to gpu's ring, and kick gpu: */ | 511 | /* add bo's to gpu's ring, and kick gpu: */ |
512 | int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, | 512 | void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, |
513 | struct msm_file_private *ctx) | 513 | struct msm_file_private *ctx) |
514 | { | 514 | { |
515 | struct drm_device *dev = gpu->dev; | 515 | struct drm_device *dev = gpu->dev; |
516 | struct msm_drm_private *priv = dev->dev_private; | 516 | struct msm_drm_private *priv = dev->dev_private; |
517 | int i, ret; | 517 | int i; |
518 | 518 | ||
519 | WARN_ON(!mutex_is_locked(&dev->struct_mutex)); | 519 | WARN_ON(!mutex_is_locked(&dev->struct_mutex)); |
520 | 520 | ||
521 | submit->fence = msm_fence_alloc(gpu->fctx); | ||
522 | if (IS_ERR(submit->fence)) { | ||
523 | ret = PTR_ERR(submit->fence); | ||
524 | submit->fence = NULL; | ||
525 | return ret; | ||
526 | } | ||
527 | |||
528 | inactive_cancel(gpu); | 521 | inactive_cancel(gpu); |
529 | 522 | ||
530 | list_add_tail(&submit->node, &gpu->submit_list); | 523 | list_add_tail(&submit->node, &gpu->submit_list); |
@@ -557,8 +550,6 @@ int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, | |||
557 | priv->lastctx = ctx; | 550 | priv->lastctx = ctx; |
558 | 551 | ||
559 | hangcheck_timer_reset(gpu); | 552 | hangcheck_timer_reset(gpu); |
560 | |||
561 | return 0; | ||
562 | } | 553 | } |
563 | 554 | ||
564 | /* | 555 | /* |
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h index c9022837a1a4..d61d98a6e047 100644 --- a/drivers/gpu/drm/msm/msm_gpu.h +++ b/drivers/gpu/drm/msm/msm_gpu.h | |||
@@ -163,7 +163,7 @@ int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime, | |||
163 | uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs); | 163 | uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs); |
164 | 164 | ||
165 | void msm_gpu_retire(struct msm_gpu *gpu); | 165 | void msm_gpu_retire(struct msm_gpu *gpu); |
166 | int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, | 166 | void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, |
167 | struct msm_file_private *ctx); | 167 | struct msm_file_private *ctx); |
168 | 168 | ||
169 | int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, | 169 | int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, |