<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 01/03/2016 22:41, Marek Olšák wrote:<br>
</div>
<blockquote
cite="mid:1456868496-20455-3-git-send-email-maraeo@gmail.com"
type="cite">
<pre wrap="">From: Marek Olšák <a class="moz-txt-link-rfc2396E" href="mailto:marek.olsak@amd.com"><marek.olsak@amd.com></a>
buffer->base.attachment = attachment;
buffer->base.name = whandle.handle;
@@ -539,7 +540,8 @@ dri2_allocate_textures(struct dri_context *ctx,
whandle.type = DRM_API_HANDLE_TYPE_KMS;
drawable->textures[statt] =
screen->base.screen->resource_from_handle(screen->base.screen,
- &templ, &whandle);
+ &templ, &whandle,
+ PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ);
assert(drawable->textures[statt]);
}
}
@@ -756,7 +758,7 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,
whandle->stride = pitch * util_format_get_blocksize(pf);
img->texture = screen->base.screen->resource_from_handle(screen->base.screen,
- &templ, whandle);
+ &templ, whandle, PIPE_HANDLE_USAGE_READ_WRITE);</pre>
</blockquote>
I guess it would be better setting explicitly img->use to 0 ,<br>
as is already the case for other img fields.<br>
<blockquote
cite="mid:1456868496-20455-3-git-send-email-maraeo@gmail.com"
type="cite">
<pre wrap="">
if (!img->texture) {
FREE(img);
return NULL;
@@ -884,6 +886,7 @@ dri2_create_image(__DRIscreen *_screen,
img->layer = 0;
img->dri_format = format;
img->dri_components = 0;
+ img->use = use;
</pre>
</blockquote>
<br>
<br>
This looks ok to me (except the minor nitpick).<br>
You can add my Rb: Reviewed-by: Axel Davy <a class="moz-txt-link-rfc2396E" href="mailto:axel.davy@ens.fr"><axel.davy@ens.fr></a><br>
<br>
For the first patch, I think it would be better to document
somewhere the flag.<br>
Basically my initial commit message was:<br>
"
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Add __DRI_IMAGE_USE_BACKBUFFER to indicate the
image is going to be used as a backbuffer.
Backbuffers are going to be attached as
__DRI_BUFFER_BACK_LEFT or
__DRI_BUFFER_BACK_RIGHT.
This flag enables the driver to assume the
buffer will only be read by an external process after
a swapbuffer, in contrary to gbm buffers,
front buffers and fake front buffers, which could be
read after a flush."
I guess the latter part could be adapted and put in <meta http-equiv="content-type" content="text/html; charset=utf-8">dri_interface.h
Axel
<pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></pre></pre></body></html>