<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Emil,<br>
<br>
thanks for the feedback. The patch was not meant to be submitted<br>
officially. I'm aware that extending official<br>
EGL extensions is not allowed. It was just for showing what I have <br>
changed to get 10bit FBOs exported from Mesa, otherwise it would <br>
probably not possible to have a render buffer with 10bit used in <br>
the DRM/KMS infrastructure at all. My problem is also not the <br>
10bit part in Mesa. So rendering is working and the output buffer <br>
seems to have 10bits used. My problem is how to present that buffer
<br>
via the hardware display output connector. And I thought this has
more<br>
to do with libdrm as with Mesa. <br>
I wonder if it is possible to have drmModeAddFB2 to handle<br>
'X', 'R', '3', '0' at all. So is this supported in any way?<br>
In this case it may be enough to<br>
patch intel_image_formats to support __DRI_IMAGE_FORMAT_XRGB2101010<br>
by adding __DRI_IMAGE_FOURCC_XRGB2101010 like this:<br>
<br>
---<br>
include/GL/internal/dri_interface.h | 1 +<br>
src/mesa/drivers/dri/i915/intel_screen.c | 3 +++<br>
2 files changed, 4 insertions(+)<br>
<br>
diff --git a/include/GL/internal/dri_interface.h
b/include/GL/internal/dri_interface.h<br>
index 86efd1b..8a92823 100644<br>
--- a/include/GL/internal/dri_interface.h<br>
+++ b/include/GL/internal/dri_interface.h<br>
@@ -1202,6 +1202,7 @@ struct __DRIdri2ExtensionRec {<br>
#define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241<br>
#define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258<br>
#define __DRI_IMAGE_FOURCC_SARGB8888 0x83324258<br>
+#define __DRI_IMAGE_FOURCC_XRGB2101010 0x30335258<br>
#define __DRI_IMAGE_FOURCC_YUV410 0x39565559<br>
#define __DRI_IMAGE_FOURCC_YUV411 0x31315559<br>
#define __DRI_IMAGE_FOURCC_YUV420 0x32315559<br>
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c
b/src/mesa/drivers/dri/i915/intel_screen.c<br>
index 7e17e95..b25f063 100644<br>
--- a/src/mesa/drivers/dri/i915/intel_screen.c<br>
+++ b/src/mesa/drivers/dri/i915/intel_screen.c<br>
@@ -194,6 +194,9 @@ static struct intel_image_format
intel_image_formats[] = {<br>
{ __DRI_IMAGE_FOURCC_XRGB8888, __DRI_IMAGE_COMPONENTS_RGB, 1,<br>
{ { 0, 0, 0, __DRI_IMAGE_FORMAT_XRGB8888, 4 }, } },<br>
<br>
+ { __DRI_IMAGE_FOURCC_XRGB2101010, __DRI_IMAGE_COMPONENTS_RGB, 1,<br>
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_XRGB2101010, 4 }, } },<br>
+<br>
{ __DRI_IMAGE_FOURCC_YUV410, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,<br>
{ { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },<br>
{ 1, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 },<br>
-- <br>
<br>
<br>
BTW. Maybe I should mention what hardware and software I'm using:<br>
<br>
Intel Apollo Lake with Kernel 4.9.4 and Mesa 17.1.0.<br>
<br>
<br>
On 24.07.2017 15:43, Emil Velikov wrote:<br>
<span style="white-space: pre-wrap; display: block; width: 98vw;">> [dropping dri-devel, adding mesa-dev]
>
> Hi Volker,
>
> Thanks for giving this a stab.
>
> Mesa it has it's own mailing list, take a look at the instruction for
> more details [1].
>
> On 24 July 2017 at 13:34, Volker Vogelhuber
> <a class="moz-txt-link-rfc2396E" href="mailto:v.vogelhuber@digitalendoscopy.de"><v.vogelhuber@digitalendoscopy.de></a> wrote:
>> I have implemented a display manager application that takes DMB-BUF FDs
>> from another process and presents them to a connected output display
>> using the KMS infrastructure (drmModeAddFB, etc.). So far this works
>> without problems for XRGB8888. Now I wanted to have 10bit color depth
>> per channel. I created a FBO with 10bit (by patching the mesa and ex-
>> ported it's texture as a file descriptor via eglExportDMABUFImageMESA,
>> see attached patch).
>> When I try to import that file descriptor via gbm_bo_import it fails
>> because in gbm_bo_import, createImageFromFds is called which compares
>> the format passed to gbm_bo_import with intel_image_formats. But this
>> array does not seem to support 10bit formats. Now I wonder how one
>> could output 10bit per color channel to an output connector?
>>
>>
>> ---
>> include/EGL/eglext.h | 4 ++++
>> src/egl/drivers/dri2/egl_dri2.c | 26 +++++++++++++++++++++++++-
>> src/gbm/backends/dri/gbm_dri.c | 3 +++
>> src/mesa/drivers/dri/i965/intel_screen.c | 2 ++
>> 4 files changed, 34 insertions(+), 1 deletion(-)
>>
> The patch seems to extend(?) existing EGL extension which, I believe,
> is not allowed.
>
> It also adds implementations in EGL, GBM and the i965 driver.
> Ideally these would be separate patches, or at least the i965 vs rest.
>
> Thanks
> Emil
>
> [1] <a class="moz-txt-link-freetext" href="https://www.mesa3d.org/submittingpatches.html">https://www.mesa3d.org/submittingpatches.html</a>
</span><br>
<br>
</body>
</html>