Bug 97519 - [BSW HSW] gem_userptr_blits forbidden-operations fails
Summary: [BSW HSW] gem_userptr_blits forbidden-operations fails
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Luis Botello
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-28 20:10 UTC by Luis Botello
Modified: 2016-10-04 06:59 UTC (History)
1 user (show)

See Also:
i915 platform: BSW/CHT, HSW
i915 features: display/Other


Attachments
HSW__gem_userptr_blits__forbidden-operations__kern.log (247.65 KB, text/plain)
2016-09-26 14:06 UTC, cprigent
no flags Details
HSW__gem_userptr_blits__forbidden-operations__output (1.20 KB, text/plain)
2016-09-26 14:06 UTC, cprigent
no flags Details

Description Luis Botello 2016-08-28 20:10:51 UTC
Description:
=============================================
gem_userptr_blits subtest forbidden-operations fails

Steps to reproduce:
=============================================
#./gem_userptr_blits --run-subtest forbidden-operations

Software Configuration:
============================================
Kernel: 4.8.0-rc3 gb0658ce  from http://cgit.freedesktop.org/drm-intel/
libdrm-2.4.70-2 b214b05 from git://anongit.freedesktop.org/mesa/drm
mesa: mesa-11.2.2 3a9f628from git://anongit.freedesktop.org/mesa/mesa
cairo 1.15.2 db8a7f1 from git://anongit.freedesktop.org/cairo
xorg-server-1.18.0- 532 6e5bec2 from git://git.freedesktop.org/git/xorg/xserver
xf86-video-intel 2.99.697 12c14de from git://git.freedesktop.org/git/xorg/driver/xf86-video-intel
libva-1.7.0-45 b27feb9 from git://git.freedesktop.org/git/vaapi/libva 
vaapi-intel-driver: 1.7.0-89 b53fad9 from git://git.freedesktop.org/git/vaapi/intel-driver
Intel-Gpu-Tools 1.15 a147ef2 from http://anongit.freedesktop.org/git/xorg/app/intel-gpu-tools.git

Hardware Configuration:
=============================================
Hardware: Acer Desktop
Motherboard: Aspire XC-704
CPU: Intel(R) Pentium(R) CPU N3700 @ 1.60GHz (Family 6, Model 76, Stepping 3)
GPU:  Intel® HD Graphics - Intel Corporation Device 22b1 (rev 21)
Memory card: 1 card 4GB Hynix HMT451S6BFR8APB
HDD: Western Digital WDC WD10EZEX-21M (1TB)

Software:
Bios: R01-A2
Linux distribution: Ubuntu 16.04 64 bits

IGT output
==================================================
IGT-Version: 1.15-gb0658ce (x86_64) (Linux: 4.8.0-rc3-nightly+ x86_64)
(gem_userptr_blits:7571) drmtest-DEBUG: Test requirement passed: !(fd<0)
(gem_userptr_blits:7571) ioctl-wrappers-DEBUG: Test requirement passed: !(ret == ENODEV && (flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED) == 0 && !read_only)
(gem_userptr_blits:7571) DEBUG: Test requirement passed: !(ret == 0)
Aperture size is 4096 MiB
Total RAM is 3,739 MiB
(gem_userptr_blits:7571) igt-core-DEBUG: Starting subtest: forbidden-operations
(gem_userptr_blits:7571) ioctl-wrappers-DEBUG: Test requirement passed: !(ret == ENODEV && (flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED) == 0 && !read_only)
(gem_userptr_blits:7571) CRITICAL: Test assertion failure function test_forbidden_ops, file gem_userptr_blits.c:606:
(gem_userptr_blits:7571) CRITICAL: Failed assertion: ret == 0 || errno == EINVAL
(gem_userptr_blits:7571) CRITICAL: Last errno: 14, Bad address
Stack trace:
  #0 [__igt_fail_assert+0xf1]
  #1 [main+0x1f13]
  #2 [__libc_start_main+0xf0]
  #3 [_start+0x29]
  #4 [<unknown>+0x29]
Subtest forbidden-operations failed.
**** DEBUG ****
(gem_userptr_blits:7571) ioctl-wrappers-DEBUG: Test requirement passed: !(ret == ENODEV && (flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED) == 0 && !read_only)
(gem_userptr_blits:7571) CRITICAL: Test assertion failure function test_forbidden_ops, file gem_userptr_blits.c:606:
(gem_userptr_blits:7571) CRITICAL: Failed assertion: ret == 0 || errno == EINVAL
(gem_userptr_blits:7571) CRITICAL: Last errno: 14, Bad address
****  END  ****
Subtest forbidden-operations: FAIL (0.007s)
Testing unsynchronized mappings...
Testing synchronized mappings...
(gem_userptr_blits:7571) igt-core-DEBUG: Exiting with status code 99

dmesg
============================================================
[  368.252489] gem_userptr_blits: executing
[  368.253008] [drm:i915_gem_open]
[  368.253257] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.253267] [drm:i915_pages_create_for_stolen] offset=0x7fb000, size=16384
[  368.254232] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.254238] [drm:i915_pages_create_for_stolen] offset=0x7ff000, size=16384
[  368.254658] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.254664] [drm:i915_pages_create_for_stolen] offset=0x803000, size=16384
[  368.254869] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.254875] [drm:i915_pages_create_for_stolen] offset=0x807000, size=16384
[  368.256574] [drm:i915_gem_open]
[  368.256837] gem_userptr_blits: starting subtest forbidden-operations
[  368.263213] gem_userptr_blits: exiting, ret=99
[  368.263760] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.263769] [drm:i915_pages_create_for_stolen] offset=0x80b000, size=16384
[  368.264788] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.264806] [drm:i915_pages_create_for_stolen] offset=0x80f000, size=16384
[  368.265686] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.265696] [drm:i915_pages_create_for_stolen] offset=0x813000, size=16384
[  368.266069] [drm:i915_gem_object_create_stolen] creating stolen object: size=4000
[  368.266075] [drm:i915_pages_create_for_stolen] offset=0x817000, size=16384
Comment 1 cprigent 2016-09-26 14:06:02 UTC
Created attachment 126787 [details]
HSW__gem_userptr_blits__forbidden-operations__kern.log

HSW logs attached

Platform: Dell Inc. OptiPlex 9020
CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (Family 6, Model 60, Stepping 3)
Motherboard: 0DNKMN
GPU: Intel® HD Graphics 4600 / Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller

Software
Bios: A07
Linux distribution: Ubuntu 16.04 64 bits
Kernel: 4.8.0-rc7 0e34cb5 from http://cgit.freedesktop.org/drm-intel/
commit 0e34cb5b35f0f837219495c402073141481b1b90
  Author: Jani Nikula <jani.nikula@intel.com>
  Date:   Mon Sep 19 18:39:27 2016 +0300
  drm-intel-nightly: 2016y-09m-19d-15h-38m-53s UTC integration manifest
libdrm-2.4.70-14 0659558 from git://anongit.freedesktop.org/mesa/drm
mesa: mesa-12.0.0 8b06176 from git://anongit.freedesktop.org/mesa/mesa
cairo 1.15.2 db8a7f1 from git://anongit.freedesktop.org/cairo
xorg-server-1.18.99-2 3ef51c5 from git://git.freedesktop.org/git/xorg/xserver
xf86-video-intel 2.99.917-703 15c5ff1 from git://git.freedesktop.org/git/xorg/driver/xf86-video-intel
libva-1.7.0-50 7aa2dd9 from git://git.freedesktop.org/git/vaapi/libva 
vaapi-intel-driver: 1.7.0-136 36fbd81 from git://git.freedesktop.org/git/vaapi/intel-driver
IGT: intel-gpu-tools-1.16-22 200237a from http://anongit.freedesktop.org/git/xorg/app/intel-gpu-tools.git
External screen: DELL E1912Hf
Comment 2 cprigent 2016-09-26 14:06:20 UTC
Created attachment 126788 [details]
HSW__gem_userptr_blits__forbidden-operations__output
Comment 3 yann 2016-10-03 06:14:11 UTC
Please re-test with Chris' patch : https://patchwork.freedesktop.org/series/13167/
Comment 4 Chris Wilson 2016-10-03 20:50:33 UTC
commit 5f12b80a0b42da253691ca03828033014bb786eb
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Oct 3 13:45:15 2016 +0100

    drm/i915: Unalias obj->phys_handle and obj->userptr
    
    We use obj->phys_handle to choose the pread/pwrite path, but as
    obj->phys_handle is a union with obj->userptr, we then mistakenly use
    the phys_handle path for userptr objects within pread/pwrite.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.