Commit Graph

7826 Commits

Author SHA1 Message Date
Adrien Destugues ef726c687a Intel_extreme: improve i855 support.
https://github.com/druga/haiku-stuff/tree/master/intel_extreme
Rebased against current sources.

* The BIOS video mode sometimes reports a scaled mode instead of the
physical panel dimensions. Get the data from the VBT table as well, and
use it if the reported resolution is bigger.
* On first boot, force the panel native mode so the user doesn't have to
set it manually.
* Only allow a single head at a time on i855gm, as the card can't drive
both heads at the same time.
* Detect when a new requested mode is the same as the current one, and
skip modesetting in that case. Avoids screen flickering when changing
workspaces.
* Fix some cases of misdetecting which pipes to enable
2014-01-17 12:42:20 +01:00
Adrien Destugues e1caa56b1e Add another mssing string::compare prototype.
Matches buildtools change 8b70c20ed25f905e7e217376c9e2f65a8dee6729.
2014-01-17 10:00:32 +01:00
Pawel Dziepak d0f2d8282f Merge branch 'scheduler'
Conflicts:
	build/jam/packages/Haiku
	headers/os/kernel/OS.h
	headers/os/opengl/GLRenderer.h
	headers/private/shared/cpu_type.h
	src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.h
	src/bin/sysinfo.cpp
	src/bin/top.c
	src/system/kernel/arch/x86/arch_system_info.cpp
	src/system/kernel/port.cpp
2014-01-17 04:06:15 +01:00
Pawel Dziepak 79c9b824e4 libroot: sync() should not return any value 2014-01-16 20:18:22 +01:00
Adrien Destugues 67af469ef0 Fix time_t/bigtime_t mixup.
Thanks stippi for noticing!
2014-01-16 09:41:01 +01:00
Adrien Destugues 5ebdc79955 SecureSocket: add some certificate support
* Instead of creating an OpenSSL context ofor each socket, use a global
one and initialize it lazily when the first SecureSocket is created
* Load the certificates from our certificate list so SSL certificates
sent by servers can be validated.
* Add a callback for signalling that certificate validation failed, the
default implementation proceeds with the connection anyway (to keep the
old behavior).
* Introduce BCertificate class, that provides some information about a
certificate. Currently it's only used by the callback mentionned above,
but it will be possible to get the leaf certificate for the connection
after it's established.

Review of the API and implementation is welcome, before I start making
use of this in HttpRequest and WebKit to allow the user to accept new
certificates.
2014-01-15 17:45:21 +01:00
Alexander von Gluck IV 7c28f77332 system: Improve AMD CPU detection
* Several CPUID's were thrown into the Athlon 64
  catch all.  Add Sempron 64 and correct CPUIDs
  solves #9553
* Add better AMD A-Series detection
2014-01-14 20:24:02 -06:00
Jonathan Schleifer 76b12d6056 StackOrHeapArray: Add missing include of cstddef.
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2014-01-13 19:14:49 +01:00
Adrien Destugues 3d864cd870 Remove B_PROT_* and related code
Use standard error codes instead.
This allows using error code returned by the underlying functions
directly, and makes it possible to use strerror for debugging. So, we
can also remove StatusString() from the various *Request classes.
2014-01-13 08:05:32 +01:00
François Revol 586d22c9ba Fix function prototype to be valid C 2014-01-11 17:53:00 +01:00
Jonathan Schleifer 04a0e9c7b6 ALM: Move forward declaration of Constraint to the right namespace. 2014-01-10 22:32:15 +01:00
Jonathan Schleifer 4bda0212ce Add BStackOrHeapArray. 2014-01-10 22:31:46 +01:00
Jonathan Schleifer 6abec6b93a Declare BLooperListIterator in the right place.
Before, it tried to typedef it to a private struct, but outside of the
class.
2014-01-10 22:31:37 +01:00
Pawel Dziepak a2634874ed scheduler: Estimate the load thread is able to produce
Previous implementation based on the actual load of each core and share
each thread has in that load turned up to be very problematic when
balancing load on very heavily loaded systems (i.e. more threads
consuming all available CPU time than there is logical CPUs).

The new approach is to estimate how much load would a thread produce
if it had all CPU time only for itself. Summing such load estimations
of each thread assigned to a given core we get a rank that contains
much more information than just simple actual core load.
2014-01-09 03:50:54 +01:00
Alexander von Gluck IV aa4b5749d6 runtime_loader: Detect and trigger on PE binaries
* Previously PE binaries would trigger the "incorrectly
  executable" dialog. Now we get a special message for
  B_LEGACY_EXECUTABLE and B_UNKNOWN_EXECUTABLE
* Legacy at the moment is a R3 x86 PE binary. This could
  be extended to gcc2 binaries someday far, far, down the
  road though
* The check for legacy is based on a PE flag I see
  set on every R3 binary (that isn't set on dos ones)
* Unknown is something we know *is* an executable, but
  can't do anything with (such as an MSDOS or Windows
  application)
* No performance drops as we do the PE scan last
* Tested on x86 and x86_gcc2
2014-01-07 19:38:07 -06:00
Pawel Dziepak 4ca31ac964 kernel: Fix ABA problem in try_acquire_read_spinlock() 2014-01-06 21:03:42 +01:00
Pawel Dziepak 8cf8e53774 kernel/x86: Inline atomic functions and memory barriers 2014-01-06 09:08:53 +01:00
Pawel Dziepak cb66faef24 scheduler: Work around GCC2 limitations in function inlining
GCC2 won't inline a function if it is used before its definition.
2014-01-06 01:22:53 +01:00
Pawel Dziepak 81e04d7b97 kernel: Remove cpu_info::load
This field forces kernel to track each CPU load all the time. It is not
a problem with the current scheduler on a multicore systems, but on
single core machnies or with any other future scheduler this field may
become just an unnecessary burden. It isn't difficult for an application
to compute CPU load by itself when it needs it.
2014-01-03 19:44:57 +01:00
Adrien Destugues 5b53e2e516 HttpRequest: close the connection on Stop()
When calling Stop(), we expect the request thread to exit as soon as
possible. Closing the connection unlocks it from any blocking read() or
write(), avoiding some lockup situations.
2014-01-02 08:38:03 +01:00
Alexander von Gluck IV f8da8f3477 ARM: Be aware of ARMEL and ARMEL
* My BeagleBone gcc defines __ARMEL__ but not
  __ARM__ which breaks the native tool builds
* As ARM was originally Little Endian, we assume
  __ARM__ means as such.
* Look for Big Endian ARM and define the needed big
  endian preprocessors
2014-01-01 23:41:02 -07:00
Pawel Dziepak 135bb9c959 kernel: Do not attempt to interrupt a thread that is not waiting 2013-12-31 03:53:56 +01:00
Ingo Weinhold a0848a1916 BButton: Add optional pop-up marker
* Add behavior constant B_POP_UP_BEHAVIOR which adds a pop-up marker
  to the button (similar to that of BMenuField).
* Add methods [Set]PopUpMessage(). To set/get the the message that is
  sent to the button's target when the pop-up marker is clicked.
2013-12-30 04:42:52 +01:00
Ingo Weinhold 813c5772c9 BButton: Removed dead code
Remove methods _DrawDefault() and _DrawFocusLine() which were used for
the non-BControlLook drawing.
2013-12-30 04:18:33 +01:00
Pawel Dziepak 15a7f2046a kernel: Return CPU load in cpu_info 2013-12-29 22:47:06 +01:00
Pawel Dziepak e46f284adc kernel/util: MinMaxHeap: Fix unused variable warnings 2013-12-29 22:47:05 +01:00
Pawel Dziepak a47974dd06 scheduler: Use heap to determine highest priority thread 2013-12-29 19:24:01 +01:00
Ingo Weinhold b998f9f02f BButton: Add support for toggle button behavior
Add methods SetBehavior(), Behavior(). Supported behavior constants are
B_BUTTON_BEHAVIOR -- normal button behavior -- and B_TOGGLE_BEHAVIOR
-- toggle button behavior.
2013-12-29 01:21:45 +01:00
Ingo Weinhold b181fabe57 BButton: Remove left over attributes 2013-12-29 00:43:25 +01:00
Ingo Weinhold a249edfbfc BButton: Add flat property
* Add methods SetFlat()/IsFlat(). A flat button doesn't draw its frame,
  unless the mouse is hovering over it or it is otherwise activated.
* As a side effect this change also activates the hover glow that was
  already implemented in BControlLook, but not activated in BButton.
2013-12-29 00:13:49 +01:00
François Revol 8ea42167a2 Add sysexits.h from FreeBSD r259958
I'd need this for getconf.
2013-12-27 19:16:15 +01:00
Adrien Destugues 756ff6c0bc agg: Werror fixes in previously unused templates. 2013-12-24 09:28:44 +01:00
Alexander von Gluck IV eb45d168e1 GL: Remove OpenGL kit, x86 Mesa
* Depend on Mesa packages to provide functionality
2013-12-22 23:36:02 -06:00
Pawel Dziepak 3309bf33c7 kernel/util: Make MinMaxHeap::Peek*() const 2013-12-23 03:52:13 +01:00
Ingo Weinhold f0c3101151 BControl: Move icon code to separate class BIcon 2013-12-22 15:17:53 +01:00
Ingo Weinhold 97bf0ce362 BControl: Move icon code to separate class BIcon 2013-12-22 14:45:34 +01:00
Ingo Weinhold 5414b3c445 Move icon related constants to InterfaceDefs.h
There will be non-BControl views to use those as well.
2013-12-22 14:45:33 +01:00
Ingo Weinhold f829889455 BCheckBox: Add icon support
* Draw(): Remove the non-BControlLook code.
* GetPreferredSize(): Implement based on _ValidatePreferredSize() to
  avoid code duplication.
* Draw(): Fix off-by-one error. The label was too close to the box.
* Draw(), _ValidatePreferredSize(): Add icon support.
  _ValidatePreferredSize() is now actually aligned with what Draw()
  expects. The preferred width is now a tight fit; there were three or
  four pixels of empty space before.
  Due to the fixed check box position the layout isn't that nice in
  some situations (particularly with an icon larger than the text),
  IMHO.
2013-12-22 04:48:21 +01:00
Ingo Weinhold be4367428b BControl subclasses: Override SetIcon()
... and implement Perform() action for potential later use.
2013-12-22 02:48:27 +01:00
Ingo Weinhold be260374d5 BControl: Add icon support
The icon is meant as an addition to or replacement of the label. Icon
bitmaps for various states of the control (off, on, partially on, each
enabled or disabled, plus up to 125 custom states) can be set
individually via SetIconBitmap() (getter IconBitmap()).
The convenience method SetIcon() can be used to set the bitmaps for the
standard states from a single bitmap; it also supports cropping the
icon to its non-transparent area. Code borrowed from BIconButton.
2013-12-22 02:48:25 +01:00
Ingo Weinhold 1b848ee7f2 BControlLook: Add DrawLabel() variants with icon
A label, a bitmap, or both can be specified.
2013-12-22 02:48:24 +01:00
Ingo Weinhold 8719e0dc4b BControlLook: Add methods for getting insets
* Update the previously unused frame_type and background_type enums.
* Add methods GetFrameInsets(), GetBackgroundInsets(), GetInsets() to
  get the insets for a given frame type, background type, or both
  respectively.
2013-12-22 02:48:23 +01:00
Adrien Destugues 9cdbb95476 Remove comment. 2013-12-21 21:58:28 +01:00
Adrien Destugues c516bac9f4 Revert part of hrev24647
The baudrate constant for MIDI speed was after all the others in BeOS,
and we have to keep them with the same values for things to work.
Moreover, the constants in SerialPort.h were not changed, so everything
was out of sync and all apps using BSerialPort ended up using the wrong
speed.

Add a comment in termios.h to make sure this doesn't happen again.
2013-12-21 20:25:24 +01:00
Ingo Weinhold df37cd4edd BCheckBox: Add tri-state support
* Add possible control state B_CONTROL_PARTIALLY_ON and support it in
  BCheckBox and BControlLook.
* BCheckBox: Add partialStateToOff property defining whether the
  partial state should transition to off. Defaults to false (i.e.
  partial to on).
2013-12-21 02:12:04 +01:00
Pawel Dziepak b89b5d3826 x86: Make arch/smp.h a C++ only header 2013-12-20 22:05:26 +01:00
Ingo Weinhold 5d7f782d4e BLooper: Add DispatchExternalMessage()
* This is primarily a service method for ports of widget tool kits
  that require single-threaded GUI. DispatchExternalMessage() calls
  DispatchMessage(), but also sets fLastMessage, so that
  [Detach]CurrentMessage() work correctly. This allows to detach a
  message in DispatchMessage() when called from the window thread,
  add it to a global queue, and later process the queued messages in
  a different thread that calls DispatchExternalMessage().
* BLooper/BWindow: Make sure fLastMessage is accessed only when locked.
2013-12-20 15:47:23 +01:00
Pawel Dziepak ad6b9a1df8 scheduler: Use sequential locks instead of atomic 64 bit access 2013-12-20 02:18:44 +01:00
Pawel Dziepak b258298c70 kernel: Protect cpu_ent::active_time with sequential lock
atomic_{get, set}64() are problematic on architectures without 64 bit
compare and swap.
Also, using sequential lock instead of atomic access ensures that
any reads from cpu_ent::active_time won't require any writes to shared
memory.
2013-12-20 01:31:32 +01:00
Pawel Dziepak 6639514437 x86[_64]: Support assigning MSI IRQs to arbitrary CPU 2013-12-20 01:07:08 +01:00