Re: svn commit: r286880 - head/sys/kern

2015-08-26 Thread Hans Petter Selasky

On 08/26/15 20:14, Julien Charbon wrote:

  Let say that if nobody screams until Friday 8/28, I will put back
r284245 and revert this change_and_  I will make this case clear in the
man page.


Hi,

If you can update the manual page about this special case for MPSAFE 
callouts only I presume, then its totally fine. Then I can update my 
projects/hps_head to follow that new change, which now is a bit broken. 
You might also want to check existing MPSAFE consumers in the kernel, if 
this API change makes any difference.


I was thinking if user-space TCP might be affected by this. CC'ing Adrian.

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287166 - head/sys/kern

2015-08-26 Thread George V. Neville-Neil
Author: gnn
Date: Wed Aug 26 16:36:41 2015
New Revision: 287166
URL: https://svnweb.freebsd.org/changeset/base/287166

Log:
  Summary: Add the interactivity equations to the header comment for our
  interactivity calculation routine.
  
  Suggested by: rwatson

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Wed Aug 26 13:23:56 2015(r287165)
+++ head/sys/kern/sched_ule.c   Wed Aug 26 16:36:41 2015(r287166)
@@ -1450,6 +1450,21 @@ sched_initticks(void *dummy)
  * a [0, 100] integer.  This is the voluntary sleep time of a process, which
  * differs from the cpu usage because it does not account for time spent
  * waiting on a run-queue.  Would be prettier if we had floating point.
+ *
+ * When a thread's sleep time is greater than its run time the
+ * calculation is:
+ *
+ *   scaling factor 
+ * interactivity score =  -
+ *sleep time / run time
+ *
+ *
+ * When a thread's run time is greater than its sleep time the
+ * calculation is:
+ *
+ *   scaling factor 
+ * interactivity score =  -+ scaling factor
+ *run time / sleep time
  */
 static int
 sched_interact_score(struct thread *td)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r286880 - head/sys/kern

2015-08-26 Thread Julien Charbon

 Hi Hans,

On 26/08/15 10:12, Hans Petter Selasky wrote:
 On 08/26/15 09:25, Hans Petter Selasky wrote:
 On 08/18/15 12:15, Julien Charbon wrote:
 Author: jch
 Date: Tue Aug 18 10:15:09 2015
 New Revision: 286880
 URL: https://svnweb.freebsd.org/changeset/base/286880

 Log:
callout_stop() should return 0 (fail) when the callout is currently
being serviced and indeed unstoppable.

A scenario to reproduce this case is:

- the callout is being serviced and at same time,
- callout_reset() is called on this callout that sets
  the CALLOUT_PENDING flag and at same time,
- callout_stop() is called on this callout and returns 1 (success)
  even if the callout is indeed currently running and unstoppable.

This issue was caught up while making r284245 (D2763) workaround, and
was discussed at BSDCan 2015.  Once applied the r284245 workaround
is not needed anymore and will be reverted.

Differential Revision:https://reviews.freebsd.org/D3078
Reviewed by:jhb
Sponsored by:Verisign, Inc.

 Modified:
head/sys/kern/kern_timeout.c

 Modified: head/sys/kern/kern_timeout.c
 ==


 --- head/sys/kern/kern_timeout.cTue Aug 18 10:07:03 2015   
 (r286879)
 +++ head/sys/kern/kern_timeout.cTue Aug 18 10:15:09 2015   
 (r286880)
 @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in
   struct callout_cpu *cc, *old_cc;
   struct lock_class *class;
   int direct, sq_locked, use_lock;
 -int not_on_a_list;
 +int not_on_a_list, not_running;

   if (safe)
   WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c-c_lock,
 @@ -1378,8 +1378,15 @@ again:
   }
   }
   callout_cc_del(c, cc);
 +
 +/*
 + * If we are asked to stop a callout which is currently in progress
 + * and indeed impossible to stop then return 0.
 + */
 +not_running = !(cc_exec_curr(cc, direct) == c);
 +
   CC_UNLOCK(cc);
 -return (1);
 +return (not_running);
   }

   void
 
 I'm sorry to say, but I think this change should be backed out as it
 changes the behaviour of the callout API. The old code was correct. The
 issues should be fixed in the TCP stack instead, like suggested by D1563
 and also r284245.
 
 This patch introduces new behaviour to the callout_stop() function,
 which is contradicting man 9 callout and _not_ documented anywhere!
 
 Reading man 9 callout in 11-current:
 
  The callout_reset() and callout_schedule() function families
 schedule a
  future function invocation for callout c.  If c already has a
 pending
  callout, it is cancelled before the new invocation is scheduled.
 
 callout_reset() causes a _new_ callout invocation and it is logical that
 the return value of callout_stop() reflect operations on the _new_
 callout invocation and not the previous one.
 
  The function callout_stop() cancels a callout c if it is
 currently pend-
  ing.  If the callout is pending, then callout_stop() returns a
 non-zero
  value.  If the callout is not set, has already been serviced, or
 is cur-
  rently being serviced, then zero will be returned.  If the
 callout has an
  associated lock, then that lock must be held when this function is
  called.
 
 If there are two callout invocations that callout_stop() needs to
 handle, it should be called twice.
 
 The correct way is:
 
 callout_reset();
 callout_stop();
 callout_drain();
 
 For the TCP stack's matter, it should be:
 
 callout_reset();
 callout_stop(); /* cancel _new_ callout invocation */
 callout_stop(); /* check for any pending callout invokation */

 First thank for your time.  I indeed agree with your analysis and I am
not opposed to back out this change.  The border between bug or feature
can indeed be thin;  below why I was more on bug side:

o Pro It is a feature:

 - This behavior is here since the beginning and nobody ever complains
(Big one)

o Pro It is a bug:

 - Having callout_stop() returning 1 (success) while having the callout
currently being serviced is counter intuitive.

 - You cannot call callout_stop() twice to address this case:

callout_reset();
callout_stop(); /* cancel _new_ callout invocation */
callout_stop(); /* check for any pending callout invokation */

 Because the second callout_stop() will always return 0 (Fail).  In
details:  If the callout is currently being serviced (without r286880
i.e. the classical behavior):

callout_reset() returns 0 (Fail)(PENDING flag set)
callout_stop() returns 1  (Success) (PENDING flag removed)
callout_stop() returns 0  (Always fail because not PENDING flag)

 In mpsafe mode, the only way a callout_stop() can return 1 (Success) is
with the PENDING flags set.  The way I found to address this case is with:

fail_reset = !callout_reset();
fail_stop = !callout_stop();

if (fail_reset || fail_stop) {
  /* Callout not stopped */
}

 This is what I did in r284245:


svn commit: r287170 - head

2015-08-26 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 26 18:22:59 2015
New Revision: 287170
URL: https://svnweb.freebsd.org/changeset/base/287170

Log:
  Belatedly add entries for libugidfw.so.4 to catch up with r284745.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Aug 26 18:09:17 2015(r287169)
+++ head/ObsoleteFiles.inc  Wed Aug 26 18:22:59 2015(r287170)
@@ -55,6 +55,9 @@ OLD_FILES+=usr/share/man/man4/dtrace-pro
 OLD_FILES+=usr/share/man/man4/dtrace-sched.4.gz
 OLD_FILES+=usr/share/man/man4/dtrace-tcp.4.gz
 OLD_FILES+=usr/share/man/man4/dtrace-udp.4.gz
+# 20150624
+OLD_LIBS+=usr/lib/libugidfw.so.4
+OLD_LIBS+=usr/lib32/libugidfw.so.4
 # 20150604: Move nvlist man pages to section 9.
 OLD_FILES+=usr/share/man/man3/libnv.3.gz
 OLD_FILES+=usr/share/man/man3/nvlist.3.gz
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287169 - in head/sys: arm64/conf conf

2015-08-26 Thread Andrew Turner
Author: andrew
Date: Wed Aug 26 18:09:17 2015
New Revision: 287169
URL: https://svnweb.freebsd.org/changeset/base/287169

Log:
  Add the SOC_HISI_HI6220 option. This will be used to enable drivers for
  the HiSilicon hi6220 SoC used in the HiKey 96boards board.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/options.arm64

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Wed Aug 26 17:13:47 2015(r287168)
+++ head/sys/arm64/conf/GENERIC Wed Aug 26 18:09:17 2015(r287169)
@@ -86,6 +86,7 @@ options   MALLOC_DEBUG_MAXZONES=8 # Separ
 
 # SoC support
 optionsSOC_CAVM_THUNDERX
+optionsSOC_HISI_HI6220
 
 # VirtIO support
 device virtio

Modified: head/sys/conf/options.arm64
==
--- head/sys/conf/options.arm64 Wed Aug 26 17:13:47 2015(r287168)
+++ head/sys/conf/options.arm64 Wed Aug 26 18:09:17 2015(r287169)
@@ -8,3 +8,4 @@ VFP opt_global.h
 
 # SoC Support
 SOC_CAVM_THUNDERX  opt_soc.h
+SOC_HISI_HI6220opt_soc.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287167 - head/share/mk

2015-08-26 Thread Warner Losh
Author: imp
Date: Wed Aug 26 17:10:43 2015
New Revision: 287167
URL: https://svnweb.freebsd.org/changeset/base/287167

Log:
  After consultations with the arm community, don't define softfp for
  armv6. It's too ambiguous. We do use the softfp ABI for the moment on
  armv6, but we allow floating point register use (and the compilers
  will generate it). This is too ambiguous to use it as a decider for
  which algorithms to use on the platform. Err on the side of caution
  and not define it.
  
  Submitted by: ian@
  Reviewed by: andrew@

Modified:
  head/share/mk/bsd.cpu.mk

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkWed Aug 26 16:36:41 2015(r287166)
+++ head/share/mk/bsd.cpu.mkWed Aug 26 17:10:43 2015(r287167)
@@ -282,7 +282,11 @@ MACHINE_CPU += arm
 . if ${MACHINE_ARCH:Marmv6*} != 
 MACHINE_CPU += armv6
 . endif
-. if ${MACHINE_ARCH:M*hf} == 
+# armv6 is a hybrid. It uses the softfp ABI, but doesn't emulate
+# floating point in the general case, so don't define softfp for
+# it at this time. arm and armeb are pure softfp, so define it
+# for them.
+. if ${MACHINE_ARCH:Marmv6*} == 
 MACHINE_CPU += softfp
 . endif
 .if ${MACHINE_ARCH} == armv6
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r286880 - head/sys/kern

2015-08-26 Thread Julien Charbon

 Hi Hans,

On 26/08/15 09:25, Hans Petter Selasky wrote:
 On 08/18/15 12:15, Julien Charbon wrote:
 Author: jch
 Date: Tue Aug 18 10:15:09 2015
 New Revision: 286880
 URL: https://svnweb.freebsd.org/changeset/base/286880

 Log:
callout_stop() should return 0 (fail) when the callout is currently
being serviced and indeed unstoppable.

A scenario to reproduce this case is:

- the callout is being serviced and at same time,
- callout_reset() is called on this callout that sets
  the CALLOUT_PENDING flag and at same time,
- callout_stop() is called on this callout and returns 1 (success)
  even if the callout is indeed currently running and unstoppable.

This issue was caught up while making r284245 (D2763) workaround, and
was discussed at BSDCan 2015.  Once applied the r284245 workaround
is not needed anymore and will be reverted.

Differential Revision:https://reviews.freebsd.org/D3078
Reviewed by:jhb
Sponsored by:Verisign, Inc.

 Modified:
head/sys/kern/kern_timeout.c

 Modified: head/sys/kern/kern_timeout.c
 ==

 --- head/sys/kern/kern_timeout.cTue Aug 18 10:07:03 2015(r286879)
 +++ head/sys/kern/kern_timeout.cTue Aug 18 10:15:09 2015(r286880)
 @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in
   struct callout_cpu *cc, *old_cc;
   struct lock_class *class;
   int direct, sq_locked, use_lock;
 -int not_on_a_list;
 +int not_on_a_list, not_running;

   if (safe)
   WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c-c_lock,
 @@ -1378,8 +1378,15 @@ again:
   }
   }
   callout_cc_del(c, cc);
 +
 +/*
 + * If we are asked to stop a callout which is currently in progress
 + * and indeed impossible to stop then return 0.
 + */
 +not_running = !(cc_exec_curr(cc, direct) == c);
 +
   CC_UNLOCK(cc);
 -return (1);
 +return (not_running);
   }

   void
 
 I think this patch is incomplete and can break the return value for
 non-MPSAFE callouts. I think the correct statement should check the
 value of use_lock too:
 
 not_running = !(cc_exec_curr(cc, direct) == c  use_lock == 0);
 
 Because if the callback process waits for lock c_lock in the callback
 process then we have above cc_exec_curr(cc, direct) == c is satisfied
 too, and non-MPSAFE callouts are always cancelable, via
 cc_exec_cancel(cc, direct) = true;

 Hum, interesting let me double check that.

--
Julien




signature.asc
Description: OpenPGP digital signature


svn commit: r287168 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon...

2015-08-26 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 26 17:13:47 2015
New Revision: 287168
URL: https://svnweb.freebsd.org/changeset/base/287168

Log:
  Merge ACPICA 20150818.

Modified:
  head/sys/conf/files
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/adisasm.c
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/compiler/aslmain.c
  head/sys/contrib/dev/acpica/compiler/asloperands.c
  head/sys/contrib/dev/acpica/compiler/asloptions.c
  head/sys/contrib/dev/acpica/compiler/aslstartup.c
  head/sys/contrib/dev/acpica/components/debugger/dbcmds.c
  head/sys/contrib/dev/acpica/components/debugger/dbconvert.c
  head/sys/contrib/dev/acpica/components/debugger/dbdisply.c
  head/sys/contrib/dev/acpica/components/debugger/dbexec.c
  head/sys/contrib/dev/acpica/components/debugger/dbfileio.c
  head/sys/contrib/dev/acpica/components/debugger/dbhistry.c
  head/sys/contrib/dev/acpica/components/debugger/dbinput.c
  head/sys/contrib/dev/acpica/components/debugger/dbmethod.c
  head/sys/contrib/dev/acpica/components/debugger/dbnames.c
  head/sys/contrib/dev/acpica/components/debugger/dbobject.c
  head/sys/contrib/dev/acpica/components/debugger/dbstats.c
  head/sys/contrib/dev/acpica/components/debugger/dbtest.c
  head/sys/contrib/dev/acpica/components/debugger/dbutils.c
  head/sys/contrib/dev/acpica/components/debugger/dbxface.c
  head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
  head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
  head/sys/contrib/dev/acpica/components/disassembler/dmnames.c
  head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
  head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
  head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
  head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
  head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
  head/sys/contrib/dev/acpica/components/disassembler/dmutils.c
  head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
  head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
  head/sys/contrib/dev/acpica/components/events/evregion.c
  head/sys/contrib/dev/acpica/components/executer/exconfig.c
  head/sys/contrib/dev/acpica/components/executer/exdump.c
  head/sys/contrib/dev/acpica/components/executer/exresnte.c
  head/sys/contrib/dev/acpica/components/executer/exresolv.c
  head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
  head/sys/contrib/dev/acpica/components/namespace/nseval.c
  head/sys/contrib/dev/acpica/components/namespace/nsload.c
  head/sys/contrib/dev/acpica/components/namespace/nsutils.c
  head/sys/contrib/dev/acpica/components/parser/psloop.c
  head/sys/contrib/dev/acpica/components/resources/rsdump.c
  head/sys/contrib/dev/acpica/components/tables/tbfadt.c
  head/sys/contrib/dev/acpica/components/tables/tbfind.c
  head/sys/contrib/dev/acpica/components/tables/tbinstal.c
  head/sys/contrib/dev/acpica/components/tables/tbutils.c
  head/sys/contrib/dev/acpica/components/tables/tbxfload.c
  head/sys/contrib/dev/acpica/components/utilities/utfileio.c
  head/sys/contrib/dev/acpica/components/utilities/utinit.c
  head/sys/contrib/dev/acpica/components/utilities/utmisc.c
  head/sys/contrib/dev/acpica/components/utilities/utnonansi.c
  head/sys/contrib/dev/acpica/components/utilities/utxface.c
  head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
  head/sys/contrib/dev/acpica/include/acbuffer.h
  head/sys/contrib/dev/acpica/include/acconfig.h
  head/sys/contrib/dev/acpica/include/acdebug.h
  head/sys/contrib/dev/acpica/include/acdisasm.h
  head/sys/contrib/dev/acpica/include/acexcep.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/aclocal.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actables.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/acutils.h
  head/sys/contrib/dev/acpica/include/platform/acenv.h
  head/sys/dev/acpica/Osd/OsdDebug.c
  head/usr.sbin/acpi/acpidb/acpidb.c
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Aug 26 17:10:43 2015(r287167)
+++ head/sys/conf/files Wed Aug 26 17:13:47 2015(r287168)
@@ -401,7 +401,7 @@ contrib/dev/acpica/components/parser/psx
 contrib/dev/acpica/components/resources/rsaddr.c   optional acpi
 contrib/dev/acpica/components/resources/rscalc.c   optional acpi
 contrib/dev/acpica/components/resources/rscreate.c optional acpi
-contrib/dev/acpica/components/resources/rsdump.c   optional acpi
+contrib/dev/acpica/components/resources/rsdump.c   optional acpi acpi_debug
 

svn commit: r287171 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 21:17:48 2015
New Revision: 287171
URL: https://svnweb.freebsd.org/changeset/base/287171

Log:
  Synchronize i915_reg.h with linux 3.8.13 version
  
  Keep a couple of old macros that will be removed lated when the rest of the 
code
  will be updated to 3.8.13 equivalent.
  Chase the renamed macros
  
  Reviewed by:  dumbbell
  Differential Revision:https://reviews.freebsd.org/D3487

Modified:
  head/sys/dev/drm2/i915/i915_reg.h
  head/sys/dev/drm2/i915/intel_ddi.c
  head/sys/dev/drm2/i915/intel_display.c
  head/sys/dev/drm2/i915/intel_pm.c

Modified: head/sys/dev/drm2/i915/i915_reg.h
==
--- head/sys/dev/drm2/i915/i915_reg.h   Wed Aug 26 18:22:59 2015
(r287170)
+++ head/sys/dev/drm2/i915/i915_reg.h   Wed Aug 26 21:17:48 2015
(r287171)
@@ -29,6 +29,7 @@ __FBSDID($FreeBSD$);
 #define _I915_REG_H_
 
 #define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a)))
+#define _TRANSCODER(tran, a, b) ((a) + (tran)*((b)-(a)))
 
 #define _PORT(port, a, b) ((a) + (port)*((b)-(a)))
 
@@ -43,6 +44,14 @@ __FBSDID($FreeBSD$);
  */
 #define INTEL_GMCH_CTRL0x52
 #define INTEL_GMCH_VGA_DISABLE  (1  1)
+#define SNB_GMCH_CTRL  0x50
+#defineSNB_GMCH_GGMS_SHIFT 8 /* GTT Graphics Memory Size */
+#defineSNB_GMCH_GGMS_MASK  0x3
+#defineSNB_GMCH_GMS_SHIFT   3 /* Graphics Mode Select */
+#defineSNB_GMCH_GMS_MASK0x1f
+#defineIVB_GMCH_GMS_SHIFT   4
+#defineIVB_GMCH_GMS_MASK0xf
+
 
 /* PCI config space */
 
@@ -108,7 +117,6 @@ __FBSDID($FreeBSD$);
 #define  GEN6_GRDOM_MEDIA  (1  2)
 #define  GEN6_GRDOM_BLT(1  3)
 
-/* PPGTT stuff */
 #define GEN6_GTT_ADDR_ENCODE(addr) ((addr) | (((addr)  28)  0xff0))
 
 #define GEN6_PDE_VALID (1  0)
@@ -213,6 +221,13 @@ __FBSDID($FreeBSD$);
 #define MI_DISPLAY_FLIPMI_INSTR(0x14, 2)
 #define MI_DISPLAY_FLIP_I915   MI_INSTR(0x14, 1)
 #define   MI_DISPLAY_FLIP_PLANE(n) ((n)  20)
+/* IVB has funny definitions for which plane to flip. */
+#define   MI_DISPLAY_FLIP_IVB_PLANE_A  (0  19)
+#define   MI_DISPLAY_FLIP_IVB_PLANE_B  (1  19)
+#define   MI_DISPLAY_FLIP_IVB_SPRITE_A (2  19)
+#define   MI_DISPLAY_FLIP_IVB_SPRITE_B (3  19)
+#define   MI_DISPLAY_FLIP_IVB_PLANE_C  (4  19)
+#define   MI_DISPLAY_FLIP_IVB_SPRITE_C (5  19)
 #define MI_ARB_ON_OFF  MI_INSTR(0x08, 0)
 #define   MI_ARB_ENABLE(10)
 #define   MI_ARB_DISABLE   (00)
@@ -236,11 +251,18 @@ __FBSDID($FreeBSD$);
  */
 #define MI_LOAD_REGISTER_IMM(x)MI_INSTR(0x22, 2*x-1)
 #define MI_FLUSH_DWMI_INSTR(0x26, 1) /* for GEN6 */
-#define   MI_INVALIDATE_TLB(118)
-#define   MI_INVALIDATE_BSD(17)
+#define   MI_FLUSH_DW_STORE_INDEX  (121)
+#define   MI_INVALIDATE_TLB(118)
+#define   MI_FLUSH_DW_OP_STOREDW   (114)
+#define   MI_INVALIDATE_BSD(17)
+#define   MI_FLUSH_DW_USE_GTT  (12)
+#define   MI_FLUSH_DW_USE_PPGTT(02)
 #define MI_BATCH_BUFFERMI_INSTR(0x30, 1)
-#define   MI_BATCH_NON_SECURE  (1)
-#define   MI_BATCH_NON_SECURE_I965 (18)
+#define   MI_BATCH_NON_SECURE  (1)
+/* for snb/ivb/vlv this also means batch in ppgtt when ppgtt is enabled. */
+#define   MI_BATCH_NON_SECURE_I965 (18)
+#define   MI_BATCH_PPGTT_HSW   (18)
+#define   MI_BATCH_NON_SECURE_HSW  (113)
 #define MI_BATCH_BUFFER_START  MI_INSTR(0x31, 0)
 #define   MI_BATCH_GTT (26) /* aliased with (17) on gen4 */
 #define MI_SEMAPHORE_MBOX  MI_INSTR(0x16, 1) /* gen6+ */
@@ -298,6 +320,7 @@ __FBSDID($FreeBSD$);
 #define   DISPLAY_PLANE_B   (120)
 #define GFX_OP_PIPE_CONTROL(len)   ((0x329)|(0x327)|(0x224)|(len-2))
 #define   PIPE_CONTROL_CS_STALL(120)
+#define   PIPE_CONTROL_TLB_INVALIDATE  (118)
 #define   PIPE_CONTROL_QW_WRITE(114)
 #define   PIPE_CONTROL_DEPTH_STALL (113)
 #define   PIPE_CONTROL_WRITE_FLUSH (112)
@@ -363,6 +386,7 @@ __FBSDID($FreeBSD$);
 #define   DPIO_PLL_MODESEL_SHIFT   24 /* 3 bits */
 #define   DPIO_BIAS_CURRENT_CTL_SHIFT  21 /* 3 bits, always 0x7 */
 #define   DPIO_PLL_REFCLK_SEL_SHIFT16 /* 2 bits */
+#define   DPIO_PLL_REFCLK_SEL_MASK 3
 #define   DPIO_DRIVER_CTL_SHIFT12 /* always set to 0x8 */
 #define   DPIO_CLK_BIAS_CTL_SHIFT  8 /* always set to 0x5 */
 #define _DPIO_REFSFR_B 0x8034
@@ -378,6 +402,9 @@ __FBSDID($FreeBSD$);
 
 #define DPIO_FASTCLK_DISABLE   0x8100
 
+#define DPIO_DATA_CHANNEL1 0x8220
+#define DPIO_DATA_CHANNEL2 0x8420
+
 /*
  * Fence registers
  */
@@ -444,6 +471,7 @@ __FBSDID($FreeBSD$);
 #define RING_ACTHD(base)   ((base)+0x74)
 #define RING_NOPID(base)   ((base)+0x94)
 #define RING_IMR(base) ((base)+0xa8)
+#define 

svn commit: r287175 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 22:00:40 2015
New Revision: 287175
URL: https://svnweb.freebsd.org/changeset/base/287175

Log:
  backout a change that should not have crept in

Modified:
  head/sys/dev/drm2/i915/i915_gem_context.c

Modified: head/sys/dev/drm2/i915/i915_gem_context.c
==
--- head/sys/dev/drm2/i915/i915_gem_context.c   Wed Aug 26 21:35:16 2015
(r287174)
+++ head/sys/dev/drm2/i915/i915_gem_context.c   Wed Aug 26 22:00:40 2015
(r287175)
@@ -302,7 +302,7 @@ void i915_gem_context_fini(struct drm_de
do_destroy(dev_priv-rings[RCS].default_context);
 }
 
-static int context_idr_cleanup(int id, void *p, void *data)
+static int context_idr_cleanup(uint32_t id, void *p, void *data)
 {
struct i915_hw_context *ctx = p;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287173 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 21:33:43 2015
New Revision: 287173
URL: https://svnweb.freebsd.org/changeset/base/287173

Log:
  Reduce diff with linux 3.8.13 on i915_drv.c
  
  While here update the list of devices id to match the one in linux 3.8.13
  
  Reviewed by:  dumbbell
  Differential Revision:https://reviews.freebsd.org/D3489

Modified:
  head/sys/dev/drm2/i915/i915_drv.c

Modified: head/sys/dev/drm2/i915/i915_drv.c
==
--- head/sys/dev/drm2/i915/i915_drv.c   Wed Aug 26 21:31:04 2015
(r287172)
+++ head/sys/dev/drm2/i915/i915_drv.c   Wed Aug 26 21:33:43 2015
(r287173)
@@ -47,6 +47,11 @@ static drm_pci_id_list_t i915_pciidlist[
i915_PCI_IDS
 };
 
+#define INTEL_VGA_DEVICE(id, info_) {  \
+   .device = id,   \
+   .info = info_,  \
+}
+
 static const struct intel_device_info intel_i830_info = {
.gen = 2, .is_mobile = 1, .cursor_needs_physical = 1,
.has_overlay = 1, .overlay_needs_physical = 1,
@@ -181,7 +186,6 @@ static const struct intel_device_info in
.has_pch_split = 1,
 };
 
-#if 0
 static const struct intel_device_info intel_valleyview_m_info = {
.gen = 7, .is_mobile = 1,
.need_gfx_hws = 1, .has_hotplug = 1,
@@ -199,7 +203,6 @@ static const struct intel_device_info in
.has_blt_ring = 1,
.is_valleyview = 1,
 };
-#endif
 
 static const struct intel_device_info intel_haswell_d_info = {
.is_haswell = 1, .gen = 7,
@@ -221,42 +224,37 @@ static const struct intel_device_info in
.not_supported = 1,
 };
 
-#define INTEL_VGA_DEVICE(id, info_) {  \
-   .device = id,   \
-   .info = info_,  \
-}
-
 static const struct intel_gfx_device_id {
int device;
const struct intel_device_info *info;
-} pciidlist[] = {  /* aka */
-   INTEL_VGA_DEVICE(0x3577, intel_i830_info),
-   INTEL_VGA_DEVICE(0x2562, intel_845g_info),
-   INTEL_VGA_DEVICE(0x3582, intel_i85x_info),
+} pciidlist[] = {  /* aka */
+   INTEL_VGA_DEVICE(0x3577, intel_i830_info), /* I830_M */
+   INTEL_VGA_DEVICE(0x2562, intel_845g_info), /* 845_G */
+   INTEL_VGA_DEVICE(0x3582, intel_i85x_info), /* I855_GM */
INTEL_VGA_DEVICE(0x358e, intel_i85x_info),
-   INTEL_VGA_DEVICE(0x2572, intel_i865g_info),
-   INTEL_VGA_DEVICE(0x2582, intel_i915g_info),
-   INTEL_VGA_DEVICE(0x258a, intel_i915g_info),
-   INTEL_VGA_DEVICE(0x2592, intel_i915gm_info),
-   INTEL_VGA_DEVICE(0x2772, intel_i945g_info),
-   INTEL_VGA_DEVICE(0x27a2, intel_i945gm_info),
-   INTEL_VGA_DEVICE(0x27ae, intel_i945gm_info),
-   INTEL_VGA_DEVICE(0x2972, intel_i965g_info),
-   INTEL_VGA_DEVICE(0x2982, intel_i965g_info),
-   INTEL_VGA_DEVICE(0x2992, intel_i965g_info),
-   INTEL_VGA_DEVICE(0x29a2, intel_i965g_info),
-   INTEL_VGA_DEVICE(0x29b2, intel_g33_info),
-   INTEL_VGA_DEVICE(0x29c2, intel_g33_info),
-   INTEL_VGA_DEVICE(0x29d2, intel_g33_info),
-   INTEL_VGA_DEVICE(0x2a02, intel_i965gm_info),
-   INTEL_VGA_DEVICE(0x2a12, intel_i965gm_info),
-   INTEL_VGA_DEVICE(0x2a42, intel_gm45_info),
-   INTEL_VGA_DEVICE(0x2e02, intel_g45_info),
-   INTEL_VGA_DEVICE(0x2e12, intel_g45_info),
-   INTEL_VGA_DEVICE(0x2e22, intel_g45_info),
-   INTEL_VGA_DEVICE(0x2e32, intel_g45_info),
-   INTEL_VGA_DEVICE(0x2e42, intel_g45_info),
-   INTEL_VGA_DEVICE(0x2e92, intel_g45_info),
+   INTEL_VGA_DEVICE(0x2572, intel_i865g_info),/* I865_G */
+   INTEL_VGA_DEVICE(0x2582, intel_i915g_info),/* I915_G */
+   INTEL_VGA_DEVICE(0x258a, intel_i915g_info),/* E7221_G */
+   INTEL_VGA_DEVICE(0x2592, intel_i915gm_info),   /* I915_GM */
+   INTEL_VGA_DEVICE(0x2772, intel_i945g_info),/* I945_G */
+   INTEL_VGA_DEVICE(0x27a2, intel_i945gm_info),   /* I945_GM */
+   INTEL_VGA_DEVICE(0x27ae, intel_i945gm_info),   /* I945_GME */
+   INTEL_VGA_DEVICE(0x2972, intel_i965g_info),/* I946_GZ */
+   INTEL_VGA_DEVICE(0x2982, intel_i965g_info),/* G35_G */
+   INTEL_VGA_DEVICE(0x2992, intel_i965g_info),/* I965_Q */
+   INTEL_VGA_DEVICE(0x29a2, intel_i965g_info),/* I965_G */
+   INTEL_VGA_DEVICE(0x29b2, intel_g33_info),  /* Q35_G */
+   INTEL_VGA_DEVICE(0x29c2, intel_g33_info),  /* G33_G */
+   INTEL_VGA_DEVICE(0x29d2, intel_g33_info),  /* Q33_G */
+   INTEL_VGA_DEVICE(0x2a02, intel_i965gm_info),   /* I965_GM */
+   INTEL_VGA_DEVICE(0x2a12, intel_i965gm_info),   /* I965_GME */
+   INTEL_VGA_DEVICE(0x2a42, intel_gm45_info), /* GM45_G */
+   INTEL_VGA_DEVICE(0x2e02, 

svn commit: r287177 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 22:19:53 2015
New Revision: 287177
URL: https://svnweb.freebsd.org/changeset/base/287177

Log:
  Merge i915_emit_box_p and i915_emit_box as done in linux 3.8
  
  Reviewed by:  dumbbell
  Differential Revision:https://reviews.freebsd.org/D3495

Modified:
  head/sys/dev/drm2/i915/i915_dma.c
  head/sys/dev/drm2/i915/i915_drv.h
  head/sys/dev/drm2/i915/i915_gem_execbuffer.c

Modified: head/sys/dev/drm2/i915/i915_dma.c
==
--- head/sys/dev/drm2/i915/i915_dma.c   Wed Aug 26 22:09:12 2015
(r287176)
+++ head/sys/dev/drm2/i915/i915_dma.c   Wed Aug 26 22:19:53 2015
(r287177)
@@ -410,21 +410,8 @@ static int i915_emit_cmds(struct drm_dev
return 0;
 }
 
-int i915_emit_box(struct drm_device * dev,
- struct drm_clip_rect *boxes,
- int i, int DR1, int DR4)
-{
-   struct drm_clip_rect box;
-
-   if (DRM_COPY_FROM_USER_UNCHECKED(box, boxes[i], sizeof(box))) {
-   return -EFAULT;
-   }
-
-   return (i915_emit_box_p(dev, box, DR1, DR4));
-}
-
 int
-i915_emit_box_p(struct drm_device *dev,
+i915_emit_box(struct drm_device *dev,
  struct drm_clip_rect *box,
  int DR1, int DR4)
 {
@@ -506,8 +493,8 @@ static int i915_dispatch_cmdbuffer(struc
 
for (i = 0; i  count; i++) {
if (i  nbox) {
-   ret = i915_emit_box_p(dev, cmd-cliprects[i],
-   cmd-DR1, cmd-DR4);
+   ret = i915_emit_box(dev, cliprects[i],
+   cmd-DR1, cmd-DR4);
if (ret)
return ret;
}
@@ -542,8 +529,8 @@ static int i915_dispatch_batchbuffer(str
count = nbox ? nbox : 1;
for (i = 0; i  count; i++) {
if (i  nbox) {
-   int ret = i915_emit_box_p(dev, cliprects[i],
-   batch-DR1, batch-DR4);
+   ret = i915_emit_box(dev, cliprects[i],
+   batch-DR1, batch-DR4);
if (ret)
return ret;
}

Modified: head/sys/dev/drm2/i915/i915_drv.h
==
--- head/sys/dev/drm2/i915/i915_drv.h   Wed Aug 26 22:09:12 2015
(r287176)
+++ head/sys/dev/drm2/i915/i915_drv.h   Wed Aug 26 22:19:53 2015
(r287177)
@@ -1120,11 +1120,8 @@ extern int i915_driver_device_is_agp(str
 extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
  unsigned long arg);
 extern int i915_emit_box(struct drm_device *dev,
-struct drm_clip_rect __user *boxes,
-int i, int DR1, int DR4);
-int i915_emit_box_p(struct drm_device *dev, struct drm_clip_rect *box,
-int DR1, int DR4);
-
+struct drm_clip_rect *box,
+int DR1, int DR4);
 unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
 unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
 void i915_update_gfx_val(struct drm_i915_private *dev_priv);

Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c
==
--- head/sys/dev/drm2/i915/i915_gem_execbuffer.cWed Aug 26 22:09:12 
2015(r287176)
+++ head/sys/dev/drm2/i915/i915_gem_execbuffer.cWed Aug 26 22:19:53 
2015(r287177)
@@ -1372,7 +1372,7 @@ i915_gem_do_execbuffer(struct drm_device
 
if (cliprects) {
for (i = 0; i  args-num_cliprects; i++) {
-   ret = i915_emit_box_p(dev, cliprects[i],
+   ret = i915_emit_box(dev, cliprects[i],
args-DR1, args-DR4);
if (ret)
goto err;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287179 - head/usr.bin/sockstat

2015-08-26 Thread Michael Tuexen
Author: tuexen
Date: Wed Aug 26 22:52:18 2015
New Revision: 287179
URL: https://svnweb.freebsd.org/changeset/base/287179

Log:
  Remove a variable which is set but never used.
  
  PR:   201585
  MFC after:3 weeks

Modified:
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cWed Aug 26 22:50:53 2015
(r287178)
+++ head/usr.bin/sockstat/sockstat.cWed Aug 26 22:52:18 2015
(r287179)
@@ -542,9 +542,9 @@ gather_inet(int proto)
const char *varname, *protoname;
size_t len, bufsize;
void *buf;
-   int hash, retry, state, vflag;
+   int hash, retry, vflag;
 
-   state = vflag = 0;
+   vflag = 0;
if (opt_4)
vflag |= INP_IPV4;
if (opt_6)
@@ -609,7 +609,6 @@ gather_inet(int proto)
inp = xtp-xt_inp;
so = xtp-xt_socket;
protoname = xtp-xt_tp.t_flags  TF_TOE ? toe : tcp;
-   state = xtp-xt_tp.t_state;
break;
case IPPROTO_UDP:
case IPPROTO_DIVERT:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287178 - head/usr.bin/sockstat

2015-08-26 Thread Michael Tuexen
Author: tuexen
Date: Wed Aug 26 22:50:53 2015
New Revision: 287178
URL: https://svnweb.freebsd.org/changeset/base/287178

Log:
  Print the status on the first line of a socket description, not at
  the last one. This doesn't matter for TCP, but it does for the upcoming
  SCTP support.
  
  PR:   201585
  MFC after:3 weeks

Modified:
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cWed Aug 26 22:19:53 2015
(r287177)
+++ head/usr.bin/sockstat/sockstat.cWed Aug 26 22:50:53 2015
(r287178)
@@ -911,7 +911,7 @@ static void
 displaysock(struct sock *s, int pos)
 {
void *p;
-   int hash;
+   int hash, first;
struct addr *laddr, *faddr;
struct sock *s_tmp;
 
@@ -924,6 +924,7 @@ displaysock(struct sock *s, int pos)
pos += xprintf(6 );
laddr = s-laddr;
faddr = s-faddr;
+   first = 1;
while (laddr != NULL || faddr != NULL) {
while (pos  36)
pos += xprintf( );
@@ -975,6 +976,14 @@ displaysock(struct sock *s, int pos)
default:
abort();
}
+   if (first  opt_s  s-proto == IPPROTO_TCP) {
+   while (pos  80)
+   pos += xprintf( );
+   if (s-state = 0  s-state  TCP_NSTATES)
+   pos += xprintf(%s, tcpstates[s-state]);
+   else
+   pos += xprintf(?);
+   }
if (laddr != NULL)
laddr = laddr-next;
if (faddr != NULL)
@@ -983,15 +992,9 @@ displaysock(struct sock *s, int pos)
xprintf(\n);
pos = 0;
}
+   first = 0;
}
-   if (opt_s  s-proto == IPPROTO_TCP) {
-   while (pos  80)
-   pos += xprintf( );
-   if (s-state = 0  s-state  TCP_NSTATES)
-   pos += xprintf(%s, tcpstates[s-state]);
-   else
-   pos += xprintf(?);
-   }
+   xprintf(\n);
 }
 
 static void
@@ -1036,7 +1039,6 @@ display(void)
pos += xprintf( );
pos += xprintf(%d , xf-xf_fd);
displaysock(s, pos);
-   xprintf(\n);
}
}
if (opt_j = 0)
@@ -1051,7 +1053,6 @@ display(void)
pos += xprintf(%-8s %-10s %-5s %-2s ,
?, ?, ?, ?);
displaysock(s, pos);
-   xprintf(\n);
}
}
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287174 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
On Thu, Aug 27, 2015 at 12:53:11AM +0300, Konstantin Belousov wrote:
 On Wed, Aug 26, 2015 at 09:35:16PM +, Baptiste Daroussin wrote:
  -static bool
  +static inline bool
   i915_gem_object_is_inactive(struct drm_i915_gem_object *obj)
   {
  -
  -   return !obj-active;
  +   return obj-gtt_space  !obj-active;
 Why is this correct ?

Sorry this change is a mistake and was not supposed to be added with reduction
of the diff.

I'm backing it out for now.

Best regards,
Bapt


pgpwP4Cz1vhoF.pgp
Description: PGP signature


Re: svn commit: r287174 - head/sys/dev/drm2/i915

2015-08-26 Thread Jean-Sébastien Pédron
On 26.08.2015 23:53, Konstantin Belousov wrote:
 On Wed, Aug 26, 2015 at 09:35:16PM +, Baptiste Daroussin wrote:
 -static bool
 +static inline bool
  i915_gem_object_is_inactive(struct drm_i915_gem_object *obj)
  {
 -
 -return !obj-active;
 +return obj-gtt_space  !obj-active;

 Why is this correct ?

obj-gtt_space is NULL when the object is not mapped in the global GTT.
This check was added in 6c085a728cf000ac1865d66f8c9b52935558b328
(drm/i915: Track unbound pages), first released in Linux 3.7.

But now that I think of it again, it may not be correct with the current
driver (and only correct in the context of a 3.8-era driver).

Baptiste, could you please revert that part?

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


svn commit: r287172 - head/sys/dev/drm2

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 21:31:04 2015
New Revision: 287172
URL: https://svnweb.freebsd.org/changeset/base/287172

Log:
  Add more DRM_* debug macros from linux 3.8.13

Modified:
  head/sys/dev/drm2/drmP.h

Modified: head/sys/dev/drm2/drmP.h
==
--- head/sys/dev/drm2/drmP.hWed Aug 26 21:17:48 2015(r287171)
+++ head/sys/dev/drm2/drmP.hWed Aug 26 21:31:04 2015(r287172)
@@ -204,18 +204,43 @@ struct drm_device;
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_DEBUG_KMS(fmt, ...) do {   \
+#define DRM_DEBUG_DRIVER(fmt, ...) do {
\
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME :KMS:pid%d:%s]  fmt, DRM_CURRENTPID,\
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_DEBUG_DRIVER(fmt, ...) do {
\
+#define DRM_DEBUG_KMS(fmt, ...) do {   \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME :KMS:pid%d:%s]  fmt, DRM_CURRENTPID,\
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
+#define DRM_LOG(fmt, args...) do { \
+   if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
+   printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,\
+   __func__ , ##__VA_ARGS__);  \
+} while (0)
+
+#define DRM_LOG_KMS(fmt, args...) do { \
+   if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
+   printf([ DRM_NAME ]:KMS:pid%d:%s] fmt, DRM_CURRENTPID,\
+   __func__ , ##__VA_ARGS__);  \
+} while (0)
+
+#define DRM_LOG_MODE(fmt, args...) do {\
+   if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
+   printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,\
+   __func__ , ##__VA_ARGS__);  \
+} while (0)
+
+#define DRM_LOG_DRIVER(fmt, args...) do {  \
+   if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
+   printf([ DRM_NAME ]:KMS:pid%d:%s] fmt, DRM_CURRENTPID,\
+   __func__ , ##__VA_ARGS__);  \
+} while (0)
+
+
 /*@}*/
 
 /***/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287176 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 22:09:12 2015
New Revision: 287176
URL: https://svnweb.freebsd.org/changeset/base/287176

Log:
  Back out a change which should not have been committed yet

Modified:
  head/sys/dev/drm2/i915/i915_gem.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Wed Aug 26 22:00:40 2015
(r287175)
+++ head/sys/dev/drm2/i915/i915_gem.c   Wed Aug 26 22:09:12 2015
(r287176)
@@ -206,7 +206,7 @@ int i915_mutex_lock_interruptible(struct
 static inline bool
 i915_gem_object_is_inactive(struct drm_i915_gem_object *obj)
 {
-   return obj-gtt_space  !obj-active;
+   return !obj-active;
 }
 
 int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r286880 - head/sys/kern

2015-08-26 Thread Hans Petter Selasky

On 08/26/15 09:25, Hans Petter Selasky wrote:

On 08/18/15 12:15, Julien Charbon wrote:

Author: jch
Date: Tue Aug 18 10:15:09 2015
New Revision: 286880
URL: https://svnweb.freebsd.org/changeset/base/286880

Log:
   callout_stop() should return 0 (fail) when the callout is currently
   being serviced and indeed unstoppable.

   A scenario to reproduce this case is:

   - the callout is being serviced and at same time,
   - callout_reset() is called on this callout that sets
 the CALLOUT_PENDING flag and at same time,
   - callout_stop() is called on this callout and returns 1 (success)
 even if the callout is indeed currently running and unstoppable.

   This issue was caught up while making r284245 (D2763) workaround, and
   was discussed at BSDCan 2015.  Once applied the r284245 workaround
   is not needed anymore and will be reverted.

   Differential Revision:https://reviews.freebsd.org/D3078
   Reviewed by:jhb
   Sponsored by:Verisign, Inc.

Modified:
   head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==

--- head/sys/kern/kern_timeout.cTue Aug 18 10:07:03 2015(r286879)
+++ head/sys/kern/kern_timeout.cTue Aug 18 10:15:09 2015(r286880)
@@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in
  struct callout_cpu *cc, *old_cc;
  struct lock_class *class;
  int direct, sq_locked, use_lock;
-int not_on_a_list;
+int not_on_a_list, not_running;

  if (safe)
  WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c-c_lock,
@@ -1378,8 +1378,15 @@ again:
  }
  }
  callout_cc_del(c, cc);
+
+/*
+ * If we are asked to stop a callout which is currently in progress
+ * and indeed impossible to stop then return 0.
+ */
+not_running = !(cc_exec_curr(cc, direct) == c);
+
  CC_UNLOCK(cc);
-return (1);
+return (not_running);
  }

  void




Hi,

I think this patch is incomplete and can break the return value for
non-MPSAFE callouts. I think the correct statement should check the
value of use_lock too:

 not_running = !(cc_exec_curr(cc, direct) == c  use_lock == 0);

Because if the callback process waits for lock c_lock in the callback
process then we have above cc_exec_curr(cc, direct) == c is satisfied
too, and non-MPSAFE callouts are always cancelable, via
cc_exec_cancel(cc, direct) = true;


class-lc_lock(c_lock, lock_status);
/*
 * The callout may have been cancelled
 * while we switched locks.
 */
if (cc_exec_cancel(cc, direct)) {
class-lc_unlock(c_lock);
goto skip;
}
/* The callout cannot be stopped now. */
cc_exec_cancel(cc, direct) = true;


--HPS



Hi,

I'm sorry to say, but I think this change should be backed out as it 
changes the behaviour of the callout API. The old code was correct. The 
issues should be fixed in the TCP stack instead, like suggested by D1563 
and also r284245.


This patch introduces new behaviour to the callout_stop() function, 
which is contradicting man 9 callout and _not_ documented anywhere!


Reading man 9 callout in 11-current:


 The callout_reset() and callout_schedule() function families schedule a
 future function invocation for callout c.  If c already has a pending
 callout, it is cancelled before the new invocation is scheduled.


callout_reset() causes a _new_ callout invocation and it is logical that 
the return value of callout_stop() reflect operations on the _new_ 
callout invocation and not the previous one.



 The function callout_stop() cancels a callout c if it is currently pend-
 ing.  If the callout is pending, then callout_stop() returns a non-zero
 value.  If the callout is not set, has already been serviced, or is cur-
 rently being serviced, then zero will be returned.  If the callout has an
 associated lock, then that lock must be held when this function is
 called.


If there are two callout invocations that callout_stop() needs to 
handle, it should be called twice.


The correct way is:

callout_reset();
callout_stop();
callout_drain();

For the TCP stack's matter, it should be:

callout_reset();
callout_stop(); /* cancel _new_ callout invocation */
callout_stop(); /* check for any pending callout invokation */

Remember there are other OS'es out there using our TCP/IP stack which do 
not have an identical callout subsystem.


--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287160 - head/sys/arm64/conf

2015-08-26 Thread Andrew Turner
Author: andrew
Date: Wed Aug 26 10:32:23 2015
New Revision: 287160
URL: https://svnweb.freebsd.org/changeset/base/287160

Log:
  Add a above the virtio section.

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Wed Aug 26 09:27:44 2015(r287159)
+++ head/sys/arm64/conf/GENERIC Wed Aug 26 10:32:23 2015(r287160)
@@ -84,6 +84,7 @@ options   WITNESS # Enable checks to de
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 
+# VirtIO support
 device virtio
 device virtio_mmio
 device virtio_blk
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r286880 - head/sys/kern

2015-08-26 Thread Hans Petter Selasky

On 08/18/15 12:15, Julien Charbon wrote:

Author: jch
Date: Tue Aug 18 10:15:09 2015
New Revision: 286880
URL: https://svnweb.freebsd.org/changeset/base/286880

Log:
   callout_stop() should return 0 (fail) when the callout is currently
   being serviced and indeed unstoppable.

   A scenario to reproduce this case is:

   - the callout is being serviced and at same time,
   - callout_reset() is called on this callout that sets
 the CALLOUT_PENDING flag and at same time,
   - callout_stop() is called on this callout and returns 1 (success)
 even if the callout is indeed currently running and unstoppable.

   This issue was caught up while making r284245 (D2763) workaround, and
   was discussed at BSDCan 2015.  Once applied the r284245 workaround
   is not needed anymore and will be reverted.

   Differential Revision:   https://reviews.freebsd.org/D3078
   Reviewed by: jhb
   Sponsored by:Verisign, Inc.

Modified:
   head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cTue Aug 18 10:07:03 2015
(r286879)
+++ head/sys/kern/kern_timeout.cTue Aug 18 10:15:09 2015
(r286880)
@@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in
struct callout_cpu *cc, *old_cc;
struct lock_class *class;
int direct, sq_locked, use_lock;
-   int not_on_a_list;
+   int not_on_a_list, not_running;

if (safe)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c-c_lock,
@@ -1378,8 +1378,15 @@ again:
}
}
callout_cc_del(c, cc);
+
+   /*
+* If we are asked to stop a callout which is currently in progress
+* and indeed impossible to stop then return 0.
+*/
+   not_running = !(cc_exec_curr(cc, direct) == c);
+
CC_UNLOCK(cc);
-   return (1);
+   return (not_running);
  }

  void




Hi,

I think this patch is incomplete and can break the return value for 
non-MPSAFE callouts. I think the correct statement should check the 
value of use_lock too:


not_running = !(cc_exec_curr(cc, direct) == c  use_lock == 0);

Because if the callback process waits for lock c_lock in the callback 
process then we have above cc_exec_curr(cc, direct) == c is satisfied 
too, and non-MPSAFE callouts are always cancelable, via 
cc_exec_cancel(cc, direct) = true;



class-lc_lock(c_lock, lock_status);
/*
 * The callout may have been cancelled
 * while we switched locks.
 */
if (cc_exec_cancel(cc, direct)) {
class-lc_unlock(c_lock);
goto skip;
}
/* The callout cannot be stopped now. */
cc_exec_cancel(cc, direct) = true;


--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287163 - head/usr.bin/script

2015-08-26 Thread Sergey Kandaurov
Author: pluknet
Date: Wed Aug 26 11:54:40 2015
New Revision: 287163
URL: https://svnweb.freebsd.org/changeset/base/287163

Log:
  Fix SEE ALSO.
  
  The history mechanism applies to csh.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/usr.bin/script/script.1

Modified: head/usr.bin/script/script.1
==
--- head/usr.bin/script/script.1Wed Aug 26 11:36:23 2015
(r287162)
+++ head/usr.bin/script/script.1Wed Aug 26 11:54:40 2015
(r287163)
@@ -164,13 +164,13 @@ is assumed.
 .Pq Most shells set this variable automatically .
 .El
 .Sh SEE ALSO
-.Xr csh 1 ,
-.Xr filemon 4
+.Xr csh 1
 .Po
 for the
 .Em history
 mechanism
-.Pc .
+.Pc ,
+.Xr filemon 4
 .Sh HISTORY
 The
 .Nm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287161 - head/sys/dev/mmc/host

2015-08-26 Thread Andrew Turner
Author: andrew
Date: Wed Aug 26 10:54:14 2015
New Revision: 287161
URL: https://svnweb.freebsd.org/changeset/base/287161

Log:
  Only access the Samsung registers when targeting Samsung hardware.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Wed Aug 26 10:32:23 2015
(r287160)
+++ head/sys/dev/mmc/host/dwmmc.c   Wed Aug 26 10:54:14 2015
(r287161)
@@ -582,7 +582,7 @@ dwmmc_attach(device_t dev)
if ((sc-hwtype  HWTYPE_MASK) == HWTYPE_ROCKCHIP) {
sc-use_pio = 1;
sc-pwren_inverted = 1;
-   } else {
+   } else if ((sc-hwtype  HWTYPE_MASK) == HWTYPE_EXYNOS) {
WRITE4(sc, EMMCP_MPSBEGIN0, 0);
WRITE4(sc, EMMCP_SEND0, 0);
WRITE4(sc, EMMCP_CTRL0, (MPSCTRL_SECURE_READ_BIT |
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287162 - in head/sys: arm64/conf conf

2015-08-26 Thread Andrew Turner
Author: andrew
Date: Wed Aug 26 11:36:23 2015
New Revision: 287162
URL: https://svnweb.freebsd.org/changeset/base/287162

Log:
  Add an option to select which SoCs we are building for. It is intended to
  be used with any SoC specific drivers, for example a ThunderX nic driver
  would use something like the following in files.arm64:
  
  arm64/cavium/thunder_nic.c optional soc_cavm_thunderx thndr_nic
  
  Reviewed by:  imp
  Sponsored by: ABT Systems Ltd
  Differential Revision:https://reviews.freebsd.org/D3479

Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files.arm64
  head/sys/conf/options.arm64

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Wed Aug 26 10:54:14 2015(r287161)
+++ head/sys/arm64/conf/GENERIC Wed Aug 26 11:36:23 2015(r287162)
@@ -84,6 +84,9 @@ options   WITNESS # Enable checks to de
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 
+# SoC support
+optionsSOC_CAVM_THUNDERX
+
 # VirtIO support
 device virtio
 device virtio_mmio
@@ -92,7 +95,6 @@ devicevtnet
 
 # Bus drivers
 device pci
-device thunder_pci
 
 # Ethernet NICs
 device em  # Intel PRO/1000 Gigabit Ethernet Family

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Wed Aug 26 10:54:14 2015(r287161)
+++ head/sys/conf/files.arm64   Wed Aug 26 11:36:23 2015(r287162)
@@ -50,9 +50,9 @@ arm64/arm64/uma_machdep.c standard
 arm64/arm64/unwind.c   optionalddb | kdtrace_hooks | stack
 arm64/arm64/vfp.c  standard
 arm64/arm64/vm_machdep.c   standard
-arm64/cavium/thunder_pcie.coptionalthunder_pci fdt
-arm64/cavium/thunder_pcie_pem.coptionalthunder_pci
-arm64/cavium/thunder_pcie_common.c optionalthunder_pci
+arm64/cavium/thunder_pcie.coptionalsoc_cavm_thunderx pci fdt
+arm64/cavium/thunder_pcie_pem.coptionalsoc_cavm_thunderx pci
+arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci
 crypto/blowfish/bf_enc.c   optionalcrypto | ipsec
 crypto/des/des_enc.c   optionalcrypto | ipsec | netsmb
 dev/acpica/acpi_if.m   optionalacpi

Modified: head/sys/conf/options.arm64
==
--- head/sys/conf/options.arm64 Wed Aug 26 10:54:14 2015(r287161)
+++ head/sys/conf/options.arm64 Wed Aug 26 11:36:23 2015(r287162)
@@ -5,3 +5,6 @@ SOCDEV_PA   opt_global.h
 SOCDEV_VA  opt_global.h
 THUNDERX_PASS_1_1_ERRATA   opt_global.h
 VFPopt_global.h
+
+# SoC Support
+SOC_CAVM_THUNDERX  opt_soc.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287164 - head/sys/arm64/arm64

2015-08-26 Thread Zbigniew Bodek
Author: zbb
Date: Wed Aug 26 12:32:46 2015
New Revision: 287164
URL: https://svnweb.freebsd.org/changeset/base/287164

Log:
  Fix race condition in its_cmd_send()
  
  its_cmd_send() can be called by multiple CPUs simultaneously.
  After the command is pushed to ITS command ring the completion
  status is polled using global pointer to the next free ring slot.
  Use copied pointer and provide correct locking to avoid spurious
  pointer value when concurrent access occurs.
  
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D3436

Modified:
  head/sys/arm64/arm64/gic_v3_its.c

Modified: head/sys/arm64/arm64/gic_v3_its.c
==
--- head/sys/arm64/arm64/gic_v3_its.c   Wed Aug 26 11:54:40 2015
(r287163)
+++ head/sys/arm64/arm64/gic_v3_its.c   Wed Aug 26 12:32:46 2015
(r287164)
@@ -1311,16 +1311,16 @@ its_cmd_wait_completion(struct gic_v3_it
 static int
 its_cmd_send(struct gic_v3_its_softc *sc, struct its_cmd_desc *desc)
 {
-   struct its_cmd *cmd, *cmd_sync;
+   struct its_cmd *cmd, *cmd_sync, *cmd_write;
struct its_col col_sync;
struct its_cmd_desc desc_sync;
uint64_t target, cwriter;
 
mtx_lock_spin(sc-its_spin_mtx);
cmd = its_cmd_alloc_locked(sc);
-   mtx_unlock_spin(sc-its_spin_mtx);
if (cmd == NULL) {
device_printf(sc-dev, could not allocate ITS command\n);
+   mtx_unlock_spin(sc-its_spin_mtx);
return (EBUSY);
}
 
@@ -1328,9 +1328,7 @@ its_cmd_send(struct gic_v3_its_softc *sc
its_cmd_sync(sc, cmd);
 
if (target != ITS_TARGET_NONE) {
-   mtx_lock_spin(sc-its_spin_mtx);
cmd_sync = its_cmd_alloc_locked(sc);
-   mtx_unlock_spin(sc-its_spin_mtx);
if (cmd_sync == NULL)
goto end;
desc_sync.cmd_type = ITS_CMD_SYNC;
@@ -1341,12 +1339,12 @@ its_cmd_send(struct gic_v3_its_softc *sc
}
 end:
/* Update GITS_CWRITER */
-   mtx_lock_spin(sc-its_spin_mtx);
cwriter = its_cmd_cwriter_offset(sc, sc-its_cmdq_write);
gic_its_write(sc, 8, GITS_CWRITER, cwriter);
+   cmd_write = sc-its_cmdq_write;
mtx_unlock_spin(sc-its_spin_mtx);
 
-   its_cmd_wait_completion(sc, cmd, sc-its_cmdq_write);
+   its_cmd_wait_completion(sc, cmd, cmd_write);
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287165 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 13:23:56 2015
New Revision: 287165
URL: https://svnweb.freebsd.org/changeset/base/287165

Log:
  Reduce diff on i915_dma.c against linux 3.8.13
  
  No functional changes
  
  Discussed with:   dumbbell
  Reviewed by:  dumbbell

Modified:
  head/sys/dev/drm2/i915/i915_dma.c

Modified: head/sys/dev/drm2/i915/i915_dma.c
==
--- head/sys/dev/drm2/i915/i915_dma.c   Wed Aug 26 12:32:46 2015
(r287164)
+++ head/sys/dev/drm2/i915/i915_dma.c   Wed Aug 26 13:23:56 2015
(r287165)
@@ -1,6 +1,6 @@
 /* i915_dma.c -- DMA support for the I915 -*- linux-c -*-
  */
-/*-
+/*
  * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
  * All Rights Reserved.
  *
@@ -47,6 +47,12 @@ __FBSDID($FreeBSD$);
 #define ADVANCE_LP_RING() \
intel_ring_advance(LP_RING(dev_priv))
 
+/**
+ * Lock test for when it's just for synchronization of ring access.
+ *
+ * In that case, we don't need to do it when GEM is initialized as nobody else
+ * has access to the ring.
+ */
 #define RING_LOCK_TEST_WITH_RETURN(dev, file) do { \
if (LP_RING(dev-dev_private)-obj == NULL) \
LOCK_TEST_WITH_RETURN(dev, file);   \
@@ -179,7 +185,6 @@ static int i915_dma_cleanup(struct drm_d
drm_i915_private_t *dev_priv = dev-dev_private;
int i;
 
-
/* Make sure interrupts are disabled here because the uninstall ioctl
 * may not have been called from userspace and after dev_private
 * is freed, it's too late.
@@ -208,7 +213,7 @@ static int i915_initialize(struct drm_de
master_priv-sarea = drm_getsarea(dev);
if (master_priv-sarea) {
master_priv-sarea_priv = (drm_i915_sarea_t *)
-   ((u8 *)master_priv-sarea-handle + 
init-sarea_priv_offset);
+   ((u8 *)master_priv-sarea-handle + 
init-sarea_priv_offset);
} else {
DRM_DEBUG_DRIVER(sarea not found assuming DRI2 userspace\n);
}
@@ -309,7 +314,7 @@ static int i915_dma_init(struct drm_devi
  * instruction detected will be given a size of zero, which is a
  * signal to abort the rest of the buffer.
  */
-static int do_validate_cmd(int cmd)
+static int validate_cmd(int cmd)
 {
switch (((cmd  29)  0x7)) {
case 0x0:
@@ -367,17 +372,7 @@ static int do_validate_cmd(int cmd)
return 0;
 }
 
-static int validate_cmd(int cmd)
-{
-   int ret = do_validate_cmd(cmd);
-
-/* printk(validate_cmd( %x ): %d\n, cmd, ret); */
-
-   return ret;
-}
-
-static int i915_emit_cmds(struct drm_device *dev, int __user *buffer,
- int dwords)
+static int i915_emit_cmds(struct drm_device * dev, int *buffer, int dwords)
 {
drm_i915_private_t *dev_priv = dev-dev_private;
int i;
@@ -429,14 +424,15 @@ int i915_emit_box(struct drm_device * de
 }
 
 int
-i915_emit_box_p(struct drm_device *dev, struct drm_clip_rect *box,
-int DR1, int DR4)
+i915_emit_box_p(struct drm_device *dev,
+ struct drm_clip_rect *box,
+ int DR1, int DR4)
 {
-   drm_i915_private_t *dev_priv = dev-dev_private;
+   struct drm_i915_private *dev_priv = dev-dev_private;
int ret;
 
-   if (box-y2 = box-y1 || box-x2 = box-x1 || box-y2 = 0 ||
-   box-x2 = 0) {
+   if (box-y2 = box-y1 || box-x2 = box-x1 ||
+   box-y2 = 0 || box-x2 = 0) {
DRM_ERROR(Bad box %d,%d..%d,%d\n,
  box-x1, box-y1, box-x2, box-y2);
return -EINVAL;
@@ -444,8 +440,8 @@ i915_emit_box_p(struct drm_device *dev, 
 
if (INTEL_INFO(dev)-gen = 4) {
ret = BEGIN_LP_RING(4);
-   if (ret != 0)
-   return (ret);
+   if (ret)
+   return ret;
 
OUT_RING(GFX_OP_DRAWRECT_INFO_I965);
OUT_RING((box-x1  0x) | (box-y1  16));
@@ -453,8 +449,8 @@ i915_emit_box_p(struct drm_device *dev, 
OUT_RING(DR4);
} else {
ret = BEGIN_LP_RING(6);
-   if (ret != 0)
-   return (ret);
+   if (ret)
+   return ret;
 
OUT_RING(GFX_OP_DRAWRECT_INFO);
OUT_RING(DR1);
@@ -492,7 +488,9 @@ static void i915_emit_breadcrumb(struct 
 }
 
 static int i915_dispatch_cmdbuffer(struct drm_device * dev,
-drm_i915_cmdbuffer_t * cmd, struct drm_clip_rect *cliprects, void *cmdbuf)
+  drm_i915_cmdbuffer_t *cmd,
+  struct drm_clip_rect *cliprects,
+  void *cmdbuf)
 {
int nbox = cmd-num_cliprects;
int i = 0, count, ret;
@@ -523,11 +521,11 @@ static int i915_dispatch_cmdbuffer(struc
return 0;
 }
 
-static int
-i915_dispatch_batchbuffer(struct drm_device * dev,
- 

svn commit: r287182 - head/usr.bin/sockstat

2015-08-26 Thread Michael Tuexen
Author: tuexen
Date: Wed Aug 26 23:45:06 2015
New Revision: 287182
URL: https://svnweb.freebsd.org/changeset/base/287182

Log:
  Add SCTP support.
  
  PR:   201585
  MFC after:3 weeks

Modified:
  head/usr.bin/sockstat/sockstat.1
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.1
==
--- head/usr.bin/sockstat/sockstat.1Wed Aug 26 23:28:10 2015
(r287181)
+++ head/usr.bin/sockstat/sockstat.1Wed Aug 26 23:45:06 2015
(r287182)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 14, 2015
+.Dd August 27, 2015
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -85,7 +85,7 @@ as they are defined in
 .Xr protocols 5 .
 .It Fl s
 Display the protocol state, if applicable.
-This is currently only implemented for TCP.
+This is currently only implemented for SCTP and TCP.
 .It Fl u
 Show
 .Dv AF_LOCAL

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cWed Aug 26 23:28:10 2015
(r287181)
+++ head/usr.bin/sockstat/sockstat.cWed Aug 26 23:45:06 2015
(r287182)
@@ -332,6 +332,12 @@ gather_sctp(void)
sock-socket = xinpcb-socket;
sock-proto = IPPROTO_SCTP;
sock-protoname = sctp;
+   if (xinpcb-flags  SCTP_PCB_FLAGS_UNBOUND)
+   sock-state = SCTP_CLOSED;
+   else if (xinpcb-maxqlen == 0)
+   sock-state = SCTP_BOUND;
+   else
+   sock-state = SCTP_LISTEN;
if (xinpcb-flags  SCTP_PCB_FLAGS_BOUND_V6) {
sock-family = AF_INET6;
sock-vflag = INP_IPV6;
@@ -421,6 +427,7 @@ gather_sctp(void)
sock-socket = xinpcb-socket;
sock-proto = IPPROTO_SCTP;
sock-protoname = sctp;
+   sock-state = (int)xstcb-state;
if (xinpcb-flags  SCTP_PCB_FLAGS_BOUND_V6) {
sock-family = AF_INET6;
sock-vflag = INP_IPV6;
@@ -906,6 +913,46 @@ check_ports(struct sock *s)
return (0);
 }
 
+static const char *
+sctp_state(int state)
+{
+   switch (state) {
+   case SCTP_CLOSED:
+   return CLOSED;
+   break;
+   case SCTP_BOUND:
+   return BOUND;
+   break;
+   case SCTP_LISTEN:
+   return LISTEN;
+   break;
+   case SCTP_COOKIE_WAIT:
+   return COOKIE_WAIT;
+   break;
+   case SCTP_COOKIE_ECHOED:
+   return COOKIE_ECHOED;
+   break;
+   case SCTP_ESTABLISHED:
+   return ESTABLISHED;
+   break;
+   case SCTP_SHUTDOWN_SENT:
+   return SHUTDOWN_SENT;
+   break;
+   case SCTP_SHUTDOWN_RECEIVED:
+   return SHUTDOWN_RECEIVED;
+   break;
+   case SCTP_SHUTDOWN_ACK_SENT:
+   return SHUTDOWN_ACK_SENT;
+   break;
+   case SCTP_SHUTDOWN_PENDING:
+   return SHUTDOWN_PENDING;
+   break;
+   default:
+   return UNKNOWN;
+   break;
+   }
+}
+
 static void
 displaysock(struct sock *s, int pos)
 {
@@ -975,13 +1022,22 @@ displaysock(struct sock *s, int pos)
default:
abort();
}
-   if (first  opt_s  s-proto == IPPROTO_TCP) {
+   if (first  opt_s 
+   (s-proto == IPPROTO_SCTP || s-proto == IPPROTO_TCP)) {
while (pos  80)
pos += xprintf( );
-   if (s-state = 0  s-state  TCP_NSTATES)
-   pos += xprintf(%s, tcpstates[s-state]);
-   else
-   pos += xprintf(?);
+   switch (s-proto) {
+   case IPPROTO_SCTP:
+   pos += xprintf(%s, sctp_state(s-state));
+   break;
+   case IPPROTO_TCP:
+   if (s-state = 0  s-state  TCP_NSTATES)
+   pos +=
+   xprintf(%s, tcpstates[s-state]);
+   else
+   pos += xprintf(?);
+   break;
+   }
}
if (laddr != NULL)
laddr = laddr-next;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r287174 - head/sys/dev/drm2/i915

2015-08-26 Thread Bjoern A. Zeeb

 On 26 Aug 2015, at 21:35 , Baptiste Daroussin b...@freebsd.org wrote:
 
 Author: bapt
 Date: Wed Aug 26 21:35:16 2015
 New Revision: 287174
 URL: https://svnweb.freebsd.org/changeset/base/287174
 
 Log:
  Reduce diff against linux 3.8
 
  Reviewed by: dumbbell
  Differential Revision:   https://reviews.freebsd.org/D3492
 
 Modified:
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/i915/i915_gem_context.c
  head/sys/dev/drm2/i915/i915_gem_execbuffer.c
  head/sys/dev/drm2/i915/i915_gem_gtt.c
  head/sys/dev/drm2/i915/i915_gem_tiling.c

Not sure I got the right commit but I see these on powerpc.{GENERIC,LINT}64  in 
various instances:

/scratch/tmp/bz/head.svn/sys/dev/drm2/drmP.h:222:17: error: __VA_ARGS__ can 
only appear in the expansion of a C99 variadic macro


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287181 - head/lib/libc/string

2015-08-26 Thread Xin LI
Author: delphij
Date: Wed Aug 26 23:28:10 2015
New Revision: 287181
URL: https://svnweb.freebsd.org/changeset/base/287181

Log:
  Replace strndup with OpenBSD's implementation.
  
  MFC after:2 weeks

Modified:
  head/lib/libc/string/strndup.c

Modified: head/lib/libc/string/strndup.c
==
--- head/lib/libc/string/strndup.c  Wed Aug 26 22:59:58 2015
(r287180)
+++ head/lib/libc/string/strndup.c  Wed Aug 26 23:28:10 2015
(r287181)
@@ -1,32 +1,19 @@
-/*  $NetBSD: strndup.c,v 1.3 2007/01/14 23:41:24 cbiere Exp $   */
+/* $OpenBSD: strndup.c,v 1.1 2010/05/18 22:24:55 tedu Exp $*/
 
 /*
- * Copyright (c) 1988, 1993
- * The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2010 Todd C. Miller todd.mil...@courtesan.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include sys/cdefs.h
@@ -37,15 +24,17 @@ __FBSDID($FreeBSD$);
 #include string.h
 
 char *
-strndup(const char *str, size_t n)
+strndup(const char *str, size_t maxlen)
 {
-   size_t len;
char *copy;
+   size_t len;
+
+   len = strnlen(str, maxlen);
+   copy = malloc(len + 1);
+   if (copy != NULL) {
+   (void)memcpy(copy, str, len);
+   copy[len] = '\0';
+   }
 
-   len = strnlen(str, n);
-   if ((copy = malloc(len + 1)) == NULL)
-   return (NULL);
-   memcpy(copy, str, len);
-   copy[len] = '\0';
-   return (copy);
+   return copy;
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287183 - head/sys/kern

2015-08-26 Thread Warner Losh
Author: imp
Date: Wed Aug 26 23:58:03 2015
New Revision: 287183
URL: https://svnweb.freebsd.org/changeset/base/287183

Log:
  When the kernel is compiled with INVARIANTS, export that as
  debug.invariants.
  
  Differential Revision: https://reviews.freebsd.org/D3488
  MFC after: 3 days

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Wed Aug 26 23:45:06 2015(r287182)
+++ head/sys/kern/init_main.c   Wed Aug 26 23:58:03 2015(r287183)
@@ -117,6 +117,15 @@ intbootverbose = BOOTVERBOSE;
 SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, bootverbose, 0,
Control the output of verbose kernel messages);
 
+/* Want to avoid defining INVARIANTS if not already defined */
+#ifdef INVARIANTS
+static int invariants = 1;
+#else
+static int invariants = 0;
+#endif
+SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, invariants, 0,
+   Kernel compiled with invariants);
+
 /*
  * This ensures that there is at least one entry so that the sysinit_set
  * symbol is not undefined.  A sybsystem ID of SI_SUB_DUMMY is never
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287174 - head/sys/dev/drm2/i915

2015-08-26 Thread Bjoern A. Zeeb

 On 27 Aug 2015, at 00:23 , Bjoern A. Zeeb b...@freebsd.org wrote:
 
 
 On 26 Aug 2015, at 21:35 , Baptiste Daroussin b...@freebsd.org wrote:
 
 Author: bapt
 Date: Wed Aug 26 21:35:16 2015
 New Revision: 287174
 URL: https://svnweb.freebsd.org/changeset/base/287174
 
 Log:
 Reduce diff against linux 3.8
 
 Reviewed by: dumbbell
 Differential Revision:   https://reviews.freebsd.org/D3492
 
 Modified:
 head/sys/dev/drm2/i915/i915_gem.c
 head/sys/dev/drm2/i915/i915_gem_context.c
 head/sys/dev/drm2/i915/i915_gem_execbuffer.c
 head/sys/dev/drm2/i915/i915_gem_gtt.c
 head/sys/dev/drm2/i915/i915_gem_tiling.c
 
 Not sure I got the right commit but I see these on powerpc.{GENERIC,LINT}64  
 in various instances:

r 287172 probably


 
 /scratch/tmp/bz/head.svn/sys/dev/drm2/drmP.h:222:17: error: __VA_ARGS__ can 
 only appear in the expansion of a C99 variadic macro
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287174 - head/sys/dev/drm2/i915

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Wed Aug 26 21:35:16 2015
New Revision: 287174
URL: https://svnweb.freebsd.org/changeset/base/287174

Log:
  Reduce diff against linux 3.8
  
  Reviewed by:  dumbbell
  Differential Revision:https://reviews.freebsd.org/D3492

Modified:
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/i915/i915_gem_context.c
  head/sys/dev/drm2/i915/i915_gem_execbuffer.c
  head/sys/dev/drm2/i915/i915_gem_gtt.c
  head/sys/dev/drm2/i915/i915_gem_tiling.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Wed Aug 26 21:33:43 2015
(r287173)
+++ head/sys/dev/drm2/i915/i915_gem.c   Wed Aug 26 21:35:16 2015
(r287174)
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright © 2008 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -203,11 +203,10 @@ int i915_mutex_lock_interruptible(struct
return 0;
 }
 
-static bool
+static inline bool
 i915_gem_object_is_inactive(struct drm_i915_gem_object *obj)
 {
-
-   return !obj-active;
+   return obj-gtt_space  !obj-active;
 }
 
 int
@@ -1239,9 +1238,17 @@ i915_gem_set_domain_ioctl(struct drm_dev
uint32_t write_domain = args-write_domain;
int ret;
 
-   if ((write_domain  I915_GEM_GPU_DOMAINS) != 0 ||
-   (read_domains  I915_GEM_GPU_DOMAINS) != 0 ||
-   (write_domain != 0  read_domains != write_domain))
+   /* Only handle setting domains to types used by the CPU. */
+   if (write_domain  I915_GEM_GPU_DOMAINS)
+   return -EINVAL;
+
+   if (read_domains  I915_GEM_GPU_DOMAINS)
+   return -EINVAL;
+
+   /* Having something in the write domain implies it's in the read
+* domain, and only that read domain.  Enforce that in the request.
+*/
+   if (write_domain != 0  read_domains != write_domain)
return -EINVAL;
 
ret = i915_mutex_lock_interruptible(dev);
@@ -1686,13 +1693,11 @@ i915_gem_get_unfenced_gtt_alignment(stru
uint32_t size,
int tiling_mode)
 {
-   if (tiling_mode == I915_TILING_NONE)
-   return 4096;
-
/*
 * Minimum alignment is 4k (GTT page size) for sane hw.
 */
-   if (INTEL_INFO(dev)-gen = 4 || IS_G33(dev))
+   if (INTEL_INFO(dev)-gen = 4 || IS_G33(dev) ||
+   tiling_mode == I915_TILING_NONE)
return 4096;
 
/* Previous hardware however needs to be aligned to a power-of-two
@@ -3155,7 +3160,7 @@ i915_gem_object_set_to_gtt_domain(struct
 
ret = i915_gem_object_flush_gpu_write_domain(obj);
if (ret)
-   return (ret);
+   return ret;
 
if (obj-pending_gpu_write || write) {
ret = i915_gem_object_wait_rendering(obj);
@@ -3366,6 +3371,12 @@ i915_gem_object_finish_gpu(struct drm_i9
return 0;
 }
 
+/**
+ * Moves a single object to the CPU read, and possibly write domain.
+ *
+ * This function returns when the move is complete, including waiting on
+ * flushes to occur.
+ */
 int
 i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
 {
@@ -3644,7 +3655,6 @@ int
 i915_gem_throttle_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
 {
-
return i915_gem_ring_throttle(dev, file_priv);
 }
 
@@ -4101,6 +4111,10 @@ i915_gem_unload(struct drm_device *dev)
EVENTHANDLER_DEREGISTER(vm_lowmem, dev_priv-mm.i915_lowmem);
 }
 
+/*
+ * Create a physically contiguous memory object for this object
+ * e.g. for cursor + overlay regs
+ */
 static int i915_gem_init_phys_object(struct drm_device *dev,
 int id, int size, int align)
 {

Modified: head/sys/dev/drm2/i915/i915_gem_context.c
==
--- head/sys/dev/drm2/i915/i915_gem_context.c   Wed Aug 26 21:33:43 2015
(r287173)
+++ head/sys/dev/drm2/i915/i915_gem_context.c   Wed Aug 26 21:35:16 2015
(r287174)
@@ -302,7 +302,7 @@ void i915_gem_context_fini(struct drm_de
do_destroy(dev_priv-rings[RCS].default_context);
 }
 
-static int context_idr_cleanup(uint32_t id, void *p, void *data)
+static int context_idr_cleanup(int id, void *p, void *data)
 {
struct i915_hw_context *ctx = p;
 

Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c
==
--- head/sys/dev/drm2/i915/i915_gem_execbuffer.cWed Aug 26 21:33:43 
2015(r287173)
+++ head/sys/dev/drm2/i915/i915_gem_execbuffer.cWed Aug 26 21:35:16 
2015(r287174)
@@ -405,10 +405,7 @@ i915_gem_execbuffer_relocate_entry(struc
if (ret)
return ret;
 
-   /*
-* Map the page containing the 

Re: svn commit: r287174 - head/sys/dev/drm2/i915

2015-08-26 Thread Konstantin Belousov
On Wed, Aug 26, 2015 at 09:35:16PM +, Baptiste Daroussin wrote:
 -static bool
 +static inline bool
  i915_gem_object_is_inactive(struct drm_i915_gem_object *obj)
  {
 -
 - return !obj-active;
 + return obj-gtt_space  !obj-active;
Why is this correct ?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287191 - head/sys/dev/drm2

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Thu Aug 27 05:27:18 2015
New Revision: 287191
URL: https://svnweb.freebsd.org/changeset/base/287191

Log:
  Fix typo in new macros

Modified:
  head/sys/dev/drm2/drmP.h

Modified: head/sys/dev/drm2/drmP.h
==
--- head/sys/dev/drm2/drmP.hThu Aug 27 04:25:27 2015(r287190)
+++ head/sys/dev/drm2/drmP.hThu Aug 27 05:27:18 2015(r287191)
@@ -216,21 +216,21 @@ struct drm_device;
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG(fmt, args...) do { \
+#define DRM_LOG(fmt, args, ...) do {   \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,\
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG_KMS(fmt, args...) do { \
+#define DRM_LOG_KMS(fmt, args, ...) do {   \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME ]:KMS:pid%d:%s] fmt, DRM_CURRENTPID,\
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG_MODE(fmt, args...) do {\
+#define DRM_LOG_MODE(fmt, args, ...) do {  \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
-   printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,\
+   printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,  \
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287192 - head/sys/dev/drm2

2015-08-26 Thread Baptiste Daroussin
Author: bapt
Date: Thu Aug 27 05:39:32 2015
New Revision: 287192
URL: https://svnweb.freebsd.org/changeset/base/287192

Log:
  More fixes to the new macros

Modified:
  head/sys/dev/drm2/drmP.h

Modified: head/sys/dev/drm2/drmP.h
==
--- head/sys/dev/drm2/drmP.hThu Aug 27 05:27:18 2015(r287191)
+++ head/sys/dev/drm2/drmP.hThu Aug 27 05:39:32 2015(r287192)
@@ -216,25 +216,25 @@ struct drm_device;
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG(fmt, args, ...) do {   \
+#define DRM_LOG(fmt, ...) do { \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
-   printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,\
+   printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,  \
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG_KMS(fmt, args, ...) do {   \
+#define DRM_LOG_KMS(fmt, ...) do { \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME ]:KMS:pid%d:%s] fmt, DRM_CURRENTPID,\
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG_MODE(fmt, args, ...) do {  \
+#define DRM_LOG_MODE(fmt, ...) do {\
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME ]:pid%d:%s] fmt, DRM_CURRENTPID,  \
__func__ , ##__VA_ARGS__);  \
 } while (0)
 
-#define DRM_LOG_DRIVER(fmt, args...) do {  \
+#define DRM_LOG_DRIVER(fmt, ...) do {  \
if ((drm_debug  DRM_DEBUGBITS_KMS) != 0)   \
printf([ DRM_NAME ]:KMS:pid%d:%s] fmt, DRM_CURRENTPID,\
__func__ , ##__VA_ARGS__);  \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287186 - head/share/mk

2015-08-26 Thread Warner Losh
Author: imp
Date: Thu Aug 27 01:55:00 2015
New Revision: 287186
URL: https://svnweb.freebsd.org/changeset/base/287186

Log:
  Automatically append SUBDIR.yes to the SUBDIR variable, and
  remove duplicates. We cannot sort SUBDIR because many Makefiles
  have .WAIT in the list which is strongly ordering. Rather than
  try to second guess when to sort and when to not sort depending
  on .WAIT being in the list, just remove duplicates.

Modified:
  head/share/mk/bsd.subdir.mk

Modified: head/share/mk/bsd.subdir.mk
==
--- head/share/mk/bsd.subdir.mk Thu Aug 27 01:52:45 2015(r287185)
+++ head/share/mk/bsd.subdir.mk Thu Aug 27 01:55:00 2015(r287186)
@@ -16,7 +16,8 @@
 #
 # SUBDIR   A list of subdirectories that should be built as well.
 #  Each of the targets will execute the same target in the
-#  subdirectories.
+#  subdirectories. SUBDIR.yes is automatically appeneded
+#  to this list.
 #
 # +++ targets +++
 #
@@ -43,6 +44,11 @@ _SUBDIR:
 .endif
 .if !target(_SUBDIR)
 
+.if defined(SUBDIR)
+SUBDIR:=${SUBDIR} ${SUBDIR.yes}
+SUBDIR:=${SUBDIR:u}
+.endif
+
 DISTRIBUTION?= base
 .if !target(distribute)
 distribute: .MAKE
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287006 - head/share/mk

2015-08-26 Thread Eric van Gyzen

On 8/21/15 2:51 PM, Warner Losh wrote:

Author: imp
Date: Fri Aug 21 19:51:19 2015
New Revision: 287006
URL: https://svnweb.freebsd.org/changeset/base/287006

Log:
   Document CFLAGS_NO_SIMD.

Modified:
   head/share/mk/bsd.README



Thank you.

Eric
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287188 - head/sys/powerpc/powerpc

2015-08-26 Thread Justin Hibbits
Author: jhibbits
Date: Thu Aug 27 03:44:06 2015
New Revision: 287188
URL: https://svnweb.freebsd.org/changeset/base/287188

Log:
  Use the macro definition for EXC_PGM_TRAP, instead of the magic number.

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Thu Aug 27 02:59:48 2015
(r287187)
+++ head/sys/powerpc/powerpc/trap.c Thu Aug 27 03:44:06 2015
(r287188)
@@ -815,7 +815,7 @@ db_trap_glue(struct trapframe *frame)
 (frame-exc == EXC_TRC || frame-exc == EXC_RUNMODETRC
 #ifdef AIM
|| (frame-exc == EXC_PGM
-(frame-srr1  0x2))
+(frame-srr1  EXC_PGM_TRAP))
 #else
|| (frame-exc == EXC_DEBUG)
 #endif
@@ -827,7 +827,7 @@ db_trap_glue(struct trapframe *frame)
if (*(uint32_t *)frame-srr0 == EXC_DTRACE)
return (0);
 #ifdef AIM
-   if (type == EXC_PGM  (frame-srr1  0x2)) {
+   if (type == EXC_PGM  (frame-srr1  EXC_PGM_TRAP)) {
 #else
if (frame-cpu.booke.esr  ESR_PTR) {
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287189 - in head/sys: conf dev/mmc powerpc/mpc85xx

2015-08-26 Thread Justin Hibbits
Author: jhibbits
Date: Thu Aug 27 03:47:56 2015
New Revision: 287189
URL: https://svnweb.freebsd.org/changeset/base/287189

Log:
  Fix freescale sdhc driver, and add it to the files list.
  
  Also, add it to the mmc DRIVER_MODULE attachment list.

Modified:
  head/sys/conf/files.powerpc
  head/sys/dev/mmc/mmc.c
  head/sys/powerpc/mpc85xx/fsl_sdhc.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Thu Aug 27 03:44:06 2015(r287188)
+++ head/sys/conf/files.powerpc Thu Aug 27 03:47:56 2015(r287189)
@@ -133,6 +133,7 @@ powerpc/mikrotik/platform_rb.c  optional
 powerpc/mpc85xx/atpic.coptionalmpc85xx isa
 powerpc/mpc85xx/ds1553_bus_fdt.c   optionalds1553 fdt
 powerpc/mpc85xx/ds1553_core.c  optionalds1553
+powerpc/mpc85xx/fsl_sdhc.c optionalmpc85xx sdhc
 powerpc/mpc85xx/i2c.c  optionaliicbus fdt
 powerpc/mpc85xx/isa.c  optionalmpc85xx isa
 powerpc/mpc85xx/lbc.c  optionalmpc85xx

Modified: head/sys/dev/mmc/mmc.c
==
--- head/sys/dev/mmc/mmc.c  Thu Aug 27 03:44:06 2015(r287188)
+++ head/sys/dev/mmc/mmc.c  Thu Aug 27 03:47:56 2015(r287189)
@@ -1818,6 +1818,7 @@ DRIVER_MODULE(mmc, aml8726_sdxc, mmc_dri
 DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL);
 DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL);
 DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL);
+DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL);
 DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL);
 DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL);
 DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c
==
--- head/sys/powerpc/mpc85xx/fsl_sdhc.c Thu Aug 27 03:44:06 2015
(r287188)
+++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Thu Aug 27 03:47:56 2015
(r287189)
@@ -117,14 +117,14 @@ static device_method_t fsl_sdhc_methods[
 
 /* kobj_class definition */
 static driver_t fsl_sdhc_driver = {
-   sdhci,
+   sdhci_fsl,
fsl_sdhc_methods,
sizeof(struct fsl_sdhc_softc)
 };
 
 static devclass_t fsl_sdhc_devclass;
 
-DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0);
+DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0);
 
 
 /*
@@ -481,7 +481,7 @@ static void
 finalize_request(struct fsl_sdhc_softc *sc)
 {
 
-   DPRINTF(finishing request %x\n, sc-request);
+   DPRINTF(finishing request %p\n, sc-request);
 
sc-request-done(sc-request);
sc-request = NULL;
@@ -982,7 +982,6 @@ dump_registers(struct fsl_sdhc_softc *sc
 {
printf(PRSSTAT = 0x%08x\n, read4(sc, SDHC_PRSSTAT));
printf(PROCTL = 0x%08x\n, read4(sc, SDHC_PROCTL));
-   printf(PMUXCR = 0x%08x\n, ccsr_read4(OCP85XX_PMUXCR));
printf(HOSTCAPBLT = 0x%08x\n, read4(sc, SDHC_HOSTCAPBLT));
printf(IRQSTAT = 0x%08x\n, read4(sc, SDHC_IRQSTAT));
printf(IRQSTATEN = 0x%08x\n, read4(sc, SDHC_IRQSTATEN));
@@ -990,7 +989,6 @@ dump_registers(struct fsl_sdhc_softc *sc
printf(WML = 0x%08x\n, read4(sc, SDHC_WML));
printf(DSADDR = 0x%08x\n, read4(sc, SDHC_DSADDR));
printf(XFERTYP = 0x%08x\n, read4(sc, SDHC_XFERTYP));
-   printf(ECMCR = 0x%08x\n, ccsr_read4(OCP85XX_ECMCR));
printf(DCR = 0x%08x\n, read4(sc, SDHC_DCR));
 }
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287185 - head/share/mk

2015-08-26 Thread Warner Losh
Author: imp
Date: Thu Aug 27 01:52:45 2015
New Revision: 287185
URL: https://svnweb.freebsd.org/changeset/base/287185

Log:
  For each FOO in FILESLISTS, append the value of FOO.yes, sort, and
  remove duplicates.

Modified:
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Thu Aug 27 01:02:01 2015(r287184)
+++ head/share/mk/bsd.files.mk  Thu Aug 27 01:52:45 2015(r287185)
@@ -10,6 +10,9 @@ __bsd.files.mk__:
 FILESGROUPS?=  FILES
 
 .for group in ${FILESGROUPS}
+# Add in foo.yes and remove duplicates from all the groups
+${${group}}:= ${${group}} ${${group}.yes}
+${${group}}:= ${${group}:O:u}
 buildfiles: ${${group}}
 .endfor
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287187 - head/share/mk

2015-08-26 Thread Warner Losh
Author: imp
Date: Thu Aug 27 02:59:48 2015
New Revision: 287187
URL: https://svnweb.freebsd.org/changeset/base/287187

Log:
  Make sys.mk more compatible with fmake by refraining from using :U
  modifiers.
  
  Differential Revision: https://reviews.freebsd.org/D3228

Modified:
  head/share/mk/sys.mk

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkThu Aug 27 01:55:00 2015(r287186)
+++ head/share/mk/sys.mkThu Aug 27 02:59:48 2015(r287187)
@@ -33,16 +33,23 @@ __DEFAULT_DEPENDENT_OPTIONS= \
 
 # early include for customization
 # see local.sys.mk below
-.-include local.sys.env.mk
+# Not included when building in fmake compatibility mode (still needed
+# for older system support)
+.if defined(.PARSEDIR)
+.sinclude local.sys.env.mk
 
 .if ${MK_META_MODE} == yes
-.-include meta.sys.mk
-.elif ${MK_META_FILES} == yes  ${.MAKEFLAGS:U:M-B} == 
+.sinclude meta.sys.mk
+.elif ${MK_META_FILES} == yes  defined(.MAKEFLAGS)
+.if ${.MAKEFLAGS:M-B} == 
 .MAKE.MODE= meta verbose
 .endif
+.endif
 .if ${MK_AUTO_OBJ} == yes
 # This needs to be done early - before .PATH is computed
-.-include auto.obj.mk
+.sinclude auto.obj.mk
+.endif
+
 .endif
 
 # If the special target .POSIX appears (without prerequisites or
@@ -362,7 +369,7 @@ __MAKE_CONF?=/etc/make.conf
 .endif
 
 # late include for customization
-.-include local.sys.mk
+.sinclude local.sys.mk
 
 .if defined(__MAKE_SHELL)  !empty(__MAKE_SHELL)
 SHELL= ${__MAKE_SHELL}
@@ -379,11 +386,12 @@ SHELL=${__MAKE_SHELL}
 # when running target scripts, this is a problem for many makefiles here.
 # So define a shell that will do what FreeBSD expects.
 .ifndef WITHOUT_SHELL_ERRCTL
+__MAKE_SHELL?=/bin/sh
 .SHELL: name=sh \
quiet=set - echo=set -v filter=set - \
hasErrCtl=yes check=set -e ignore=set +e \
echoFlag=v errFlag=e \
-   path=${__MAKE_SHELL:U/bin/sh}
+   path=${__MAKE_SHELL}
 .endif
 
 .include bsd.cpu.mk
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287190 - head/sys/kern

2015-08-26 Thread Marcel Moolenaar
Author: marcel
Date: Thu Aug 27 04:25:27 2015
New Revision: 287190
URL: https://svnweb.freebsd.org/changeset/base/287190

Log:
  An error of -1 from parse_mount() indicates that the specification
  was invalid. Don't trigger a mount failure (which by default means
  a panic), but instead just move on to the next directive in the
  configuration. This typically has us ask for the root mount.
  
  PR:   163245

Modified:
  head/sys/kern/vfs_mountroot.c

Modified: head/sys/kern/vfs_mountroot.c
==
--- head/sys/kern/vfs_mountroot.c   Thu Aug 27 03:47:56 2015
(r287189)
+++ head/sys/kern/vfs_mountroot.c   Thu Aug 27 04:25:27 2015
(r287190)
@@ -791,6 +791,11 @@ retry:
break;
default:
error = parse_mount(conf);
+   if (error == -1) {
+   printf(mountroot: invalid file system 
+   specification.\n);
+   error = 0;
+   }
break;
}
if (error  0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org