<div dir="ltr"><p class="gmail-MsoPlainText">Hi Emil,<span></span></p><p class="gmail-MsoPlainText"> (Seems something wrong with my company's email, so I use this one)</p>
<p class="gmail-MsoPlainText"> I
understand your meaning except the NULL check part. Please see my questions
below.<span></span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText">-----Original Message-----<span></span></p>
<p class="gmail-MsoPlainText">From: mesa-dev [<a href="mailto:mesa-dev-bounces@lists.freedesktop.org">mailto:mesa-dev-bounces@lists.freedesktop.org</a>]
On Behalf Of Emil Velikov<span></span></p>
<p class="gmail-MsoPlainText">Sent: Wednesday, August 31, 2016 1:57 AM<span></span></p>
<p class="gmail-MsoPlainText">To: Weng, Chuanbo <<a href="mailto:chuanbo.weng@intel.com">chuanbo.weng@intel.com</a>><span></span></p>
<p class="gmail-MsoPlainText">Cc: ML mesa-dev <<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>><span></span></p>
<p class="gmail-MsoPlainText">Subject: Re: [Mesa-dev] [PATCH v2] egl: return
corresponding offset of EGLImage instead of 0.<span></span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText">On 30 August 2016 at 18:39, Weng, Chuanbo <<a href="mailto:chuanbo.weng@intel.com">chuanbo.weng@intel.com</a>> wrote:<span></span></p>
<p class="gmail-MsoPlainText">> Hi Emil,<span></span></p>
<p class="gmail-MsoPlainText">> Thanks
for your review!<span></span></p>
<p class="gmail-MsoPlainText">> Please
see my comments and questions below.<span></span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">> -----Original Message-----<span></span></p>
<p class="gmail-MsoPlainText">> From: mesa-dev [<a href="mailto:mesa-dev-bounces@lists.freedesktop.org">mailto:mesa-dev-bounces@lists.freedesktop.org</a>]
On <span></span></p>
<p class="gmail-MsoPlainText">> Behalf Of Emil Velikov<span></span></p>
<p class="gmail-MsoPlainText">> Sent: Tuesday, August 30, 2016 6:29 PM<span></span></p>
<p class="gmail-MsoPlainText">> To: Weng, Chuanbo <<a href="mailto:chuanbo.weng@intel.com">chuanbo.weng@intel.com</a>><span></span></p>
<p class="gmail-MsoPlainText">> Cc: ML mesa-dev <<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>><span></span></p>
<p class="gmail-MsoPlainText">> Subject: Re: [Mesa-dev] [PATCH v2] egl: return
corresponding offset of EGLImage instead of 0.<span></span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">> On 25 August 2016 at 18:50, Chuanbo Weng <<a href="mailto:chuanbo.weng@intel.com">chuanbo.weng@intel.com</a>> wrote:<span></span></p>
<p class="gmail-MsoPlainText">>> The offset should not always be 0. For example,
if EGLImage is <span></span></p>
<p class="gmail-MsoPlainText">>> created from a 2D texture with
EGL_GL_TEXTURE_LEVEL=1, then the <span></span></p>
<p class="gmail-MsoPlainText">>> offset should be the actual start of miplevel 1
in drm bo.<span></span></p>
<p class="gmail-MsoPlainText">>><span> </span></p>
<p class="gmail-MsoPlainText">>> v2: version bump on the EGL image interface and
add gallium pieces.<span></span></p>
<p class="gmail-MsoPlainText">>><span> </span></p>
<p class="gmail-MsoPlainText">>> Signed-off-by: Chuanbo Weng <<a href="mailto:chuanbo.weng@intel.com">chuanbo.weng@intel.com</a>><span></span></p>
<p class="gmail-MsoPlainText">>> ---<span></span></p>
<p class="gmail-MsoPlainText">>>
include/GL/internal/dri_interface.h
| 4 +++-<span></span></p>
<p class="gmail-MsoPlainText">>>
src/egl/drivers/dri2/egl_dri2.c
| 3 ++-<span></span></p>
<p class="gmail-MsoPlainText">>>
src/gallium/state_trackers/dri/dri2.c
| 8 +++++++-<span></span></p>
<p class="gmail-MsoPlainText">>>
src/gbm/backends/dri/gbm_dri.c
| 5 +++--<span></span></p>
<p class="gmail-MsoPlainText">>>
src/mesa/drivers/dri/i965/intel_screen.c | 9 +++++++--<span></span></p>
<p class="gmail-MsoPlainText">> I'm likely the only one here, but I'd suggest
splitting things up:<span></span></p>
<p class="gmail-MsoPlainText">> - introduce flag - include/<span></span></p>
<p class="gmail-MsoPlainText">> - wire up loaders, one at a time - src/{egl,gbm}<span></span></p>
<p class="gmail-MsoPlainText">> - implement in driver, one at a time -
src/{mesa,gallium} <span></span></p>
<p class="gmail-MsoPlainText">> [****Chuanbo****] I'm not sure whether I understand
correctly. Do you <span></span></p>
<p class="gmail-MsoPlainText">> mean that I should split this patch into three
patches as you suggested?<span></span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">If you want to go the extreme - five (if you implement
the gallium bits), three otherwise. Before doing anything I'd stick around for
a second for others to voice their preference [against].<span></span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText">>> - if
(!dri->image || dri->image->base.version < 12) {<span></span></p>
<p class="gmail-MsoPlainText">>> + if
(!dri->image || dri->image->base.version < 12 ||<span></span></p>
<p class="gmail-MsoPlainText">>> + !dri->image->mapImage) {<span></span></p>
<p class="gmail-MsoPlainText">> Hmm we want these NULL checks split out and ported
to older loader(s).<span></span></p>
<p class="gmail-MsoPlainText">> Otherwise we will get NULL deref when using older
loader + newer dri module(s).<span></span></p>
<p class="gmail-MsoPlainText">> [****Chuanbo****] So we just need to leave it as
original?<span></span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">Split it into a preparatory patch, adding the following
tag.<span></span></p>
<p class="gmail-MsoPlainText">CC: <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><span></span></p>
<p class="gmail-MsoPlainText">[****Chuanbo****] Could you explain " we want these
NULL checks split out and ported to older loader " more detailed?<span></span></p>
<p class="gmail-MsoPlainText">And what's older loaders? What's newer dri modules?<span></span></p>
<p class="gmail-MsoPlainText">From my understanding, the only path in mesa code invokes
mapImage is gbm_dri_bo_map. So if apply my patch code above, no NULL deref will
happen.<span></span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">>> --- a/src/mesa/drivers/dri/i965/intel_screen.c<span></span></p>
<p class="gmail-MsoPlainText">>> +++ b/src/mesa/drivers/dri/i965/intel_screen.c<span></span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">>> +
.mapImage
= NULL,<span></span></p>
<p class="gmail-MsoPlainText">>> +
.unmapImage
= NULL,<span></span></p>
<p class="gmail-MsoPlainText">> Consider looking into/implementing the map/unmap
interfaces. IIRC there was an implementation (slightly* different one) a while
back [1].<span></span></p>
<p class="gmail-MsoPlainText">> You really want this if you're thinking for Android
and/or CrOS ARC + a better gralloc [2].<span></span></p>
<p class="gmail-MsoPlainText">> [****Chuanbo****] Is it required to implement
map/unmap interfaces? Since I'm not interested in Android and/or CrOS ARC + a
better gralloc.<span></span></p>
<p class="gmail-MsoPlainText">> And I find that blitImage and getCapabilities are
not implemented when <span></span></p>
<p class="gmail-MsoPlainText">> bump verison. So I don’t think it's required to
implement map/unmap interface.<span></span></p>
<p class="gmail-MsoPlainText">><span> </span></p>
<p class="gmail-MsoPlainText">You don't have to, thus the "consider". Just
trying to get someone from Intel side excited/involved into this.<span></span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText">-Emil<span></span></p>
<p class="gmail-MsoPlainText"><span> </span></p>
<p class="gmail-MsoPlainText">/me wishes that MS implements a client which can do
proper quoting or people move to one that can </rant>
_______________________________________________<span></span></p>
<p class="gmail-MsoPlainText">mesa-dev mailing list<span></span></p>
<p class="gmail-MsoPlainText"><a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><span></span></p>
<p class="gmail-MsoPlainText"><a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><span></span></p></div>