After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768446 - kmssink: on intel, stride must be 64 byte aligned
kmssink: on intel, stride must be 64 byte aligned
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.9.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-05 14:10 UTC by Víctor Manuel Jáquez Leal
Modified: 2016-10-31 14:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
kmssink: override stride if defined in driver (1.82 KB, patch)
2016-08-05 16:49 UTC, Víctor Manuel Jáquez Leal
none Details | Review
kmssink: override stride if defined in driver (2.03 KB, patch)
2016-08-05 17:26 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2016-07-05 14:10:40 UTC
While testing kmssink in i965, I have found, when trying to negotiate a video with format YUY2 720x576 the addfb2 failed with an "Invalid argument"

Debugging the kernel, found this message:

kernel: [drm:intel_framebuffer_init] pitch (1440) must be at least 64 byte aligned
kernel: [drm:internal_framebuffer_create] could not create framebuffer
kernel: [drm:drm_ioctl] ret = -22

My first approach is to have two infos, one with the original video info, and a second, used to allocate, with the aligned stride.

Is it a good approach? Would it work in other platforms?
Comment 1 Nicolas Dufresne (ndufresne) 2016-07-05 15:27:02 UTC
Would it be possible to clarify who picked this stride ? Ideally, their should be a kernel API that provides the requires stride for a certain width. If we instead get the alignment info, we can use GstVideoAlignement + gst_video_info_align() to calculate the required stride. gst_video_frame_copy() is safe for when you can't match the buffer stride with requirement. It will handle copied with different strides.
Comment 2 Víctor Manuel Jáquez Leal 2016-07-05 19:22:49 UTC
(In reply to Nicolas Dufresne (stormer) from comment #1)
> Would it be possible to clarify who picked this stride ? 

GstVideoInfo generate that value.

AddFB2 is called in the gstkmsallocator and the stride/pitch is set with 

pitches[i] = GST_VIDEO_INFO_PLANE_STRIDE (vinfo, i); 

https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/kms/gstkmsallocator.c#n327

> Ideally, their
> should be a kernel API that provides the requires stride for a certain
> width. 

Are you saying that we should not fill that value?? 

> If we instead get the alignment info, we can use GstVideoAlignement +
> gst_video_info_align() to calculate the required stride.
> gst_video_frame_copy() is safe for when you can't match the buffer stride
> with requirement. It will handle copied with different strides.
Comment 3 Nicolas Dufresne (ndufresne) 2016-07-05 19:58:52 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #2)
> > Ideally, their
> > should be a kernel API that provides the requires stride for a certain
> > width. 
> 
> Are you saying that we should not fill that value?? 
> 

I'm saying the kernel should provide the information needed to fill this value, or this value directly.
Comment 4 Víctor Manuel Jáquez Leal 2016-08-05 16:49:07 UTC
Created attachment 332810 [details] [review]
kmssink: override stride if defined in driver

Some kms drivers demands specific pitches over the ones calculated by
GstVideoInfo. For example, intel driver demands strides round up 64.

This patch queries the driver for the prefered pitch and overwrites it
in the pool's GstVideoInfo structure.
Comment 5 Víctor Manuel Jáquez Leal 2016-08-05 16:50:25 UTC
I haven't tested the patch on any other non-intel platform. I anyone can test it, I'll appreciate it.
Comment 6 Víctor Manuel Jáquez Leal 2016-08-05 17:26:39 UTC
Created attachment 332811 [details] [review]
kmssink: override stride if defined in driver

Some kms drivers demands specific pitches over the ones calculated by
GstVideoInfo. For example, intel driver demands strides round up 64.

This patch queries the driver for the prefered pitch and overwrites it
in the pool's GstVideoInfo structure.
Comment 7 Nicolas Dufresne (ndufresne) 2016-09-06 19:07:43 UTC
Review of attachment 332811 [details] [review]:

I haven't tested on any hardware, but from reading the patch it makes sense.
Comment 8 Víctor Manuel Jáquez Leal 2016-09-07 14:21:20 UTC
Attachment 332811 [details] pushed as c117165 - kmssink: override stride if defined in driver