sdk/emulator/emulator-kernel.git
10 years agodrm: add drm_set_preferred_mode
Gerd Hoffmann [Fri, 11 Oct 2013 08:01:08 +0000 (10:01 +0200)]
drm: add drm_set_preferred_mode

commit 3cf70dafd7bbbc91df0a9ecb081d46f9f3d867f6 upstream.

New helper function to set the preferred video mode.  Can be called
after drm_add_modes_noedid if you don't want the largest supported
video mode be used by default.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agofbdev: Make the switch from generic to native driver less alarming
Adam Jackson [Wed, 12 Feb 2014 21:02:02 +0000 (16:02 -0500)]
fbdev: Make the switch from generic to native driver less alarming

commit 13ba0ad4490c3dd08b15c430a7a01c6fb45d5bce upstream.

Calling this "conflicting" just makes people think there's a problem
when there's not.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agovideo/fb: Propagate error code from failing to unregister conflicting fb
Chris Wilson [Mon, 16 Dec 2013 15:57:39 +0000 (15:57 +0000)]
video/fb: Propagate error code from failing to unregister conflicting fb

commit 46eeb2c144956e88197439b5ee5cf221a91b0a81 upstream.

If we fail to remove a conflicting fb driver, we need to abort the
loading of the second driver to avoid likely kernel panics.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agofb: reorder the lock sequence to fix potential dead lock
Gu Zheng [Tue, 5 Nov 2013 10:00:57 +0000 (18:00 +0800)]
fb: reorder the lock sequence to fix potential dead lock

commit 3a41c5dbe8bc396a7fb16ca8739e945bb003342e upstream.

Following commits:

50e244cc79 fb: rework locking to fix lock ordering on takeover
e93a9a8687 fb: Yet another band-aid for fixing lockdep mess
054430e773 fbcon: fix locking harder

reworked locking to fix related lock ordering on takeover, and introduced console_lock
into fbmem, but it seems that the new lock sequence(fb_info->lock ---> console_lock)
is against with the one in console_callback(console_lock ---> fb_info->lock), and leads to
a potential dead lock as following:

[  601.079000] ======================================================
[  601.079000] [ INFO: possible circular locking dependency detected ]
[  601.079000] 3.11.0 #189 Not tainted
[  601.079000] -------------------------------------------------------
[  601.079000] kworker/0:3/619 is trying to acquire lock:
[  601.079000]  (&fb_info->lock){+.+.+.}, at: [<ffffffff81397566>] lock_fb_info+0x26/0x60
[  601.079000]
but task is already holding lock:
[  601.079000]  (console_lock){+.+.+.}, at: [<ffffffff8141aae3>] console_callback+0x13/0x160
[  601.079000]
which lock already depends on the new lock.

[  601.079000]
the existing dependency chain (in reverse order) is:
[  601.079000]
-> #1 (console_lock){+.+.+.}:
[  601.079000]        [<ffffffff810dc971>] lock_acquire+0xa1/0x140
[  601.079000]        [<ffffffff810c6267>] console_lock+0x77/0x80
[  601.079000]        [<ffffffff81399448>] register_framebuffer+0x1d8/0x320
[  601.079000]        [<ffffffff81cfb4c8>] efifb_probe+0x408/0x48f
[  601.079000]        [<ffffffff8144a963>] platform_drv_probe+0x43/0x80
[  601.079000]        [<ffffffff8144853b>] driver_probe_device+0x8b/0x390
[  601.079000]        [<ffffffff814488eb>] __driver_attach+0xab/0xb0
[  601.079000]        [<ffffffff814463bd>] bus_for_each_dev+0x5d/0xa0
[  601.079000]        [<ffffffff81447e6e>] driver_attach+0x1e/0x20
[  601.079000]        [<ffffffff81447a07>] bus_add_driver+0x117/0x290
[  601.079000]        [<ffffffff81448fea>] driver_register+0x7a/0x170
[  601.079000]        [<ffffffff8144a10a>] __platform_driver_register+0x4a/0x50
[  601.079000]        [<ffffffff8144a12d>] platform_driver_probe+0x1d/0xb0
[  601.079000]        [<ffffffff81cfb0a1>] efifb_init+0x273/0x292
[  601.079000]        [<ffffffff81002132>] do_one_initcall+0x102/0x1c0
[  601.079000]        [<ffffffff81cb80a6>] kernel_init_freeable+0x15d/0x1ef
[  601.079000]        [<ffffffff8166d2de>] kernel_init+0xe/0xf0
[  601.079000]        [<ffffffff816914ec>] ret_from_fork+0x7c/0xb0
[  601.079000]
-> #0 (&fb_info->lock){+.+.+.}:
[  601.079000]        [<ffffffff810dc1d8>] __lock_acquire+0x1e18/0x1f10
[  601.079000]        [<ffffffff810dc971>] lock_acquire+0xa1/0x140
[  601.079000]        [<ffffffff816835ca>] mutex_lock_nested+0x7a/0x3b0
[  601.079000]        [<ffffffff81397566>] lock_fb_info+0x26/0x60
[  601.079000]        [<ffffffff813a4aeb>] fbcon_blank+0x29b/0x2e0
[  601.079000]        [<ffffffff81418658>] do_blank_screen+0x1d8/0x280
[  601.079000]        [<ffffffff8141ab34>] console_callback+0x64/0x160
[  601.079000]        [<ffffffff8108d855>] process_one_work+0x1f5/0x540
[  601.079000]        [<ffffffff8108e04c>] worker_thread+0x11c/0x370
[  601.079000]        [<ffffffff81095fbd>] kthread+0xed/0x100
[  601.079000]        [<ffffffff816914ec>] ret_from_fork+0x7c/0xb0
[  601.079000]
other info that might help us debug this:

[  601.079000]  Possible unsafe locking scenario:

[  601.079000]        CPU0                    CPU1
[  601.079000]        ----                    ----
[  601.079000]   lock(console_lock);
[  601.079000]                                lock(&fb_info->lock);
[  601.079000]                                lock(console_lock);
[  601.079000]   lock(&fb_info->lock);
[  601.079000]
 *** DEADLOCK ***

so we reorder the lock sequence the same as it in console_callback() to
avoid this issue. And following Tomi's suggestion, fix these similar
issues all in fb subsystem.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm: Prefer noninterlace cmdline mode unless explicitly specified
Takashi Iwai [Wed, 19 Mar 2014 13:53:13 +0000 (14:53 +0100)]
drm: Prefer noninterlace cmdline mode unless explicitly specified

commit c683f427bdc43525f61e26609d34e799e7ea4c12 upstream.

Currently drm_pick_cmdline_mode() doesn't care about the interlace
when the given mode line has no "i" suffix.  That is, when there are
multiple entries for the same resolution, an interlace mode might be
picked up just depending on the assigned order, and there is no way to
exclude it.

This patch changes the logic for the mode selection, to prefer the
noninterlace mode unless the interlace mode is explicitly given.
When no matching mode is found, it still tries the interlace mode as
fallback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm/radeon: enable speaker allocation setup on dce3.2
Alex Deucher [Tue, 18 Feb 2014 16:12:11 +0000 (11:12 -0500)]
drm/radeon: enable speaker allocation setup on dce3.2

commit 3803c8e5b50946dd6bc18972d9190757d05648f0 upstream.

Now that we disable audio while setting up the audio
hw, we should be able to set this up without hangs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm/radeon: change audio enable logic
Alex Deucher [Tue, 18 Feb 2014 16:07:55 +0000 (11:07 -0500)]
drm/radeon: change audio enable logic

commit 832eafaf34ff7d0348fe701e417900c6cf1f5656 upstream.

Disable audio around audio hw setup.  This may avoid
hangs on certain asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm/cirrus: Fix cirrus drm driver for fbdev + qemu
Martin Koegler [Thu, 9 Jan 2014 09:05:07 +0000 (10:05 +0100)]
drm/cirrus: Fix cirrus drm driver for fbdev + qemu

commit 99d4a8ae93ead27b5a88cdbd09dc556fe96ac3a8 upstream.

Xorg fbdev driver requires smem_start/smem_len, otherwise
it tries to map 0 bytes as video memory.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=856760
Signed-off-by: Martin Koegler <martin.koegler@chello.at>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm/i915: Undo the PIPEA quirk for i845
Chris Wilson [Tue, 8 Oct 2013 10:16:59 +0000 (11:16 +0100)]
drm/i915: Undo the PIPEA quirk for i845

commit a4945f9522d27e1e6d64a02ad055e83768cb0896 upstream.

The PIPEA quirk is specifically for the issue with the PIPEB PLL on
830gm being slaved to the PIPEA PLL, and so to use PIPEB requires PIPEA
running. i845 doesn't even have the second PLL or pipe, and enabling
the quirk results in a blank DVO LVDS.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agofloppy: bail out in open() if drive is not responding to block0 read
Jiri Kosina [Fri, 10 Jan 2014 01:08:13 +0000 (02:08 +0100)]
floppy: bail out in open() if drive is not responding to block0 read

commit 7b7b68bba5ef23734c35ffb0d8d82079ed604d33 upstream.

In case reading of block 0 during open() fails, it is not the right thing
to let open() succeed.

Fix this by introducing FD_OPEN_SHOULD_FAIL_BIT flag, and setting it in
case the bio callback encounters an error while trying to read block 0.

As a bonus, this works around certain broken userspace (blkid), which is
not able to properly handle read()s returning IO errors. Hence be nice to
those, and bail out during open() already; if block 0 is not readable,
read()s are not going to provide any meaningful data anyway.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoext4: Speedup WB_SYNC_ALL pass called from sync(2)
Jan Kara [Tue, 4 Mar 2014 15:50:50 +0000 (10:50 -0500)]
ext4: Speedup WB_SYNC_ALL pass called from sync(2)

commit 10542c229a4e8e25b40357beea66abe9dacda2c0 upstream.

When doing filesystem wide sync, there's no need to force transaction
commit (or synchronously write inode buffer) separately for each inode
because ext4_sync_fs() takes care of forcing commit at the end (VFS
takes care of flushing buffer cache, respectively). Most of the time
this slowness doesn't manifest because previous WB_SYNC_NONE writeback
doesn't leave much to write but when there are processes aggressively
creating new files and several filesystems to sync, the sync slowness
can be noticeable. In the following test script sync(1) takes around 6
minutes when there are two ext4 filesystems mounted on a standard SATA
drive. After this patch sync takes a couple of seconds so we have about
two orders of magnitude improvement.

      function run_writers
      {
        for (( i = 0; i < 10; i++ )); do
          mkdir $1/dir$i
          for (( j = 0; j < 40000; j++ )); do
            dd if=/dev/zero of=$1/dir$i/$j bs=4k count=4 &>/dev/null
          done &
        done
      }

      for dir in "$@"; do
        run_writers $dir
      done

      sleep 40
      time sync

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoSUNRPC: Fix potential memory scribble in xprt_free_bc_request()
Trond Myklebust [Tue, 11 Feb 2014 18:56:54 +0000 (13:56 -0500)]
SUNRPC: Fix potential memory scribble in xprt_free_bc_request()

commit 628356791b04ea988fee070f66a748a823d001bb upstream.

The call to xprt_free_allocation() will call list_del() on
req->rq_bc_pa_list, which is not attached to a list.
This patch moves the list_del() out of xprt_free_allocation()
and into those callers that need it.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoNFSv3: Fix return value of nfs3_proc_setacls
Trond Myklebust [Sun, 2 Feb 2014 19:36:42 +0000 (14:36 -0500)]
NFSv3: Fix return value of nfs3_proc_setacls

commit 8f493b9cfcd8941c6b27d6ce8e3b4a78c094b3c1 upstream.

nfs3_proc_setacls is used internally by the NFSv3 create operations
to set the acl after the file has been created. If the operation
fails because the server doesn't support acls, then it must return '0',
not -EOPNOTSUPP.

Reported-by: Russell King <linux@arm.linux.org.uk>
Link: http://lkml.kernel.org/r/20140201010328.GI15937@n2100.arm.linux.org.uk
Cc: Christoph Hellwig <hch@lst.de>
Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonfs: initialize the ACL support bits to zero.
Malahal Naineni [Mon, 27 Jan 2014 21:31:09 +0000 (15:31 -0600)]
nfs: initialize the ACL support bits to zero.

commit a1800acaf7d1c2bf6d68b9a8f4ab8560cc66555a upstream.

Avoid returning incorrect acl mask attributes when the server doesn't
support ACLs.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoChar: ipmi_bt_sm, fix infinite loop
Jiri Slaby [Mon, 14 Apr 2014 14:46:50 +0000 (09:46 -0500)]
Char: ipmi_bt_sm, fix infinite loop

commit a94cdd1f4d30f12904ab528152731fb13a812a16 upstream.

In read_all_bytes, we do

  unsigned char i;
  ...
  bt->read_data[0] = BMC2HOST;
  bt->read_count = bt->read_data[0];
  ...
  for (i = 1; i <= bt->read_count; i++)
    bt->read_data[i] = BMC2HOST;

If bt->read_data[0] == bt->read_count == 255, we loop infinitely in the
'for' loop.  Make 'i' an 'int' instead of 'char' to get rid of the
overflow and finish the loop after 255 iterations every time.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-and-debugged-by: Rui Hui Dian <rhdian@novell.com>
Cc: Tomas Cech <tcech@suse.cz>
Cc: Corey Minyard <minyard@acm.org>
Cc: <openipmi-developer@lists.sourceforge.net>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agom68k: Skip futex_atomic_cmpxchg_inatomic() test
Finn Thain [Wed, 5 Mar 2014 23:29:27 +0000 (10:29 +1100)]
m68k: Skip futex_atomic_cmpxchg_inatomic() test

commit e571c58f313d35c56e0018470e3375ddd1fd320e upstream.

Skip the futex_atomic_cmpxchg_inatomic() test in futex_init(). It causes a
fatal exception on 68030 (and presumably 68020 also).

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1403061006440.5525@nippy.intranet
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agofutex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test
Heiko Carstens [Sun, 2 Mar 2014 12:09:47 +0000 (13:09 +0100)]
futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test

commit 03b8c7b623c80af264c4c8d6111e5c6289933666 upstream.

If an architecture has futex_atomic_cmpxchg_inatomic() implemented and there
is no runtime check necessary, allow to skip the test within futex_init().

This allows to get rid of some code which would always give the same result,
and also allows the compiler to optimize a couple of if statements away.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Link: http://lkml.kernel.org/r/20140302120947.GA3641@osiris
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[geert: Backported to v3.10..v3.13]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoselinux: correctly label /proc inodes in use before the policy is loaded
Paul Moore [Wed, 19 Mar 2014 20:46:18 +0000 (16:46 -0400)]
selinux: correctly label /proc inodes in use before the policy is loaded

commit f64410ec665479d7b4b77b7519e814253ed0f686 upstream.

This patch is based on an earlier patch by Eric Paris, he describes
the problem below:

  "If an inode is accessed before policy load it will get placed on a
   list of inodes to be initialized after policy load.  After policy
   load we call inode_doinit() which calls inode_doinit_with_dentry()
   on all inodes accessed before policy load.  In the case of inodes
   in procfs that means we'll end up at the bottom where it does:

     /* Default to the fs superblock SID. */
     isec->sid = sbsec->sid;

     if ((sbsec->flags & SE_SBPROC) && !S_ISLNK(inode->i_mode)) {
             if (opt_dentry) {
                     isec->sclass = inode_mode_to_security_class(...)
                     rc = selinux_proc_get_sid(opt_dentry,
                                               isec->sclass,
                                               &sid);
                     if (rc)
                             goto out_unlock;
                     isec->sid = sid;
             }
     }

   Since opt_dentry is null, we'll never call selinux_proc_get_sid()
   and will leave the inode labeled with the label on the superblock.
   I believe a fix would be to mimic the behavior of xattrs.  Look
   for an alias of the inode.  If it can't be found, just leave the
   inode uninitialized (and pick it up later) if it can be found, we
   should be able to call selinux_proc_get_sid() ..."

On a system exhibiting this problem, you will notice a lot of files in
/proc with the generic "proc_t" type (at least the ones that were
accessed early in the boot), for example:

   # ls -Z /proc/sys/kernel/shmmax | awk '{ print $4 " " $5 }'
   system_u:object_r:proc_t:s0 /proc/sys/kernel/shmmax

However, with this patch in place we see the expected result:

   # ls -Z /proc/sys/kernel/shmmax | awk '{ print $4 " " $5 }'
   system_u:object_r:sysctl_kernel_t:s0 /proc/sys/kernel/shmmax

Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoPCI: mvebu: move clock enable before register access
Sebastian Hesselbarth [Tue, 13 Aug 2013 12:25:20 +0000 (14:25 +0200)]
PCI: mvebu: move clock enable before register access

commit b42285f66f871a9898a0e79e2d74bc7e7a101995 upstream.

The clock passed to PCI controller found on MVEBU SoCs may come from a
clock gate. This requires the clock to be enabled before any registers
are accessed. Therefore, move the clock enable before register iomap to
ensure it is enabled.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agopowernow-k6: reorder frequencies
Mikulas Patocka [Sun, 13 Apr 2014 14:22:21 +0000 (16:22 +0200)]
powernow-k6: reorder frequencies

commit 22c73795b101597051924556dce019385a1e2fa0 upstream.

This patch reorders reported frequencies from the highest to the lowest,
just like in other frequency drivers.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agopowernow-k6: correctly initialize default parameters
Mikulas Patocka [Sun, 13 Apr 2014 14:22:20 +0000 (16:22 +0200)]
powernow-k6: correctly initialize default parameters

commit d82b922a4acc1781d368aceac2f9da43b038cab2 upstream.

The powernow-k6 driver used to read the initial multiplier from the
powernow register. However, there is a problem with this:

* If there was a frequency transition before, the multiplier read from the
  register corresponds to the current multiplier.
* If there was no frequency transition since reset, the field in the
  register always reads as zero, regardless of the current multiplier that
  is set using switches on the mainboard and that the CPU is running at.

The zero value corresponds to multiplier 4.5, so as a consequence, the
powernow-k6 driver always assumes multiplier 4.5.

For example, if we have 550MHz CPU with bus frequency 100MHz and
multiplier 5.5, the powernow-k6 driver thinks that the multiplier is 4.5
and bus frequency is 122MHz. The powernow-k6 driver then sets the
multiplier to 4.5, underclocking the CPU to 450MHz, but reports the
current frequency as 550MHz.

There is no reliable way how to read the initial multiplier. I modified
the driver so that it contains a table of known frequencies (based on
parameters of existing CPUs and some common overclocking schemes) and sets
the multiplier according to the frequency. If the frequency is unknown
(because of unusual overclocking or underclocking), the user must supply
the bus speed and maximum multiplier as module parameters.

This patch should be backported to all stable kernels. If it doesn't
apply cleanly, change it, or ask me to change it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agopowernow-k6: disable cache when changing frequency
Mikulas Patocka [Sun, 13 Apr 2014 14:22:20 +0000 (16:22 +0200)]
powernow-k6: disable cache when changing frequency

commit e20e1d0ac02308e2211306fc67abcd0b2668fb8b upstream.

I found out that a system with k6-3+ processor is unstable during network
server load. The system locks up or the network card stops receiving. The
reason for the instability is the CPU frequency scaling.

During frequency transition the processor is in "EPM Stop Grant" state.
The documentation says that the processor doesn't respond to inquiry
requests in this state. Consequently, coherency of processor caches and
bus master devices is not maintained, causing the system instability.

This patch flushes the cache during frequency transition. It fixes the
instability.

Other minor changes:
* u64 invalue changed to unsigned long because the variable is 32-bit
* move the logic to set the multiplier to a separate function
  powernow_k6_set_cpu_multiplier
* preserve lower 5 bits of the powernow port instead of 4 (the voltage
  field has 5 bits)
* mask interrupts when reading the multiplier, so that the port is not
  open during other activity (running other kernel code with the port open
  shouldn't cause any misbehavior, but we should better be safe and keep
  the port closed)

This patch should be backported to all stable kernels. If it doesn't
apply cleanly, change it, or ask me to change it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoMerge "Revert "maru_fb : Add a framebuffer device for Tizen emulator"" into tizen_lin...
SeokYeon Hwang [Wed, 30 Apr 2014 01:06:58 +0000 (18:06 -0700)]
Merge "Revert "maru_fb : Add a framebuffer device for Tizen emulator"" into tizen_linux_3.12

10 years agoMerge "power_supply: disable power_supply & added dependency" into tizen_linux_3.12
SeokYeon Hwang [Tue, 29 Apr 2014 11:17:49 +0000 (04:17 -0700)]
Merge "power_supply: disable power_supply & added dependency" into tizen_linux_3.12

10 years agopower_supply: disable power_supply & added dependency 78/20178/2
Jinhyung Choi [Tue, 29 Apr 2014 06:54:11 +0000 (15:54 +0900)]
power_supply: disable power_supply & added dependency

Change-Id: Ibf1f83c041214f6e06e19c3ad438363056c6db40
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
10 years agoRevert "maru_fb : Add a framebuffer device for Tizen emulator" 23/20223/1
jinhyung.jo [Tue, 29 Apr 2014 07:36:38 +0000 (16:36 +0900)]
Revert "maru_fb : Add a framebuffer device for Tizen emulator"

This reverts commit 7fafa6cf5c264b9fd55bc009373498f087fabf5b.

Remove maru_fb driver, no more used in tizen emulator.
From now on, VIGS device is used.

Change-Id: Ib915e145cfca09b51a9a5c9c5121e75253941eca
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agoRevert "VirtGL : Add a GL passthrough device for Tizen emulator" 43/19943/2
jinhyung.jo [Wed, 23 Apr 2014 09:04:36 +0000 (18:04 +0900)]
Revert "VirtGL : Add a GL passthrough device for Tizen emulator"

This reverts commit 064e8cb1771fe39a7ca4deb4f5439aac37b0241e.

Remove VirtGL driver, no more used in tizen emulator.

Change-Id: I06746af1675645e736cc77e91a2898dc86c3e3a1
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agoconfig: useful ftrace features enabled 76/19976/1
sangho1206.park [Thu, 24 Apr 2014 02:57:46 +0000 (11:57 +0900)]
config: useful ftrace features enabled

kprobe, uprobe, irqflag, max_trace, function, irqsoff, preempt, sched,
snapshot, stack and mmiotrace are enabled.

Change-Id: I0bd3b778ecdf549806b4a222fcd2ebb6b59bd587
Signed-off-by: sangho1206.park <sangho1206.park@samsung.com>
10 years agosdcard: Provide type "SD" for virtio sdcard. 54/19754/3
SeokYeon Hwang [Thu, 17 Apr 2014 08:40:59 +0000 (17:40 +0900)]
sdcard: Provide type "SD" for virtio sdcard.

Change-Id: Idba9d8a748245e3ff1f24e6f5e3843dfd26da76f
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agosdcard: bug fix. 30/19730/1
SeokYeon Hwang [Thu, 17 Apr 2014 06:12:39 +0000 (15:12 +0900)]
sdcard: bug fix.

Change-Id: I5a9527253595a6ff26b968e1dedac631f73706bb
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agoMerge "sdcard: Prepare mmcblk index more than 0." into tizen_linux_3.12
SeokYeon Hwang [Tue, 15 Apr 2014 08:50:56 +0000 (01:50 -0700)]
Merge "sdcard: Prepare mmcblk index more than 0." into tizen_linux_3.12

10 years agosdcard: Prepare mmcblk index more than 0. 50/19550/1
SeokYeon Hwang [Tue, 15 Apr 2014 03:15:10 +0000 (12:15 +0900)]
sdcard: Prepare mmcblk index more than 0.

Tizen platform can recognize as a "sdcard" when device name starts with "mmcblk".

Change-Id: I05f84984d589eada760390704805cec37947403d
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agotouchscreen: set touchscreen resolution 03/19503/1
GiWoong Kim [Thu, 10 Apr 2014 10:14:31 +0000 (19:14 +0900)]
touchscreen: set touchscreen resolution

Change-Id: I0eaf5d48cd3caa958fd89ef53e77f877bd9761d0
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
10 years agosmack: fix: allow either entry be missing on access/access2 check (v2) 31/19431/1
Casey Schaufler [Tue, 28 Jan 2014 19:31:46 +0000 (11:31 -0800)]
smack: fix: allow either entry be missing on access/access2 check (v2)

commit 398ce073700a2a3e86b5a0b1edecdddfa3996b27
Author: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date:   Thu Nov 28 19:16:46 2013 +0200

    smack: fix: allow either entry be missing on access/access2 check (v2)

    This is a regression caused by f7112e6c. When either subject or
    object is not found the answer for access should be no. This
    patch fixes the situation. '0' is written back instead of failing
    with -EINVAL.

    v2: cosmetic style fixes

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Change-Id: Ibb84d8ab1e70d5f6689705ed28b0946b9ddde21d
Signed-off-by: Casey Schaufler <casey.schaufler@intel.com>
10 years agoSmack: Make the syslog control configurable 30/19430/1
Casey Schaufler [Tue, 24 Dec 2013 16:41:54 +0000 (08:41 -0800)]
Smack: Make the syslog control configurable

commit 00f84f3f2e9d088f06722f4351d67f5f577abe22
Author: Casey Schaufler <casey@schaufler-ca.com>
Date:   Mon Dec 23 11:07:10 2013 -0800

The syslog control requires that the calling proccess
have the floor ("_") Smack label. Tizen does not run any
processes except for kernel helpers with the floor label.
This changes allows the admin to configure a specific
label for syslog. The default value is the star ("*")
label, effectively removing the restriction. The value
can be set using smackfs/syslog for anyone who wants
a more restrictive behavior.

Change-Id: Iec4c42c4d156fe29915f07a6f40d6c58ad894d6a
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
10 years agoSmack: Cgroup filesystem access 29/19429/1
Casey Schaufler [Thu, 21 Nov 2013 08:55:10 +0000 (10:55 +0200)]
Smack: Cgroup filesystem access

The cgroup filesystems are not mounted using conventional
mechanisms. This prevents the use of mount options to
set Smack attributes. This patch makes the behavior
of cgroup filesystems compatable with the way systemd
uses them.

Change-Id: I1e0429f133db9e14117dc754d682dec08221354c
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
10 years agoSmack: Ptrace access check mode 28/19428/1
Casey Schaufler [Tue, 22 Oct 2013 18:47:45 +0000 (11:47 -0700)]
Smack: Ptrace access check mode

When the ptrace security hooks were split the addition of
a mode parameter was not taken advantage of in the Smack
ptrace access check. This changes the access check from
always looking for read and write access to using the
passed mode. This will make use of /proc much happier.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Change-Id: I59f9f5fb88da2dd08f80a2946afb211db103b16e
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
10 years agoSmack: Implement lock security mode 27/19427/1
Casey Schaufler [Sat, 12 Oct 2013 01:06:39 +0000 (18:06 -0700)]
Smack: Implement lock security mode

Linux file locking does not follow the same rules
as other mechanisms. Even though it is a write operation
a process can set a read lock on files which it has open
only for read access. Two programs with read access to
a file can use read locks to communicate.

This is not acceptable in a Mandatory Access Control
environment. Smack treats setting a read lock as the
write operation that it is. Unfortunately, many programs
assume that setting a read lock is a read operation.
These programs are unhappy in the Smack environment.

This patch introduces a new access mode (lock) to address
this problem. A process with lock access to a file can
set a read lock. A process with write access to a file can
set a read lock or a write lock. This prevents a situation
where processes are granted write access just so they can
set read locks.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Change-Id: Ia9024f37a5ce51eddbb19053b800f4d70948ef17
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
10 years agodriver: added sensor and jack driver 41/19241/4
Jinhyung Choi [Wed, 9 Apr 2014 07:47:59 +0000 (16:47 +0900)]
driver: added sensor and  jack driver

Maru power supply device driver is added, but it is not built.
It will be fixed.

Change-Id: Ib4a10e9c4434d272c445f8551ef9cb74b89b963f
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
10 years agomaru : Enable overlay driver 12/19312/2
jinhyung.jo [Thu, 10 Apr 2014 08:10:24 +0000 (17:10 +0900)]
maru : Enable overlay driver

Fix the problem that video_device is being registered
without v4l2_device.

Change-Id: I5a17c741f9e8796777d9d5feb9261c4a7de9f350
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agoMerge "enable Tizen IVI required kernel options" into tizen_linux_3.12
Max Yu [Thu, 10 Apr 2014 02:21:29 +0000 (19:21 -0700)]
Merge "enable Tizen IVI required kernel options" into tizen_linux_3.12

10 years agoenable Tizen IVI required kernel options 51/19251/1
Stanislav Vorobiov [Thu, 3 Apr 2014 05:57:00 +0000 (09:57 +0400)]
enable Tizen IVI required kernel options

For details see
https://wiki.tizen.org/wiki/IVI/artem-kernel#Kernel_configuration

Change-Id: I49432ab6a3d66408de197e8b420ebdd915dc2527
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
10 years agoMerge "brillcodec: remove the first memory block reserved for meta buffer." into...
SeokYeon Hwang [Wed, 9 Apr 2014 07:59:57 +0000 (00:59 -0700)]
Merge "brillcodec: remove the first memory block reserved for meta buffer." into tizen_linux_3.12

10 years agoMerge "brillcodec: improve an exception case when requested memory size is invalid...
SeokYeon Hwang [Wed, 9 Apr 2014 07:59:45 +0000 (00:59 -0700)]
Merge "brillcodec: improve an exception case when requested memory size is invalid." into tizen_linux_3.12

10 years agoMerge branch 'tizen_linux_3.12' into tizen_linux_3.12
SeokYeon Hwang [Wed, 9 Apr 2014 05:54:38 +0000 (14:54 +0900)]
Merge branch 'tizen_linux_3.12' into tizen_linux_3.12

Change-Id: I3ea847950cfe2991c980ebb317932a348922af16

10 years agoUsing initramfs for v86d.
SeokYeon Hwang [Wed, 9 Apr 2014 05:30:35 +0000 (14:30 +0900)]
Using initramfs for v86d.

Change-Id: I299da86a1239b6add1befa39c92d20ba4be07069
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agoRevert "enable Tizen IVI required kernel options"
Stanislav Vorobiov [Tue, 8 Apr 2014 06:31:57 +0000 (10:31 +0400)]
Revert "enable Tizen IVI required kernel options"

This reverts commit f7090f807e725b4fa5ba32a4f3bb1c2a86ad5e0d.

Change-Id: I469dc544d6e410025d97d6e7b4dba90fce478e1d
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
10 years agoseparate kernel config for Tizen IVI
Stanislav Vorobiov [Tue, 8 Apr 2014 06:31:07 +0000 (10:31 +0400)]
separate kernel config for Tizen IVI

Change-Id: I5a66b394d3065d138605bad9727079c8a50f79cc
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
10 years agoenable Tizen IVI required kernel options
Stanislav Vorobiov [Thu, 3 Apr 2014 05:57:00 +0000 (09:57 +0400)]
enable Tizen IVI required kernel options

For details see
https://wiki.tizen.org/wiki/IVI/artem-kernel#Kernel_configuration

Change-Id: Iaac79f8ae9ea0758666f7cf39cc98c7736026d5d
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
10 years agomaru: disable overlay driver
Stanislav Vorobiov [Fri, 21 Mar 2014 06:28:40 +0000 (10:28 +0400)]
maru: disable overlay driver

Overlay driver currently fails to
load because video_device is being registered
without v4l2_device, so disable it for now

Change-Id: Idbec8e41c3a79fc30ffd8bf30d6c2fb52443baad
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
10 years agoVirtGL : Add a GL passthrough device for Tizen emulator
jinhyung.jo [Mon, 17 Mar 2014 05:59:46 +0000 (14:59 +0900)]
VirtGL : Add a GL passthrough device for Tizen emulator

Add a GL passthrough device for Tizen Emulator

Change-Id: I53d455ebf433a5c648951a2e13406e2ac4470712
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agomaru_fb : Add a framebuffer device for Tizen emulator
jinhyung.jo [Mon, 17 Mar 2014 05:51:21 +0000 (14:51 +0900)]
maru_fb : Add a framebuffer device for Tizen emulator

Add a framebuffer device for Tizen emulator

Change-Id: I2090366287fb7769bae28286a6b21384ad233d4b
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agoemulator config updated
Stanislav Vorobiov [Mon, 17 Mar 2014 09:52:24 +0000 (13:52 +0400)]
emulator config updated

Change-Id: I6399d61b301782864e404e30b45b8feab089e147

10 years agoVIGS: Fixed for kernel 3.12
Stanislav Vorobiov [Fri, 14 Mar 2014 13:45:37 +0000 (17:45 +0400)]
VIGS: Fixed for kernel 3.12

Change-Id: Ic4ae0c0dea0e9901c5f648e1b215fd82d26cc3b2

10 years agoslp_global_lock: Fixed for kernel 3.12
Stanislav Vorobiov [Mon, 17 Mar 2014 07:59:10 +0000 (11:59 +0400)]
slp_global_lock: Fixed for kernel 3.12

Change-Id: I89f0cedba73eae66e56911b8ebcfb9010443d4bd

10 years agoYaGL: Fixed for kernel 3.12
Stanislav Vorobiov [Fri, 14 Mar 2014 11:57:02 +0000 (15:57 +0400)]
YaGL: Fixed for kernel 3.12

Change-Id: I59a6d69d7bbdfd27e046372974f7651cf52aa5fb

10 years agoYaGL/VIGS: Version bump
Stanislav Vorobiov [Thu, 6 Mar 2014 13:48:33 +0000 (17:48 +0400)]
YaGL/VIGS: Version bump

GLESv3 merge version bump

Change-Id: I34813deb38a2c6334a2c04cb55dfd478c2041e8a

10 years agoVIGS: Support plane z-pos setting from user-space
Stanislav Vorobiov [Tue, 18 Feb 2014 13:05:46 +0000 (17:05 +0400)]
VIGS: Support plane z-pos setting from user-space

Change-Id: I72a60beac3dc23f23517f310d5bee59c6833b748

10 years agoVIGS: Implemented plane support
Stanislav Vorobiov [Mon, 10 Feb 2014 16:59:01 +0000 (20:59 +0400)]
VIGS: Implemented plane support

We now support up to 2 hardware planes
with z-ordering and scaling. This patch also
adds surface scanout flag support. Surface scanout
flag is used as a hint that helps the host to decide
how to process the surface - either upload it to texture
or continously scanout data out of surface's VRAM

Change-Id: I76f88579929efd14ea81e67d2f7a231a7dee4e9d

10 years agoVIGS: Fix fence ack losses
Stanislav Vorobiov [Thu, 20 Feb 2014 07:51:51 +0000 (11:51 +0400)]
VIGS: Fix fence ack losses

It's incorrect to have vblank enable/disable flag
in INT register, it can cause fence ack losses, consider
the following scenario:
1. Fence interrupt is set on host, fence_pending bit is
   set in INT register
2. vblank is turned off on guest, INT register is being
   written to and since fence_pending bit is 1 it's
   CLEARED on host
3. Now guest handles fence IRQ, but fence_pending bit
   is 0, thus, fence ack is lost

The solution is to have separate register - CON and
vblank enable/disable bit should be there

Change-Id: Ieb3f1a0bd1722fa05fd4e7ca425079fb8799e533

10 years agoYaGL: Support host OpenGL version report
Stanislav Vorobiov [Tue, 22 Oct 2013 10:15:56 +0000 (14:15 +0400)]
YaGL: Support host OpenGL version report

Change-Id: Ifaf7abb86f7f0a650ab6954be23ae95233261450

10 years agoYaGL: Implemented multicore rendering and fences
Stanislav Vorobiov [Thu, 28 Nov 2013 10:51:12 +0000 (14:51 +0400)]
YaGL: Implemented multicore rendering and fences

We now use multicore rendering, i.e. we offload all
rendering to a separate thread and use fences to wait
until certain parts of it are complete. This patch
implements fences via TTM sync objects, it also uses
TTM execbuffer utils to fence buffers and TTM object
files to export fences to user space

Change-Id: Ibed86c3161f3b7207725c8662ffa909d103acedf

10 years agoVIGS: Don't rely on 'no_wait_reserve' parameter when pinnin GEMs
Stanislav Vorobiov [Wed, 11 Dec 2013 09:26:13 +0000 (13:26 +0400)]
VIGS: Don't rely on 'no_wait_reserve' parameter when pinnin GEMs

'no_wait_reserve' parameter isn't accounted for in
ttm_bo_validate, so don't rely on GEM reserve wait,
just retry things instead

Change-Id: Iab57645c8ab96f30c01b943342cdff9bacac8feb

10 years agoVIGS: Fix pageflip race
Stanislav Vorobiov [Tue, 10 Dec 2013 16:52:54 +0000 (20:52 +0400)]
VIGS: Fix pageflip race

Must use event_lock, since it's being used
in vigs_finish_pageflips to lock pageflip_event_list.

Also, by the time we call drm_vblank_put the event might already
be processed, so check for that

Change-Id: I9c5de98452353c6d4f09e4e4fbd92176cfd8ee40

10 years agoYaGL: Version bump
Stanislav Vorobiov [Mon, 7 Oct 2013 11:31:29 +0000 (15:31 +0400)]
YaGL: Version bump

Change-Id: I6ecf4d3e2121cacc293af82bfde8d96bfe55dc06

10 years agoYaGL: Transport improved
Stanislav Vorobiov [Tue, 24 Sep 2013 14:48:33 +0000 (18:48 +0400)]
YaGL: Transport improved

The improvements are:

* No more mlock/munlock. We now have ioctls for locking drawable
  memory so that compile transfers could be created on host. This
  is only used by offscreen backend though
* We're now using a single buffer for marshalling instead of two: one
  for commands and one for data. Also, the buffer can now be of any
  size up to 2M, it's implemented as a page list, thus, we don't need
  to allocate contigous memory anymore

Change-Id: Ia9b716c9135df75535dc515367550c9fbcf9c737

10 years agoVIGS: Don't 'update_vram' on 'set_root_surface'
Stanislav Vorobiov [Fri, 2 Aug 2013 13:54:12 +0000 (17:54 +0400)]
VIGS: Don't 'update_vram' on 'set_root_surface'

This is now automatically happens on glFinish,
eglSwapBuffers, eglCopyBuffers, etc.

Change-Id: Ie20724ec8ce6283e8fda1248f368f00e704e0e3d

10 years agoYaGL: Version bump
Stanislav Vorobiov [Wed, 31 Jul 2013 10:32:28 +0000 (14:32 +0400)]
YaGL: Version bump

Change-Id: Ie681f7251648451d9a425e97f215a8b0b50ebbbb

10 years agoVIGS: Use BO instead of VMA in struct vigs_mman_vma
Stanislav Vorobiov [Wed, 24 Jul 2013 07:24:08 +0000 (11:24 +0400)]
VIGS: Use BO instead of VMA in struct vigs_mman_vma

It's better to use BO in struct vigs_mman_vma instead of
VMA that was allocated in mmap call

Change-Id: I883613c71bf3880dba9edb6fdaa7fd0aee83d044

10 years agoVIGS: Delay surface destruction
Stanislav Vorobiov [Tue, 23 Jul 2013 15:40:03 +0000 (19:40 +0400)]
VIGS: Delay surface destruction

We should destroy surfaces on TTM BO destruction
instead of GEM free handler. The latter may cause races
like this:
1. GEM is created
2. GEM is mapped and written to
3. GEM is freed, but not unmapped. Thus, the host gets
   a "destroy_surface" command and target frees up
   an id from IDR.
4. Another GEM is created. Thus, it's assigned a freed id, which
   is id of first GEM, the host gets "create_surface" command
5. First GEM is unmapped, host gets "update_gpu" command with
   wrong data and size and crashes

The race occured on wayland/GBM during window resize

Change-Id: Ifddab147999e450e4b4affd7144d91f29fb39534

10 years agoVIGS: Don't call TTM's vm_close
Stanislav Vorobiov [Fri, 19 Jul 2013 16:35:30 +0000 (20:35 +0400)]
VIGS: Don't call TTM's vm_close

TTM's vm_close sets vm_private_data to NULL even if VMA is
still referenced, we don't want this since this may cause
a NULL pointer dereference. And this indeed happens sometimes
on wayland

Change-Id: Idf4af80ef0d472a1a480491cb56e6cc8d9d39123

10 years agoVIGS: Fixed vigs_fb_create return values
Stanislav Vorobiov [Fri, 12 Jul 2013 12:15:38 +0000 (16:15 +0400)]
VIGS: Fixed vigs_fb_create return values

Change-Id: Ice57af4d21899080c5572343f5734697cd20e21d
VIGS: Added dummy cursor handling

10 years agoVIGS: Lock console before fb notifier chain walk
Stanislav Vorobiov [Thu, 11 Jul 2013 09:23:18 +0000 (13:23 +0400)]
VIGS: Lock console before fb notifier chain walk

This is required to work properly with fbcon

Change-Id: I641e2762e7918cd9d9147f3a44ba2911a1f50019

10 years agoVIGS: Make GEM access tracking optional
Stanislav Vorobiov [Thu, 11 Jul 2013 06:43:20 +0000 (10:43 +0400)]
VIGS: Make GEM access tracking optional

For dumb GEM API we need to have GEM access tracking
disabled and always assume that access is RW.
Thus, we make GEM access tracking optional, so that user-mode
can specify if it's wanted or not

Change-Id: Ia8be76e1c15b0b4734997c16ad245b018c6d2ba6

10 years agoVIGS: GEM access tracking implemented
Stanislav Vorobiov [Tue, 2 Jul 2013 14:51:23 +0000 (18:51 +0400)]
VIGS: GEM access tracking implemented

In order to minimize GEM data transfers between
target and host we now track GEM memory accesses for each
VMA. Thus, we only update VRAM/GPU when there's at least one
VMA that requires it

Change-Id: Ib65ff22957e6a89d83329deca4753b69cd39ca3d

10 years agoVIGS: Walk fb notifier call chain on DPMS
Stanislav Vorobiov [Mon, 1 Jul 2013 11:52:59 +0000 (15:52 +0400)]
VIGS: Walk fb notifier call chain on DPMS

Since currently maru_bl is used to control LCD power
we need a way to trigger it. fbdev does this
automatically on FB_BLANK events by walking fb notifier call
chain. DRM doesn't do this on DPMS, so we need to do this
ourselves

Change-Id: I9585b06c027b210b4b563c2332c092a3084663e2

10 years agoVIGS: Automatically update VRAM when setting new root surface
Stanislav Vorobiov [Thu, 27 Jun 2013 14:24:28 +0000 (18:24 +0400)]
VIGS: Automatically update VRAM when setting new root surface

When we set new root surface (for example, as part of pageflip) we
should check if that surface is GPU dirty and if it is - update VRAM.
If we don't do this we might flip stuff without QEMU display
being updated

Change-Id: I4c9c630d09f5608fb6b09ecc3b54eb30695ef574

10 years agoVIGS: DRM VBLANK handling implemented
Stanislav Vorobiov [Mon, 24 Jun 2013 12:56:12 +0000 (16:56 +0400)]
VIGS: DRM VBLANK handling implemented

VIGS: DRM pageflip handling implemented

VIGS DRM driver now supports both VBLANK events and
pageflip events

Change-Id: I98d4f89ea6f5342839f05f1ebf6085294542dbc5

10 years agoVIGS: Remove "ttm shrink disable" hack
Stanislav Vorobiov [Tue, 18 Jun 2013 06:32:00 +0000 (10:32 +0400)]
VIGS: Remove "ttm shrink disable" hack

There's a right way to do this by specifying 0 in
accounted size for a BO. That way we can allocate as much BOs
as we want with used_mem always remaining 0

Change-Id: Ic1de1b832dea90b18b3441d504118773019ce9ee

10 years agoVIGS: Support custom resolutions
Stanislav Vorobiov [Mon, 17 Jun 2013 15:29:48 +0000 (19:29 +0400)]
VIGS: Support custom resolutions

Change-Id: I779f469eb5ef9c82dbc06493cdb3a448c1c30a51

10 years agoYaGL: Version bump
Stanislav Vorobiov [Mon, 10 Jun 2013 15:37:15 +0000 (19:37 +0400)]
YaGL: Version bump

Change-Id: I3c22f8e615f28e17d73747a43c0abab381eaa207

10 years agoVIGS: VRAM <-> GPU movements are now handled via page faults
Stanislav Vorobiov [Fri, 7 Jun 2013 14:40:28 +0000 (18:40 +0400)]
VIGS: VRAM <-> GPU movements are now handled via page faults

VIGS: Fixed update_gpu command

VRAM <-> GPU movements are now handled via page faults, thus, user space
can mmap as many GEMs as it likes, they'll all be in GPU placement by
default and moved to VRAM as needed on page faults. Page fault handler will
also take care of eviction in case of there's no free space in VRAM

update_gpu command wasn't updated for last protocol change, fixed it

Change-Id: Iaab0c760e68b4cb5f29bdd77d025f655f04ebb51

10 years agoVIGS: kernel now is surface dirty aware
Stanislav Vorobiov [Thu, 6 Jun 2013 16:48:36 +0000 (20:48 +0400)]
VIGS: kernel now is surface dirty aware

kernel now knows about dirty state of each surface

Change-Id: I7f801fa84f57ee9811fbd79bcb408507439acd62

10 years agoslp_global_lock added
Stanislav Vorobiov [Mon, 3 Jun 2013 13:29:28 +0000 (17:29 +0400)]
slp_global_lock added

Conflicts:

arch/x86/configs/i386_tizen_emul_defconfig
drivers/misc/Kconfig
drivers/misc/Makefile

Change-Id: I44c9714eafc02e98d35b4a09b6135211dd4d65ab

10 years agoVIGS: Protocol updated
Stanislav Vorobiov [Mon, 27 May 2013 15:38:40 +0000 (19:38 +0400)]
VIGS: Protocol updated

Change-Id: I4946fd3bee5d63ab22e5dd8fc280b91c23d67cc5

10 years agoYaGL: Version bump
Stanislav Vorobiov [Wed, 15 May 2013 09:02:34 +0000 (13:02 +0400)]
YaGL: Version bump

Change-Id: I29b65916421e8718dddb17f357c8b928501135d0

10 years agoVIGS: Fixed GEM reserve deadlock
Stanislav Vorobiov [Mon, 6 May 2013 16:39:28 +0000 (20:39 +0400)]
VIGS: Fixed GEM reserve deadlock

Change-Id: Ic4609ff43ea4689f13a56da41696f6a500d21a64

10 years agoVIGS: Dirty flag support in vigs_surface
Stanislav Vorobiov [Mon, 6 May 2013 14:48:07 +0000 (18:48 +0400)]
VIGS: Dirty flag support in vigs_surface

Dirty flag in vigs_surface is need in order to tell the kernel
that we want contents of VRAM to be uploaded into GPU when the surface
is evicted from VRAM. The flag is automatically cleared whenever
update_gpu command is found in execbuffer

Change-Id: I78e20f541d56ba958c5ac15d00b2ed7a2c841f2d

10 years agoVIGS: Potential deadlock fixed
Stanislav Vorobiov [Tue, 30 Apr 2013 13:10:46 +0000 (17:10 +0400)]
VIGS: Potential deadlock fixed

Change-Id: I6e7bfc824fc637bcc77896919c504da17eddfe2b

10 years agoVIGS: Command list patching implemented
Stanislav Vorobiov [Mon, 29 Apr 2013 14:02:11 +0000 (18:02 +0400)]
VIGS: Command list patching implemented

It's necessary to patch commands such as update_vram and update_gpu
in kernel since only kernel knows about VRAM offset of a surface

Change-Id: Ia4a0f53e768d40d8323cebfe101b8e86c4c21261

10 years agoVIGS: Return some more info for GEMs
Stanislav Vorobiov [Fri, 26 Apr 2013 13:46:03 +0000 (17:46 +0400)]
VIGS: Return some more info for GEMs

Change-Id: Ia7b4ce407e64f36063b21d987c602af6c5ffbc16

10 years agoVIGS: We now send commands to host again
Stanislav Vorobiov [Fri, 26 Apr 2013 10:53:59 +0000 (14:53 +0400)]
VIGS: We now send commands to host again

Host side code is fixed to work via new protocol

Change-Id: I4fd731e07e451923e649d1ba8bda3dd903b94023

10 years agoVIGS: Introduce an idr to generate surface ids
Stanislav Vorobiov [Fri, 26 Apr 2013 06:08:48 +0000 (10:08 +0400)]
VIGS: Introduce an idr to generate surface ids

Using mmap offsets as surface ids is not good since they're 64-bit

Change-Id: I03356f4f5de67153d87cdb73e4c0102b67883793

10 years agoVIGS: Refactoring for DRI2
Stanislav Vorobiov [Wed, 24 Apr 2013 06:48:55 +0000 (10:48 +0400)]
VIGS: Refactoring for DRI2

In order to support DRI2 we must move surfaces from X.Org
into kernel. This implies having additional TTM placement - GPU placement.
We must support eviction in vigs_mman in order to be able to create
surfaces that don't occupy VRAM (Now this is done in X.Org).
Also, command execution must be moved from userland to kernel as well
and we also want to add ability to batch several commands in order
to minimize user-kernel transitions and target-host transitions.

Change-Id: I0a5d3c7627b262c0011c485d8918d125775e9a53

10 years agoYaGL: bump version
Igor Mitsyanko [Fri, 18 Jan 2013 17:20:28 +0000 (21:20 +0400)]
YaGL: bump version

Change-Id: I0ce50b9a42ce26f9dabc519a06cbc4fb2cff7ed5
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
10 years agoVIGS: Protocol updated
Stanislav Vorobiov [Fri, 11 Jan 2013 08:20:10 +0000 (12:20 +0400)]
VIGS: Protocol updated

Change-Id: If8e47f16448a39d5e6e1722fe0f497c03db3d154

10 years agoVIGS: Replace "Virtual" connector with "LVDS"
Stanislav Vorobiov [Wed, 9 Jan 2013 17:09:57 +0000 (21:09 +0400)]
VIGS: Replace "Virtual" connector with "LVDS"

e17 devicemgr seems to depend on it

Change-Id: I0bbe82c5c6ea28a1af69189ab05e4189545f8b1e

10 years agoVIGS: Implemented first version
Stanislav Vorobiov [Tue, 25 Dec 2012 14:29:17 +0000 (18:29 +0400)]
VIGS: Implemented first version

Conflicts:

drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile

Change-Id: I5ef50259bb6820083274baf5088cee236f7a4bf4

10 years agoYaGL: bump version
Igor Mitsyanko [Thu, 13 Dec 2012 13:26:29 +0000 (17:26 +0400)]
YaGL: bump version

Bump version after GLES1 support was merged to QEMU and target parts.

Change-Id: I11e266c393297a9fc2f4212c46000ae77d980f92
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
10 years agoYaGL: Version bump
Stanislav Vorobiov [Wed, 12 Dec 2012 08:01:38 +0000 (12:01 +0400)]
YaGL: Version bump

Change-Id: I117206cb1ba1eae0bf86e482b41bdd52c075458e