Hi,
I'm currently trying to mmap the memory of an OpenGL texture I've
created by
doing the following:
std::vector<EGLint> image_attribs = {
EGL_WIDTH, static_cast<int>(m_texWidth & 0x7FFFFFFF),
EGL_HEIGHT, static_cast<int>(m_texHeight & 0x7FFFFFFF),
EGL_DRM_BUFFER_USE_MESA, EGL_DRM_BUFFER_USE_SCANOUT_MESA,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA
EGL_NONE
};
glGenTextures(…
[View More] 1, &texID );
glBindTexture( GL_TEXTURE_2D, texID );
eglImage = eglCreateDRMImageMESA( eglGetCurrentDisplay(),
&image_attribs[0] );
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglmage);
eglExportDMABUFImageQueryMESA(eglGetCurrentDisplay(), eglImage, &fourcc,
&nplanes, &modifiers)
eglExportDMABUFImageMESA(eglGetCurrentDisplay(), eglImage, &fd, strides,
offsets)
struct dma_buf_sync sync_args = { .flags = DMA_BUF_SYNC_START };
ioctl( fd, DMA_BUF_IOCTL_SYNC, sync_args);
mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
For some reason mmap returns MAP_FAILED when using the PROT_WRITE flag,
while
using only PROT_READ seems to be fine. I'm currently using kernel 4.9.6
on an Intel CherryTrail (i915).
Is there an obvious reason why I'm not able to mmap the texture FD with
PROT_WRITE flags?
Reading https://01.org/blogs/2016/sharing-cpu-and-gpu-buffers-linux I
would have guessed that
this should be possible. Or is it only true for specific GEM buffers not
textures created using
eglCreateDRMImageMESA?
Regards,
Volker
[View Less]
tree: git://anongit.freedesktop.org/drm-intel drm-intel-nightly
head: 0f01216949002d20b9dc6d300c82df5ffa59e9a7
commit: e4563f6ba71792c77aeccb2092cc23149b44e642 [1076/1086] drm: Rely on mode_config data for fb_helper initialization
config: i386-randconfig-x0-02030244 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout e4563f6ba71792c77aeccb2092cc23149b44e642
# save the attached .config to linux build tree
make ARCH=i386
Note:…
[View More] the drm-intel/drm-intel-nightly HEAD 0f01216949002d20b9dc6d300c82df5ffa59e9a7 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
drivers/gpu/drm/gma500/framebuffer.c: In function 'psb_fbdev_init':
>> drivers/gpu/drm/gma500/framebuffer.c:566:8: error: too few arguments to function 'drm_fb_helper_init'
ret = drm_fb_helper_init(dev, &fbdev->psb_fb_helper,
^~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/gma500/framebuffer.c:35:0:
include/drm/drm_fb_helper.h:309:19: note: declared here
static inline int drm_fb_helper_init(struct drm_device *dev,
^~~~~~~~~~~~~~~~~~
--
drivers/gpu/drm/qxl/qxl_fb.c: In function 'qxl_fbdev_init':
>> drivers/gpu/drm/qxl/qxl_fb.c:401:8: error: too few arguments to function 'drm_fb_helper_init'
ret = drm_fb_helper_init(&qdev->ddev, &qfbdev->helper,
^~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/qxl/qxl_fb.c:35:0:
include/drm/drm_fb_helper.h:309:19: note: declared here
static inline int drm_fb_helper_init(struct drm_device *dev,
^~~~~~~~~~~~~~~~~~
vim +/drm_fb_helper_init +566 drivers/gpu/drm/gma500/framebuffer.c
4d8d096e9 Alan Cox 2011-11-03 560 }
4d8d096e9 Alan Cox 2011-11-03 561
4d8d096e9 Alan Cox 2011-11-03 562 dev_priv->fbdev = fbdev;
10a231026 Thierry Reding 2014-06-27 563
10a231026 Thierry Reding 2014-06-27 564 drm_fb_helper_prepare(dev, &fbdev->psb_fb_helper, &psb_fb_helper_funcs);
4d8d096e9 Alan Cox 2011-11-03 565
01934c2a6 Thierry Reding 2014-12-19 @566 ret = drm_fb_helper_init(dev, &fbdev->psb_fb_helper,
e4563f6ba Gabriel Krisman Bertazi 2017-02-02 567 INTELFB_CONN_LIMIT);
01934c2a6 Thierry Reding 2014-12-19 568 if (ret)
01934c2a6 Thierry Reding 2014-12-19 569 goto free;
:::::: The code at line 566 was first introduced by commit
:::::: 01934c2a691882185b3021d437df13bcba07711d drm/fb-helper: Propagate errors from initial config failure
:::::: TO: Thierry Reding <treding(a)nvidia.com>
:::::: CC: Daniel Vetter <daniel.vetter(a)ffwll.ch>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[View Less]
tree: git://anongit.freedesktop.org/drm/drm-tip drm-tip
head: 36aab92fa2091dd54ea983752aa40e427e83d113
commit: e4563f6ba71792c77aeccb2092cc23149b44e642 [1066/1073] drm: Rely on mode_config data for fb_helper initialization
config: i386-randconfig-x007-201705 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout e4563f6ba71792c77aeccb2092cc23149b44e642
# save the attached .config to linux build tree
make ARCH=i386
All errors (…
[View More]new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c: In function 'amdgpu_fbdev_init':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c:376:8: error: too few arguments to function 'drm_fb_helper_init'
ret = drm_fb_helper_init(adev->ddev, &rfbdev->helper,
^~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h:39:0,
from drivers/gpu/drm/amd/amdgpu/amdgpu.h:50,
from drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c:34:
include/drm/drm_fb_helper.h:309:19: note: declared here
static inline int drm_fb_helper_init(struct drm_device *dev,
^~~~~~~~~~~~~~~~~~
vim +/drm_fb_helper_init +376 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
d38ceaf9 Alex Deucher 2015-04-20 370 rfbdev->adev = adev;
d38ceaf9 Alex Deucher 2015-04-20 371 adev->mode_info.rfbdev = rfbdev;
d38ceaf9 Alex Deucher 2015-04-20 372
d38ceaf9 Alex Deucher 2015-04-20 373 drm_fb_helper_prepare(adev->ddev, &rfbdev->helper,
d38ceaf9 Alex Deucher 2015-04-20 374 &amdgpu_fb_helper_funcs);
d38ceaf9 Alex Deucher 2015-04-20 375
d38ceaf9 Alex Deucher 2015-04-20 @376 ret = drm_fb_helper_init(adev->ddev, &rfbdev->helper,
d38ceaf9 Alex Deucher 2015-04-20 377 AMDGPUFB_CONN_LIMIT);
d38ceaf9 Alex Deucher 2015-04-20 378 if (ret) {
d38ceaf9 Alex Deucher 2015-04-20 379 kfree(rfbdev);
:::::: The code at line 376 was first introduced by commit
:::::: d38ceaf99ed015f2a0b9af3499791bd3a3daae21 drm/amdgpu: add core driver (v4)
:::::: TO: Alex Deucher <alexander.deucher(a)amd.com>
:::::: CC: Alex Deucher <alexander.deucher(a)amd.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[View Less]
Hi Dave,
Just a couple of small fixes for 4.10
The following changes since commit 52b679f60e2a68af88411f12318675a2424a0e14:
Merge tag 'drm-misc-fixes-2017-01-31' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes (2017-02-01 08:45:27 +1000)
are available in the git repository at:
git://people.freedesktop.org/~agd5f/linux drm-fixes-4.10
for you to fetch changes up to 51964e9e12d0a054002a1a0d1dec4f661c7aaf28:
drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO …
[View More]ioctl (2017-02-02 11:14:09 -0500)
----------------------------------------------------------------
Alex Deucher (1):
drm/amdgpu/si: fix crash on headless asics
Michel Dänzer (1):
drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO ioctl
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 4 +++-
drivers/gpu/drm/radeon/radeon_drv.c | 3 ++-
drivers/gpu/drm/radeon/radeon_gem.c | 4 ++--
3 files changed, 7 insertions(+), 4 deletions(-)
[View Less]
This series is a folow-up on
https://patchwork.kernel.org/patch/9501787/
The first patch makes changes to atomic helpers to allow for drives with ASYNC flip support to use them.
Patch 2 is to use this in AMDGPU/DC.
Patch 3 is possible cleanup in nouveau/kms who seems to have to duplicate the helper as we did to support ASYNC flips.
v2:
Resend drm/atomic: Save flip flags in drm_plane_state since the original patch was incomplete.
Squash 2 AMD changes into one to not break compilation.
v3:
…
[View More]Following Daniel's comments, save flip flags in crtc_state instead of plane_state.
v4:
Lauren's comment, reset flp flags before using again.
Harry's comment, fix identation in amd/display.
Andrey Grodzovsky (3):
drm/atomic: Save flip flags in drm_crtct_state
drm/nouveau/kms/nv50: Switch to using atomic helper for flip.
drm/amd/display: Switch to using atomic_helper for flip.
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 -
.../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 113 +++++----------------
drivers/gpu/drm/drm_atomic_helper.c | 20 ++--
drivers/gpu/drm/nouveau/nv50_display.c | 84 ++-------------
include/drm/drm_crtc.h | 9 +-
include/drm/drm_plane.h | 1 +
6 files changed, 49 insertions(+), 179 deletions(-)
--
1.9.1
[View Less]
Scheduling the output_poll_work before calling bind_all to create the
crtcs can race the fbdev initialization with the components
initialization (i.e. crtc initialization). One side effect is that we
may call drm_fbdev_cma_init with a zeroed num_crtc value, crashing the
fbdev allocation.
I found this while auditing the code to remove the crtc_count parameter
from drm_fbdev_cma_init. I don't have the hardware to actually test
this change, so it'd be better covered if someone can give a try.
…
[View More]Although, every other driver I checked did this on a later phase of
initialization.
Signed-off-by: Gabriel Krisman Bertazi <krisman(a)collabora.co.uk>
Cc: Benjamin Gaignard <benjamin.gaignard(a)linaro.org>
Cc: Vincent Abriou <vincent.abriou(a)st.com>
---
drivers/gpu/drm/sti/sti_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index d3db22488f96..516296010735 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -323,8 +323,6 @@ static int sti_init(struct drm_device *ddev)
sti_mode_config_init(ddev);
- drm_kms_helper_poll_init(ddev);
-
return 0;
}
@@ -362,6 +360,8 @@ static int sti_bind(struct device *dev)
if (ret)
goto err_cleanup;
+ drm_kms_helper_poll_init(ddev);
+
ret = drm_dev_register(ddev, 0);
if (ret)
goto err_register;
--
2.11.0
[View Less]
Hi Dave, here's Maarten's backport of the vma fixes for v4.10.
BR,
Jani.
The following changes since commit 566cf877a1fcb6d6dc0126b076aad062054c2637:
Linux 4.10-rc6 (2017-01-29 14:25:17 -0800)
are available in the git repository at:
git://anongit.freedesktop.org/git/drm-intel tags/topic/vma-fix-for-4.10-2017-02-02
for you to fetch changes up to e8fe4f4b2b7b93048729538321c681c0cff33b39:
drm/i915: Track pinned vma in intel_plane_state (2017-02-01 11:45:21 +0200)
---------------------…
[View More]-------------------------------------------
Chris Wilson (1):
drm/i915: Track pinned vma in intel_plane_state
Maarten Lankhorst (1):
drm/atomic: Unconditionally call prepare_fb.
drivers/gpu/drm/drm_atomic_helper.c | 9 ---
drivers/gpu/drm/i915/i915_drv.h | 16 +---
drivers/gpu/drm/i915/intel_atomic_plane.c | 20 +++++
drivers/gpu/drm/i915/intel_display.c | 125 ++++++++++--------------------
drivers/gpu/drm/i915/intel_drv.h | 9 ++-
drivers/gpu/drm/i915/intel_fbc.c | 52 +++++--------
drivers/gpu/drm/i915/intel_fbdev.c | 4 +-
drivers/gpu/drm/i915/intel_sprite.c | 8 +-
8 files changed, 99 insertions(+), 144 deletions(-)
--
Jani Nikula, Intel Open Source Technology Center
[View Less]
Commit 920cf4194954ec ("drm/i915: Introduce an internal allocator for
disposable private objects") introduced a regression for the kernel
running as Xen dom0: when switching to graphics mode a GPU HANG
occurred.
Reason seems to be a missing adaption similar to that done in
commit 7453c549f5f648 ("swiotlb: Export swiotlb_max_segment to users")
to i915_gem_object_get_pages_internal().
So limit the maximum page order to be used according to the maximum
swiotlb segment size instead to the …
[View More]complete swiotlb size.
Signed-off-by: Juergen Gross <jgross(a)suse.com>
---
Please consider for 4.10 as otherwise 4.10 will be unusable as Xen dom0
with i915 graphics.
---
drivers/gpu/drm/i915/i915_gem_internal.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_internal.c b/drivers/gpu/drm/i915/i915_gem_internal.c
index 4b3ff3e..d09c749 100644
--- a/drivers/gpu/drm/i915/i915_gem_internal.c
+++ b/drivers/gpu/drm/i915/i915_gem_internal.c
@@ -66,8 +66,16 @@ i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)
max_order = MAX_ORDER;
#ifdef CONFIG_SWIOTLB
- if (swiotlb_nr_tbl()) /* minimum max swiotlb size is IO_TLB_SEGSIZE */
- max_order = min(max_order, ilog2(IO_TLB_SEGPAGES));
+ if (swiotlb_nr_tbl()) {
+ unsigned int max_segment;
+
+ max_segment = swiotlb_max_segment();
+ if (max_segment) {
+ max_segment = max_t(unsigned int, max_segment,
+ PAGE_SIZE) >> PAGE_SHIFT;
+ max_order = min(max_order, ilog2(max_segment));
+ }
+ }
#endif
gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE;
--
2.10.2
[View Less]