<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"> mesa-dev [mailto:mesa-dev-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>Axel Davy<br>
<b>Sent:</b> Friday, September 9, 2016 2:12 PM<br>
<b>To:</b> Weng, Chuanbo <chuanbo.weng@intel.com>; mesa-dev@lists.freedesktop.org; emil.l.velikov@gmail.com<br>
<b>Subject:</b> Re: [Mesa-dev] [PATCH 2/3] egl: return corresponding offset of EGLImage instead of 0.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>That doesn't seem good to me.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>With that patch, that means that since no one is implementing<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>__DRI_IMAGE_ATTRIB_OFFSET<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>(yes I know in a later patch you implement it for i965),<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>then what used to work will stop working (as the queryImage will return false).<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>You need to introduce some interface version implementation check.<o:p></o:p></pre>
<pre>[****Chuanbo****] Maybe I can add more comment to git log (such as "This patch just implements egl loader side, the driver side <o:p></o:p></pre>
<pre>implementation is also needed for corresponding platform"), so user can be aware of this.<o:p></o:p></pre>
<pre>Introduce interface version implementation check will make mesa code more complex, because we should also add related check to<o:p></o:p></pre>
<pre>other dri2 functions(dri2_****).<o:p></o:p></pre>
<pre>Another solution is combining the three patches into one patch, as I did before:<o:p></o:p></pre>
<pre><a href="https://lists.freedesktop.org/archives/mesa-dev/2016-August/126945.html">https://lists.freedesktop.org/archives/mesa-dev/2016-August/126945.html</a><o:p></o:p></pre>
<pre>This is not as easy as this version for reviewers, but more clearer for users.<o:p></o:p></pre>
<pre>Emil, what do you think?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
<p>No, that's not ok.<o:p></o:p></p>
<p>First i965 isn't the only one to implement the dri image interface (see the gallium one), second a new implementer doesn't have to start from the most recent version, and can choose to implement older version, which wouldn't implement your new functionnality.<o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">[****Chuanbo****] OK. I’ll send out a new version based on your comments. Thanks.<o:p></o:p></span></p>
<p><o:p> </o:p></p>
<p>The code has to be something like:<o:p></o:p></p>
<p>if (offsets) {<o:p></o:p></p>
<p>   offsets[0] = 0;<o:p></o:p></p>
<p>   if (dri2_dpy->image->base.version >= 13)<o:p></o:p></p>
<p style="white-space:pre-wrap;orphans: auto;text-align:start;widows: 1;-webkit-text-stroke-width: 0px;word-spacing:0px">
dri2_dpy->image->queryImage(dri2_img->dri_image, __DRI_IMAGE_ATTRIB_OFFSET, offsets);<o:p></o:p></p>
<p style="white-space:pre-wrap;orphans: auto;text-align:start;widows: 1;-webkit-text-stroke-width: 0px;word-spacing:0px">
}<o:p></o:p></p>
<p style="white-space:pre-wrap;orphans: auto;text-align:start;widows: 1;-webkit-text-stroke-width: 0px;word-spacing:0px">
Axel<tt><span style="font-size:10.0pt"> </span></tt><o:p></o:p></p>
</div>
</body>
</html>