build-able drm-i915-update-38

Nikola Pajkovsky n.pajkovsky at gmail.com
Fri Jan 15 10:28:41 UTC 2016


Jean-Sébastien Pédron <jean-sebastien.pedron at dumbbell.fr> writes:

> On 13/01/2016 22:43, Nikola Pajkovsky wrote:
>>> I rebuild a full kernel from scratch and it does build fine here. There
>>> is no "unused variable" warning for me. Do you build a non-debug kernel
>>> perhaps? I don't plan to build-test such a kernel now, I'll do it when
>>> the patch is finished.
>> 
>> Oh, everytime? I have found out, that
>
> I use "make buildkernel -DKERNFAST" so only the modifed files are
> recompiled. I just rebuild the kernel from scratch this time to
> double-check if I missed a warning.

I sill don't know those tricks, because I had installed freebsd couple
weeks ago ;)

>>   $ cd sys/modules/drm2
>>   $ make -j9
>>   $ make DESTDIR=/boot/ KMODDIR=kernel.i915 install
>> 
>> is engough (only after I have fully built and booted kernel)
>
> Yes, this works fine, but this doesn't use many defaults set by GENERIC,
> such as debugging options or 32-bit support on 64-bit archs.
>
> The problem you hit is likely because I build a debug kernel (the
> variable is used) and not you (only the declaration remains).

ok, I will try that.

>>   gen6_ggtt_bind_object()
>>     const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry;
>>     BUG_ON(i > max_entries);
>> 
>> Seems like BUG_ON is noop, which should not be.
>
> BUG_ON() is a KASSERT() which is defined to nothing on a non-debug
> kernel. The variable should be declared in:
>
> #if defined(INVARIANTS)
> ...
> #endif

BUG_ON() is defined in linux.git/include/asm-generic/bug.h as

   #ifndef HAVE_ARCH_BUG
   #define BUG() do { \
   	printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
   	panic("BUG!"); \
   } while (0)
   #endif

   #ifndef HAVE_ARCH_BUG_ON
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
   #endif

and HAVE_ARCH_BUG is defined for x86, hence, BUG_ON must be *on* always,
even in kernel w/o debugging options.

> If you are still willing to send a pull request, you're welcome to do
> so! I know the change is small, so if you don't feel like cloning an
> entire repository just for that, I understand and I will fix it.
>
> Unlike what I said in my previous email, the pull request should be
> against the drm-i915-update-38 branch.

I will have to look at it bit deeper to get it fix.

-- 
Nikola


More information about the freebsd-x11 mailing list