firefly-linux-kernel-4.4.55.git
8 years agodrm/rockchip: disabled the plane alpha if it's bottom layer
Mark Yao [Tue, 21 Jun 2016 06:31:09 +0000 (14:31 +0800)]
drm/rockchip: disabled the plane alpha if it's bottom layer

HardWare limited, the bottom layer not support per-pixel alpha,

Change-Id: I174da1d3d3cfff8d0b6cd6dfab4873438895e56d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: set unused layer with top zpos
Mark Yao [Tue, 21 Jun 2016 06:30:19 +0000 (14:30 +0800)]
drm/rockchip: set unused layer with top zpos

Hardware limited, we should keep all unused layer same
with the same zpos, otherwise, would get display abnormal.

Change-Id: I417a6a14731148a89f0372cc028e43a94b56e4d3
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: fix vop value mask
Mark Yao [Tue, 21 Jun 2016 06:26:54 +0000 (14:26 +0800)]
drm/rockchip: fix vop value mask

Change-Id: Iedfb871f2909a427ca97f3014f4b0e0b565d06f0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: add DRM_RENDER_ALLOW
Mark Yao [Tue, 21 Jun 2016 06:24:58 +0000 (14:24 +0800)]
drm/rockchip: add DRM_RENDER_ALLOW

Change-Id: Ia0159b877f7d8b2bb5cecf3b352b67d9c76c7c97
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: use new crtc state on atomic check
Mark Yao [Fri, 1 Jul 2016 06:25:13 +0000 (14:25 +0800)]
drm/rockchip: vop: use new crtc state on atomic check

That is wrong use old crtc mode on atomic check.

Change-Id: Ie37bd842f8bafca04303d641269a84a6016457f4
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: move rockchip drm core compile to the last one
Mark Yao [Thu, 30 Jun 2016 06:31:18 +0000 (14:31 +0800)]
drm/rockchip: move rockchip drm core compile to the last one

All rockchip drm modules are module_init, so the probe sequence
is judged by compile sequence.

We want the rockchip drm core probe on the last one, so if components
call probe defer on bind, would use rockchip drm core to do probe defer.

Change-Id: Ibda12998545a93327bdf35bc1b8386034189ba6a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM64: dts: rk3399-box-808-android: modify pinctrl for spdif
Zhangbin Tong [Fri, 1 Jul 2016 07:37:23 +0000 (15:37 +0800)]
ARM64: dts: rk3399-box-808-android: modify pinctrl for spdif

Change-Id: I0e9dd45820900463c7c144b8eff4e89c64618061
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
8 years agoMALI: rockchip: add utgard(mali400) src dir
chenzhen [Fri, 3 Jun 2016 02:14:49 +0000 (10:14 +0800)]
MALI: rockchip: add utgard(mali400) src dir

Change-Id: I519dfc05fa762e9145404a9f12b4c0092364c4a8
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoMALI: rockchip: upgrade utgard DDK to r6p0-01rel1
chenzhen [Mon, 15 Feb 2016 09:13:10 +0000 (17:13 +0800)]
MALI: rockchip: upgrade utgard DDK to r6p0-01rel1

Change-Id: I0c88698a29855905da05b45c54f37beddcb6fcd6
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoMALI: utgard: rockchip: tidy the files to track
chenzhen [Tue, 12 Jan 2016 09:31:02 +0000 (17:31 +0800)]
MALI: utgard: rockchip: tidy the files to track

Change-Id: I8629720bc63eae8b2c309d89d2370623ef614948
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoMALI: rockchip: upgrade utgard DDK to r6p0-01rel0
chenzhen [Tue, 12 Jan 2016 08:58:39 +0000 (16:58 +0800)]
MALI: rockchip: upgrade utgard DDK to r6p0-01rel0

Conflicts:

drivers/gpu/arm/mali400/mali/common/mali_control_timer.c
drivers/gpu/arm/mali400/mali/include/linux/mali/mali_utgard_uk_types.h
drivers/gpu/arm/mali400/mali/linux/mali_osk_mali.c
drivers/gpu/arm/mali400/mali/linux/mali_ukk_wrappers.h

Change-Id: I13d02e836efcebd0dd2367ce138aac258dacda24
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoUPSTREAM: DT/arm,gic-v3: Documment PPI partition support
Marc Zyngier [Mon, 11 Apr 2016 08:57:55 +0000 (09:57 +0100)]
UPSTREAM: DT/arm,gic-v3: Documment PPI partition support

Add a decription of the PPI partitioning support.

Change-Id: I11bb88c45556630207fb3ff534fa5645b73cb3f0
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Link: http://lkml.kernel.org/r/1460365075-7316-6-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 287e9357abcc0ef079bf4e439e098a3bd6246a05)

8 years agoUPSTREAM: irqchip/gic-v3: Add support for partitioned PPIs
Marc Zyngier [Mon, 11 Apr 2016 08:57:54 +0000 (09:57 +0100)]
UPSTREAM: irqchip/gic-v3: Add support for partitioned PPIs

Plug the partitioning layer into the GICv3 PPI code, parsing the
DT and building the partition affinities and providing the generic
code with partition data and callbacks.

Change-Id: I1f9049d48388b899e99bcadd6be729729d0fe6bb
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: http://lkml.kernel.org/r/1460365075-7316-5-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit e3825ba1af3a27d7522c9f5f929f5a13b8b138ae)

8 years agoUPSTREAM: irqchip: Add per-cpu interrupt partitioning library
Marc Zyngier [Mon, 11 Apr 2016 08:57:53 +0000 (09:57 +0100)]
UPSTREAM: irqchip: Add per-cpu interrupt partitioning library

We've unfortunately started seeing a situation where percpu interrupts
are partitioned in the system: one arbitrary set of CPUs has an
interrupt connected to a type of device, while another disjoint
set of CPUs has the same interrupt connected to another type of device.

This makes it impossible to have a device driver requesting this interrupt
using the current percpu-interrupt abstraction, as the same interrupt number
is now potentially claimed by at least two drivers, and we forbid interrupt
sharing on per-cpu interrupt.

A solution to this is to turn things upside down. Let's assume that our
system describes all the possible partitions for a given interrupt, and
give each of them a unique identifier. It is then possible to create
a namespace where the affinity identifier itself is a form of interrupt
number. At this point, it becomes easy to implement a set of partitions
as a cascaded irqchip, each affinity identifier being the HW irq.

This allows us to keep a number of nice properties:
- Each partition results in a separate percpu-interrupt (with a restrictied
  affinity), which keeps drivers happy.
- Because the underlying interrupt is still per-cpu, the overhead of
  the indirection can be kept pretty minimal.
- The core code can ignore most of that crap.

For that purpose, we implement a small library that deals with some of
the boilerplate code, relying on platform-specific drivers to provide
a description of the affinity sets and a set of callbacks.

Conflicts:
drivers/irqchip/Kconfig
drivers/irqchip/Makefile

Change-Id: Ie6b2bc8c4c152f0dcd3fbcab8950fae781338322
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: http://lkml.kernel.org/r/1460365075-7316-4-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 9e2c986cb460bf97154f18e85aa833739a1e8dc7)

8 years agoUPSTREAM: genirq: Allow the affinity of a percpu interrupt to be set/retrieved
Marc Zyngier [Mon, 11 Apr 2016 08:57:52 +0000 (09:57 +0100)]
UPSTREAM: genirq: Allow the affinity of a percpu interrupt to be set/retrieved

In order to prepare the genirq layer for the concept of partitionned
percpu interrupts, let's allow an affinity to be associated with
such an interrupt. We introduce:

- irq_set_percpu_devid_partition: flag an interrupt as a percpu-devid
  interrupt, and associate it with an affinity
- irq_get_percpu_devid_partition: allow the affinity of that interrupt
  to be retrieved.

This will allow a driver to discover which CPUs the per-cpu interrupt
can actually fire on.

Change-Id: I251774db34d1f0145d6c051265886c22f41d941e
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: http://lkml.kernel.org/r/1460365075-7316-3-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 222df54fd8b7641dcc81476f157806bb3144ee1d)

8 years agoUPSTREAM: irqdomain: Allow domain matching on irq_fwspec
Marc Zyngier [Mon, 11 Apr 2016 08:57:51 +0000 (09:57 +0100)]
UPSTREAM: irqdomain: Allow domain matching on irq_fwspec

When iterating over the irq domain list, we try to match a domain
either by calling a match() function or by comparing a number
of fields passed as parameters.

Both approaches are a bit restrictive:
- match() is DT specific and only takes a device node
- the fallback case only deals with the fwnode_handle

It would be useful if we had a per-domain function that would
actually perform the matching check on the whole of the
irq_fwspec structure. This would allow for a domain to triage
matching attempts that need to extend beyond the fwnode.

Let's introduce irq_find_matching_fwspec(), which takes a full
blown irq_fwspec structure, and call into a select() function
implemented by the irqdomain. irq_find_matching_fwnode() is
made a wrapper around irq_find_matching_fwspec in order to
preserve compatibility.

Change-Id: I07df9af068d114c80cd97b9cb987a70c0e24afda
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: http://lkml.kernel.org/r/1460365075-7316-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 651e8b54abdeeaa36f5f54ffa05c18707a3cc1d0)

8 years agoUPSTREAM: irqchip/gic-v3: Refactor gic_of_init() for GICv3 driver
Tomasz Nowicki [Tue, 19 Jan 2016 13:11:14 +0000 (14:11 +0100)]
UPSTREAM: irqchip/gic-v3: Refactor gic_of_init() for GICv3 driver

Isolate hardware abstraction (FDT) code to gic_of_init().
Rest of the logic goes to gic_init_bases() and expects well
defined data to initialize GIC properly. The same solution
is used for GICv2 driver.

This is needed for ACPI initialization later.

Change-Id: I61fcbd96ecd2dc8130cdd2d6ce79841eb184e87b
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit db57d7460ea74de2204ddc303520753f256ea67d)

8 years agoUPSTREAM: dt-bindings: arm, gic-v3: require that reserved cells are always 0
Will Deacon [Wed, 3 Feb 2016 18:00:58 +0000 (18:00 +0000)]
UPSTREAM: dt-bindings: arm, gic-v3: require that reserved cells are always 0

The arm,gic-v3 binding was written with good intentions and doesn't
enforce interrupt-cells to be 3, therefore making it easy to extend
the irq description in future if necessary:

  > Cells 4 and beyond are reserved for future use.

Unfortunately, this sentence is immediately followed up with:

  > When the 1st cell has a value of 0 or 1, cells 4 and beyond act as
  > padding, and may be ignored. It is recommended that padding cells
  > have a value of 0.

Consequently, any extensions to the PPI or SPI interrupt specifiers must
be able to work with random crap from legacy DTs, effectively
necessitating a new interrupt type in the first cell. Sigh.

This patch fixes the text so that additional, reserved cells are
required to be zero. This looks like a reasonable thing to require and
is already satisifed by the .dts files in-tree.

Change-Id: Ia5b07ab4243c0a4492b7c4516af95b86974c42a0
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 4aff7b854611d91c5fefb1553eb4c328123095ae)

8 years agoUPSTREAM: irqdomain: Allow domain lookup with DOMAIN_BUS_WIRED token
Marc Zyngier [Tue, 26 Jan 2016 13:52:25 +0000 (13:52 +0000)]
UPSTREAM: irqdomain: Allow domain lookup with DOMAIN_BUS_WIRED token

Let's take the (outlandish) example of an interrupt controller
capable of handling both wired interrupts and PCI MSIs.

With the current code, the PCI MSI domain is going to be tagged
with DOMAIN_BUS_PCI_MSI, and the wired domain with DOMAIN_BUS_ANY.

Things get hairy when we start looking up the domain for a wired
interrupt (typically when creating it based on some firmware
information - DT or ACPI).

In irq_create_fwspec_mapping(), we perform the lookup using
DOMAIN_BUS_ANY, which is actually used as a wildcard. This gives
us one chance out of two to end up with the wrong domain, and
we try to configure a wired interrupt with the MSI domain.
Everything grinds to a halt pretty quickly.

What we really need to do is to start looking for a domain that
would uniquely identify a wired interrupt domain, and only use
DOMAIN_BUS_ANY as a fallback.

In order to solve this, let's introduce a new DOMAIN_BUS_WIRED
token, which is going to be used exactly as described above.
Of course, this depends on the irqchip to setup the domain
bus_token, and nobody had to implement this so far.

Only so far.

Change-Id: Ia71c7475354eb38ab9b15423560aa3d28ae16381
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Link: http://lkml.kernel.org/r/1453816347-32720-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 530cbe100ef7587aa5b5ac3a4b670cda4d50e598)

8 years agoUPSTREAM: irqdomain: Introduce is_fwnode_irqchip helper
Suravee Suthikulpanit [Thu, 10 Dec 2015 16:55:28 +0000 (08:55 -0800)]
UPSTREAM: irqdomain: Introduce is_fwnode_irqchip helper

Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.

Change-Id: I65ab9e1350428de18864ba493256b959efc01f45
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 75aba7b0e9ac416ca53c0c97680b8e9aedf09284)

8 years agoUPSTREAM: arm64: perf: add support for Cortex-A72
Will Deacon [Tue, 22 Dec 2015 14:45:35 +0000 (14:45 +0000)]
UPSTREAM: arm64: perf: add support for Cortex-A72

Cortex-A72 has a PMUv3 implementation that is compatible with the PMU
implemented by Cortex-A57.

This patch hooks up the new compatible string so that the Cortex-A57
event mappings are used.

Change-Id: I06b39699fa019d61be81a1a275f7eb6eed17808a
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 5d7ee87708d4d86fcc32afc9552d05f7625d303d)

8 years agoUPSTREAM: arm64: perf: add format entry to describe event -> config mapping
Will Deacon [Tue, 22 Dec 2015 14:42:57 +0000 (14:42 +0000)]
UPSTREAM: arm64: perf: add format entry to describe event -> config mapping

It's all very well providing an events directory to userspace that
details our events in terms of "event=0xNN", but if we don't define how
to encode the "event" field in the perf attr.config, then it's a waste
of time.

This patch adds a single format entry to describe that the event field
occupies the bottom 10 bits of our config field on ARMv8 (PMUv3).

Change-Id: I71f9ebf92cd2f7083c10f20a8707a91d4517cbcb
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 57d74123954dfe70fad12724d19f743ed14cec90)

8 years agoUPSTREAM: arm64: perf: Correct Cortex-A53/A57 compatible values
Geert Uytterhoeven [Tue, 15 Dec 2015 08:33:20 +0000 (09:33 +0100)]
UPSTREAM: arm64: perf: Correct Cortex-A53/A57 compatible values

Use commas instead of periods.

Change-Id: I6762decd0390c9f8914e4f314a5212875d200ed5
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit aae881ad73460e1b2aea01f079a0541bd5a9136c)

8 years agoUPSTREAM: arm64: perf: Add event descriptions
Drew Richardson [Thu, 22 Oct 2015 14:07:32 +0000 (07:07 -0700)]
UPSTREAM: arm64: perf: Add event descriptions

Add additional information about the ARM architected hardware events
to make counters self describing. This makes the hardware PMUs easier
to use as perf list contains possible events instead of users having
to refer to documentation like the ARM TRMs.

Change-Id: Idb004bb6d9889f8e63f518d105e238d43956b561
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 9e9caa6a496174e53d7753baa4779717771da4a7)

8 years agoUPSTREAM: arm64: perf: Convert event enums to #defines
Drew Richardson [Thu, 22 Oct 2015 14:07:01 +0000 (07:07 -0700)]
UPSTREAM: arm64: perf: Convert event enums to #defines

The enums are not necessary and this allows the event values to be
used to construct static strings at compile time.

Change-Id: I01049434e5ddc5c51b7ae914e9c55a0ef6bf66d9
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 90381cba64591e27d0e8bbfe71bf8a98bd2a3db3)

8 years agovideo: rockchip: fb: update format define
Huang Jiachai [Tue, 28 Jun 2016 02:52:24 +0000 (10:52 +0800)]
video: rockchip: fb: update format define

Change-Id: Ief308474bfdbacadcc85e5a662d2f0a070c0c5cf
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years agovideo: rockchip: rk fb: disable all layer and update vop state when switch screen
Huang Jiachai [Tue, 21 Jun 2016 07:06:01 +0000 (15:06 +0800)]
video: rockchip: rk fb: disable all layer and update vop state when switch screen

Change-Id: Ibdd82c477b2fdd2f21b5cbb708048bebbf1dfc7b
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years agovideo: rockchip: vop: 3399: close vop when hdmi unplug
Huang Jiachai [Tue, 21 Jun 2016 07:04:45 +0000 (15:04 +0800)]
video: rockchip: vop: 3399: close vop when hdmi unplug

Change-Id: Ia75972e95aa738a4da5e766f9363250a63154cc3
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years ago[media] rockchip-vpu: change V4L2_CTRL_ID2CLASS to V4L2_CTRL_ID2WHICH
Jeffy Chen [Wed, 8 Jun 2016 06:18:24 +0000 (14:18 +0800)]
[media] rockchip-vpu: change V4L2_CTRL_ID2CLASS to V4L2_CTRL_ID2WHICH

Change-Id: I700e8564caa08eb3239d4801cef9c1e04699fe6f
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rockchip-vpu: reconstructs for futher chips
Jeffy Chen [Thu, 2 Jun 2016 07:05:52 +0000 (15:05 +0800)]
CHROMIUM: [media] rockchip-vpu: reconstructs for futher chips

Change-Id: Ia88f45b37a1af829723e6b8cb9d8ff3cb5f54530
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rockchip-vpu: reconstructs hw codes for futher chips
Jeffy Chen [Fri, 3 Jun 2016 07:56:14 +0000 (15:56 +0800)]
CHROMIUM: [media] rockchip-vpu: reconstructs hw codes for futher chips

Change-Id: I3ad3a5220d5dc5b952d9e0e11f7142bc30a144f9
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rockchip-vpu: rename rk3288-vpu to rockchip-vpu
Jeffy Chen [Fri, 3 Jun 2016 07:55:23 +0000 (15:55 +0800)]
CHROMIUM: [media] rockchip-vpu: rename rk3288-vpu to rockchip-vpu

Note: dec/enc dev name change to rockchip-vpu-dec/rockchip-vpu-enc

Change-Id: I35d168fa7ccf6df4465affd01f6c3c5456182897
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rockchip-vpu: rename rk3288-vpu sources to rockchip-vpu
Jeffy Chen [Wed, 1 Jun 2016 08:43:23 +0000 (16:43 +0800)]
CHROMIUM: [media] rockchip-vpu: rename rk3288-vpu sources to rockchip-vpu

Change-Id: I66ba2cde8984e56ffa3a27515e4e6380af8544d8
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rockchip-vpu: add dma-iommu support on arm64
Jeffy Chen [Wed, 1 Jun 2016 09:12:58 +0000 (17:12 +0800)]
CHROMIUM: [media] rockchip-vpu: add dma-iommu support on arm64

Change-Id: Ieeaed0320202a6d056b6c248d5b72df2419bf29c
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rockchip-vpu: fix compile errors
Jeffy Chen [Wed, 1 Jun 2016 09:12:58 +0000 (17:12 +0800)]
CHROMIUM: [media] rockchip-vpu: fix compile errors

Adjust to new v4l2 APIs and fix some debug logs.

Change-Id: Iafba102fa326c669efcbb0baeb8897fe660dcdd4
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: move rk3288-vpu to rockchip-vpu
Jeffy Chen [Wed, 1 Jun 2016 08:43:23 +0000 (16:43 +0800)]
CHROMIUM: [media] rk3288-vpu: move rk3288-vpu to rockchip-vpu

Change-Id: I4c884307550b0782c29a482d5df6793132c3a9ff
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoFROMLIST: common: DMA-mapping: add DMA_ATTR_ALLOC_SINGLE_PAGES attribute
Douglas Anderson [Mon, 11 Jan 2016 17:30:24 +0000 (09:30 -0800)]
FROMLIST: common: DMA-mapping: add DMA_ATTR_ALLOC_SINGLE_PAGES attribute

This patch adds the DMA_ATTR_ALLOC_SINGLE_PAGES attribute to the
DMA-mapping subsystem.

This attribute can be used as a hint to the DMA-mapping subsystem that
it's likely not worth it to try to allocate large pages behind the
scenes.  Large pages are likely to make an IOMMU TLB work more
efficiently but may not be worth it.  See the Documentation contained in
this patch for more details about this attribute and when to use it.

Note that the name of the hint (DMA_ATTR_ALLOC_SINGLE_PAGES) is loosely
based on the name MADV_NOHUGEPAGE.  Just as there is MADV_NOHUGEPAGE
vs. MADV_HUGEPAGE we could also add an "opposite" attribute to
DMA_ATTR_ALLOC_SINGLE_PAGES.  Without having the "opposite" attribute
the lack of DMA_ATTR_ALLOC_SINGLE_PAGES means "use your best judgement
about whether to use small pages or large pages".

BUG=chromium:570532
TEST=Stress memory and watch cat videos.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
(am from https://patchwork.kernel.org/patch/8007151/)
Reviewed-on: https://chromium-review.googlesource.com/322334
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Change-Id: I9d0af41446b5c41d6f39a2b77e711179d0b40eca
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: vb2: Add a new "use_dma_bidirectional" queue flag.
Pawel Osciak [Wed, 16 Sep 2015 12:21:49 +0000 (21:21 +0900)]
CHROMIUM: vb2: Add a new "use_dma_bidirectional" queue flag.

When set to 1 for CAPTURE queues by the driver on calling vb2_queue_init(),
forces the buffers on the queue to be allocated/mapped with
DMA_BIDIRECTIONAL DMA direction flag, instead of DMA_FROM_DEVICE. This
allows the device not only to write to the buffers, but also read out from
them. This may be useful e.g. for codec hardware, which may be using
CAPTURE buffers as reference to decode other buffers.

This flag is ignored for OUTPUT queues, as we don't want to allow HW to
be able to write to OUTPUT buffers.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
BUG=chrome-os-partner:45346
TEST=video playback

Reviewed-on: https://chromium-review.googlesource.com/300726
Commit-Ready: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Change-Id: Ifba955eef75ac23c9a13edab04bc1fe7f5375c70
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: vb2: Store dma_dir in vb2_queue.
Pawel Osciak [Wed, 16 Sep 2015 12:12:40 +0000 (21:12 +0900)]
CHROMIUM: vb2: Store dma_dir in vb2_queue.

Store dma_dir in struct vb2_queue and reuse it, instead of recalculating
it each time.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
BUG=chrome-os-partner:45346
TEST=video playback

Reviewed-on: https://chromium-review.googlesource.com/300725
Commit-Ready: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Owen Lin <owenlin@chromium.org>
Conflicts:
drivers/media/v4l2-core/videobuf2-core.c

Change-Id: Ia5405cd758ffef0b0319d184a2f32699ebc805ea
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoUPSTREAM: v4l: add V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME.
Wu-Cheng Li [Tue, 19 Jan 2016 07:07:09 +0000 (15:07 +0800)]
UPSTREAM: v4l: add V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME.

Some drivers also need a control like
V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE to force an encoder
key frame. Add a general V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME
so the new drivers and applications can use it.

Signed-off-by: Wu-Cheng Li <wuchengli@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 0c8485ca3f2aaf7842d45ba24c667a9492c9900f)
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:572825
TEST=Build and boot oak-rev5 to UI
TEST=emerge-smaug chromeos-kernel-3_18

Reviewed-on: https://chromium-review.googlesource.com/328870
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Change-Id: I45de3048d41edbe443b3d202c17e79f2d448213b
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Add V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME
Heng-Ruey Hsu [Fri, 20 May 2016 10:16:32 +0000 (18:16 +0800)]
CHROMIUM: [media] rk3288-vpu: Add V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME

Also remove unused V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE.

BUG=chrome-os-partner:53551
TEST=Passed vea test cases.
CQ-DEPEND=CL:346361

Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346390
Commit-Ready: Heng-ruey Hsu <henryhsu@chromium.org>
Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Change-Id: I6ad197191e57de9233d201d8196b3edb4df7e560
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: rk3288-vpu: Set DMA_ATTR_ALLOC_SINGLE_PAGES
Douglas Anderson [Wed, 6 Jan 2016 18:04:33 +0000 (10:04 -0800)]
CHROMIUM: rk3288-vpu: Set DMA_ATTR_ALLOC_SINGLE_PAGES

We do video allocation all the time and we need it to be fast.  Plus TLB
efficiency isn't terribly important for video.

That means we want to set DMA_ATTR_ALLOC_SINGLE_PAGES

See also the previous change ("ARM: dma-mapping: Use
DMA_ATTR_ALLOC_SINGLE_PAGES hint to optimize alloc")

BUG=chromium:570532
TEST=Memory pressure + cat videos is even smoother!

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/322336
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Change-Id: I8bda3d9655daaa893c7bead7108b863607d1614f
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: rk3288-vpu: Set use_dma_bidirectional=1 for decoder CAPTURE queue
Pawel Osciak [Wed, 16 Sep 2015 12:23:29 +0000 (21:23 +0900)]
CHROMIUM: rk3288-vpu: Set use_dma_bidirectional=1 for decoder CAPTURE queue

This allows us to read out from decoded buffers to use them for reference
for decoding other frames.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
BUG=chrome-os-partner:45346
TEST=video playback

Reviewed-on: https://chromium-review.googlesource.com/300727
Commit-Ready: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Owen Lin <owenlin@chromium.org>
Change-Id: I454916b0862e541d1362413b29bfd3e51c8e3e6d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: rk3288-vpu: Add DMABUF to io_modes.
Owen Lin [Tue, 15 Sep 2015 08:08:50 +0000 (16:08 +0800)]
CHROMIUM: rk3288-vpu: Add DMABUF to io_modes.

To support gralloc buffers.

BUG=chrome-os-partner:45346
TEST=Play a video on minnie.

Signed-off-by: Owen Lin <owenlin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/299613
Commit-Ready: Owen Lin <owenlin@chromium.org>
Tested-by: Owen Lin <owenlin@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I7ba9c7a0640fa822c43f2442ddbdc257609bc09a
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Workaround for encode after decode
Tomasz Figa [Fri, 17 Jul 2015 10:31:54 +0000 (19:31 +0900)]
CHROMIUM: [media] rk3288-vpu: Workaround for encode after decode

On RK3288 there is an issue with certain hardware state being corrupted
while decoding certain streams, which affects encoding task run directly
after that decoding task. To reinitialize the state properly, a dummy
encoding of a single 64x64 pixels keyframe must be performed before the
real encoding is run.

This patch adds necessary workaround code to the driver, which makes it
execute an encoding task using dummy buffers with static parameters
manually selected for lowest performance overhead and to assure that
aforementioned hardware state is reinitialized.

BUG=chrome-os-partner:41585
TEST=AppRTC loopback

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/286284
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I019d1983633ec2cf2818956a7bf988314d853cdf
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Add helper for encode plane sizes calculation
Tomasz Figa [Mon, 27 Jul 2015 07:07:30 +0000 (16:07 +0900)]
CHROMIUM: [media] rk3288-vpu: Add helper for encode plane sizes calculation

Currently plane sizes calculation on encoder side is happening only in
vidioc_s_fmt() function, howerver as a prerequisite for further patch
adding further code which needs this operation, this patch adds a common
helper function, which performs this operation.

BUG=chrome-os-partner:41585
TEST=AppRTC loopback

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289047
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I6e5769667ae40b3fb5758ce9471b4ddd6866183f
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Add helper to get context operating mode
Tomasz Figa [Mon, 27 Jul 2015 07:07:30 +0000 (16:07 +0900)]
CHROMIUM: [media] rk3288-vpu: Add helper to get context operating mode

Currently there is only one place in the code checking whether given
context is decoding or encoding. However as a prerequisite for further
patch adding more such checks, this patch adds a common helper function
which returns appropriate enum value depending on operating mode of
given context.

BUG=chrome-os-partner:41585
TEST=AppRTC loopback

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288661
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: Ide145770ca77897ada3cb878c4b9c9787824a827
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: vp8e: increase frame hdr size
Jeffy Chen [Mon, 15 Jun 2015 19:19:51 +0000 (03:19 +0800)]
CHROMIUM: [media] rk3288-vpu: vp8e: increase frame hdr size

Currently, FRAME_HEADER_SIZE is 256, but i've saw
the hdr be larger then 256 when doing screen share.
so we should increase it.

This needs change the define in v4lplugin too.
(change id: Ia6c2271b727218692c4e0b1603d243f32d2f1d77)

BUG=chromium:497324
TEST=screen share through Hangouts

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/277398
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Change-Id: I06e7712420404c43661774e176a7b9333ddc3def
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Implement VIDIOC_ENUM_FRAMESIZES
Tomasz Figa [Mon, 27 Apr 2015 06:38:32 +0000 (15:38 +0900)]
CHROMIUM: [media] rk3288-vpu: Implement VIDIOC_ENUM_FRAMESIZES

This patch adds implementations of VIDIOC_ENUM_FRAMESIZES for rk3288-vpu
encoder and decoder devices. This IOCTL lets the userspace learn about
frame size limits of the hardware.

BUG=chromium:485409
TEST=vda/veatests, Chrome with crrev.com/1097913002.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/269867
Reviewed-by: Heng-ruey Hsu <henryhsu@google.com>
Change-Id: Ia23a89c2f380b16cc7ef8338d33946d62f8a68fe
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Make find_format() use fourcc directly
Tomasz Figa [Mon, 27 Apr 2015 06:36:25 +0000 (15:36 +0900)]
CHROMIUM: [media] rk3288-vpu: Make find_format() use fourcc directly

As a prerequisite for using find_format() helpers from contexts in which
a v4l2_format struct is not available, this patch makes it take u32 fourcc
as its argument instead, since it was the only member of that struct it
actually used anyway.

BUG=chromium:485409
TEST=vda/veatests, Chrome with crrev.com/1097913002.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/269866
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Trybot-Ready: Pawel Osciak <posciak@chromium.org>

Change-Id: Ifa9c4e3e378fbeafb6453a01b9e4f7c11606025b
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Use macros for frame size limits
Tomasz Figa [Mon, 27 Apr 2015 06:34:32 +0000 (15:34 +0900)]
CHROMIUM: [media] rk3288-vpu: Use macros for frame size limits

As a prerequisite for reusing those values in new code, this patch
creates appropriate macros for them and updates current code to use
them.

BUG=chromium:485409
TEST=vda/veatests, Chrome with crrev.com/1097913002.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/269865
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Trybot-Ready: Pawel Osciak <posciak@chromium.org>

Change-Id: I95b1afbeff91aeb71d1748bf05895e769385f76e
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Require kernel mapping only for encoder output
Tomasz Figa [Mon, 13 Apr 2015 05:49:43 +0000 (14:49 +0900)]
CHROMIUM: [media] rk3288-vpu: Require kernel mapping only for encoder output

For rk3288-vpu, kernel mapping of video buffers is required only for
encoder bitstream output buffers for additional bistream formatting. Any
other buffers can be allocated without kernel mapping, greatly
conserving the limited pool of vmalloc memory.

This patch modifies the rk3288-vpu driver to use the newly added vb2-dc
interface to create two separate allocation contexts, one for
allocations with kernel mapping and one without.

BUG=chrome-os-partner:38873
TEST=vda/vea unit tests

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/265364
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I4154802dda2329934dea675a242d67e80b925db0
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Add suspend/resume handlers
Tomasz Figa [Thu, 2 Apr 2015 05:03:26 +0000 (14:03 +0900)]
CHROMIUM: [media] rk3288-vpu: Add suspend/resume handlers

Currently the driver does not implement suspend and resume PM ops.
However when system is entering suspend, the driver should prevent
submitting further runs to the hardware and wait for current run to be
finished. To resume playback after leaving sleep state, next run, if
available, must be submitted to the hardware.

This patch adds proper suspend and resume callbacks to handle this.

BUG=chrome-os-partner:38565
TEST=suspend and resume veyron_jerry several times with video playing

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/263662
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: Id07b7d681ef78655879ce77c9705b1c25231df9d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Preserve picture positions in H264 DPB lists
Tomasz Figa [Tue, 31 Mar 2015 13:40:03 +0000 (22:40 +0900)]
CHROMIUM: [media] rk3288-vpu: Preserve picture positions in H264 DPB lists

Even though H264 standard allows arbitrary order of DPB entries, the
hardware requires picture with given POC to use the same DPB entry for
its whole lifetime. This means that the driver needs to reorder DPB
array to suit this requirement.

This patch modifies the driver to reorder H264 DPB and should fix
corruption issues when DPB array received from userspace does not meet
hardware requirements.

BUG=chrome-os-partner:38416
TEST=http://www.youtube.com/embed/YE7VzlLtp-4

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/263370
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Ibbd0e2bc4e527aadd21ef08ec68866678bf8a659
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Fix image size clamping
Tomasz Figa [Mon, 23 Mar 2015 06:16:32 +0000 (15:16 +0900)]
CHROMIUM: [media] rk3288-vpu: Fix image size clamping

Current code always assumed the maximum supported resolution to be
1920x1088, and minimum 8x4 however the real limits are 48x48 and 3840x2160
for decoder and 96x96 and 1920x1088 for encoder. This patch modifies the
driver to use correct limits and also fixes incorrect log message.

BUG=chrome-os-partner:38232,chromium:464920
TEST=Screen sharing of a window bigger than 1920x1088 to Jerry

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/261851
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I0c51e5a9ad235716ee447e052455b97ed0c295de
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Fix hangout corruption
ZhiChao Yu [Fri, 23 Jan 2015 02:25:20 +0000 (10:25 +0800)]
CHROMIUM: [media] rk3288-vpu: Fix hangout corruption

If segmentation_enable flag is zero, no matter what
segmentation_update_flag is, we cannot set it to HW.
Before this patch, incorrect segmentation_update_flag
might be set to HW which caused hangout corruption.

BUG=chrome-os-partner:35531
TEST=make a video chat by hangout with other device.

Signed-off-by: ZhiChao Yu <zhichao.yu@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/242732
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Change-Id: I86c00c27d3c97854db8c4164289fa434b29819ff
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Fix VP8 decode corruption
ZhiChao Yu [Wed, 21 Jan 2015 03:39:12 +0000 (11:39 +0800)]
CHROMIUM: [media] rk3288-vpu: Fix VP8 decode corruption

The QP value wasn't correctly clamped by calling function clamp()
with wrong order of arguments. Fix this by passing the arguments
correctly.

BUG=chrome-os-partner:35606
TEST=Open Chrome and navigate to:
http://video.webmfiles.org/elephants-dream.webm

Signed-off-by: ZhiChao Yu <zhichao.yu@rock-chips.com>
[tfiga: Moved back to clamp(), but fixed argument order.]
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/242171
Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I415e19e6cdfb125b281d205bcdf93ae9911655f4
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Bump ACLK frequency to 400 MHz
Tomasz Figa [Wed, 14 Jan 2015 07:20:41 +0000 (16:20 +0900)]
CHROMIUM: [media] rk3288-vpu: Bump ACLK frequency to 400 MHz

According to RK3288 TRM, the maximum worst case operating frequency of
VPU is 400 MHz, but by default it is set to 200 MHz. To fix (or work
around) performance issues with VP8 encoder, this patch bumps the
frequency to maximum possible value.

BUG=chrome-os-partner:35405
TEST=./video_encode_accelerator_unittest
--test_stream_data=tulip2-1280x720-1b95123232922fe0067869c74e19cd09.yuv:1280:720:11:out1280x720.ivf:1200000
--v

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/240644
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I397139fe1195b74b8ebd516eae0968bccff7ef4b
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288_vpu: implement vp8d hw config part
ZhiChao Yu [Mon, 5 Jan 2015 06:05:07 +0000 (14:05 +0800)]
CHROMIUM: [media] rk3288_vpu: implement vp8d hw config part

This patch adds code implementing rk3288_vpu_codec_ops
for VP8 decoder.

BUG=chrome-os-partner:33728
TEST=video_encode_accelerator_unittest;video_decode_accelerator_unittest

Signed-off-by: ZhiChao Yu <zhichao.yu@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/238311
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I7875c3c6e53ed00ea74035778651b6b676298ee8
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Add VP8 decoder to V4L2 API implementation
Tomasz Figa [Fri, 9 Jan 2015 11:35:16 +0000 (20:35 +0900)]
CHROMIUM: [media] rk3288-vpu: Add VP8 decoder to V4L2 API implementation

This patch extends existing implementation of required V4L2 API calls
with code required for VP8 decoder.

BUG=chrome-os-partner:33728
TEST=video_encode_accelerator_unittest;video_decode_accelerator_unittest

Signed-off-by: ZhiChao Yu <zhichao.yu@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/239814
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I633687b7223c25f46d2373b964ceb1fe29f02b2f
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288_vpu: implement h264d hardware config part
Hertz Wong [Mon, 15 Dec 2014 04:16:14 +0000 (12:16 +0800)]
CHROMIUM: [media] rk3288_vpu: implement h264d hardware config part

This patch adds code implementing rk3288_vpu_codec_ops for H264 decoder.

BUG=chrome-os-partner:33728
TEST=compile

Signed-off-by: Hertz Wong <hertz.wong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237618
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I17e9828008946d370f6fb7b52ce02b412e73c6e9
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] rk3288-vpu: Implement basic V4L2 APIs for decoder
Tomasz Figa [Mon, 1 Dec 2014 10:42:38 +0000 (19:42 +0900)]
CHROMIUM: [media] rk3288-vpu: Implement basic V4L2 APIs for decoder

This patch adds implementation of basic V4L2 APIs for decoder part of
the driver. It is still missing the hardware specific part, including
the hardware specific controls containing certain data precalculated
in userspace.

BUG=chrome-os-partner:33728
TEST=compile

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237617
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I3cad74aad3c6c4ac5e6b2123b5d93e3173b74c7a
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] Add rk3288-vpu driver (vp8-encoder only)
Alpha Lin [Fri, 14 Nov 2014 03:41:10 +0000 (12:41 +0900)]
CHROMIUM: [media] Add rk3288-vpu driver (vp8-encoder only)

Currently it consists of implementations of a platform driver and a V4L2
mem-to-mem encoder device. Only VP8 encoding is implemented currently.

BUG=chrome-os-partner:33728
TEST=video_encode_acceleator_unittest

Signed-off-by: Alpha Lin <Alpha.Lin@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237614
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Conflicts:
drivers/media/platform/Makefile

Change-Id: I6e2c44ff378c68af4f1db071c7909a0870d9171a
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] v4l2-ioctl: add vp8 frame & h264 slice to VIDIOC_ENUM_FMT
Jeffy Chen [Tue, 31 May 2016 10:33:26 +0000 (18:33 +0800)]
CHROMIUM: [media] v4l2-ioctl: add vp8 frame & h264 slice to VIDIOC_ENUM_FMT

Change-Id: Idcfa80d3c838e3b2da1107800b178dc6e8d82dc1
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] videobuf2-dc: Let drivers specify DMA attrs
Tomasz Figa [Mon, 13 Apr 2015 05:34:06 +0000 (14:34 +0900)]
CHROMIUM: [media] videobuf2-dc: Let drivers specify DMA attrs

DMA allocations might be subject to certain reqiurements specific to the
hardware using the buffers, such as availability of kernel mapping (for
contents fix-ups in the driver). The only entity that knows them is the
driver, so it must share this knowledge with vb2-dc.

This patch extends the alloc_ctx initialization interface to let the
driver specify DMA attrs, which are then stored inside the allocation
context and will be used for all allocations with that context.

As a side effect, all dma_*_coherent() calls are turned into
dma_*_attrs() calls, because the attributes need to be carried over
through all DMA operations.

BUG=chrome-os-partner:38873
TEST=compile

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/265363
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I0e6c040cf820c194b6ca6f3e6355217496bd1532
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: v4l: Add VP8 low-level decoder API controls.
Pawel Osciak [Fri, 26 Dec 2014 01:37:33 +0000 (10:37 +0900)]
CHROMIUM: v4l: Add VP8 low-level decoder API controls.

These controls are to be used with the new low-level decoder API for VP8
to provide additional parameters for the hardware that cannot parse the
input stream.

BUG=chrome-os-partner:33728
TEST=compile

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237670
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Change-Id: I32b45e07cfe02b25ea5202d0c839699103e3b800
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: v4l: Add H264 low-level decoder API compound controls.
Pawel Osciak [Sat, 13 Sep 2014 06:04:47 +0000 (15:04 +0900)]
CHROMIUM: v4l: Add H264 low-level decoder API compound controls.

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237616
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
[rebase44(groeck): include linux/types.h in v4l2-controls.h]
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Change-Id: Iee08205ff3b9a54c6561e385acae8182acc73393
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: [media] v4l: Add private compound control type.
Pawel Osciak [Tue, 11 Nov 2014 11:44:28 +0000 (20:44 +0900)]
CHROMIUM: [media] v4l: Add private compound control type.

V4L2_CTRL_TYPE_PRIVATE is to be used for private driver compound
controls that use the "ptr" member of struct v4l2_ext_control.

BUG=chrome-os-partner:33728
TEST=build

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/228988
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Change-Id: I44083b0216ef32629d12f0910e972a3e827a599a
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: v4l2-ctrls: add function to apply a configuration store.
Hans Verkuil [Fri, 12 Sep 2014 09:52:26 +0000 (11:52 +0200)]
CHROMIUM: v4l2-ctrls: add function to apply a configuration store.

Drivers need to be able to select a specific store. Add a new function that can
be used to apply a given store.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
BUG=chrome-os-partner:33728
TEST=build

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232585
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Change-Id: I3b80a31681765836a134812ebc56686324ca5194
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: Add config store support
Hans Verkuil [Fri, 12 Sep 2014 09:51:38 +0000 (11:51 +0200)]
CHROMIUM: Add config store support

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
BUG=chrome-os-partner:33728
TEST=build

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232584
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Conflicts:
drivers/media/v4l2-core/v4l2-ctrls.c
include/media/v4l2-ctrls.h

[rebase44(groeck): Resolved conflicts]
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Conflicts:
drivers/media/v4l2-core/v4l2-ctrls.c

Change-Id: I0b2e66f3331cab91d209868f5d5f67f795a0e72c
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: videodev2.h: rename reserved2 to config_store in v4l2_buffer.
Pawel Osciak [Sat, 13 Sep 2014 02:45:49 +0000 (11:45 +0900)]
CHROMIUM: videodev2.h: rename reserved2 to config_store in v4l2_buffer.

When queuing buffers allow for passing the configuration store ID that
should be associated with this buffer. Use the 'reserved2' field for this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
BUG=chrome-os-partner:33728
TEST=build

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232583
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Conflicts:
drivers/media/v4l2-core/videobuf2-core.c

[rebase44(groeck): fixed conflicts; structural changes to match v4.4]
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Conflicts:
drivers/media/v4l2-core/v4l2-compat-ioctl32.c

Change-Id: Ibb823e9369bec79645e09651b0dda006ed53ecc5
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: videodev2.h: add config_store to v4l2_ext_controls
Hans Verkuil [Mon, 16 Dec 2013 15:45:24 +0000 (16:45 +0100)]
CHROMIUM: videodev2.h: add config_store to v4l2_ext_controls

The ctrl_class is fairly pointless when used with drivers that use the control
framework: you can just fill in 0 and it will just work fine. There are still
some old unconverted drivers that do not support 0 and instead want the control
class there. The idea being that all controls in the list all belong to that
class. This was done to simplify drivers in the absence of the control framework.

When using the control framework the framework itself is smart enough to allow
controls of any class to be included in the control list.

Since configuration store IDs are in the range 1..255 (or so, in any case a relatively
small non-zero positive integer) it makes sense to effectively rename ctrl_class
to config_store. Set it to 0 and you get the normal behavior (you change the current
control value), set it to a configuration store ID and you get/set the control for
that store.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
BUG=chrome-os-partner:33728
TEST=build

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232582
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Conflicts:
include/uapi/linux/videodev2.h

Change-Id: I862bb5796e27bcbbd055e22202ac9a1ed0cc6f7d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoCHROMIUM: ARM: dts: rockchip: assigned parents for vop dclks
Daniel Kurtz [Thu, 29 Jan 2015 16:58:35 +0000 (00:58 +0800)]
CHROMIUM: ARM: dts: rockchip: assigned parents for vop dclks

The VOP DCLK is used to generate panel clocks.

For veyron, we have decided to permanently assign vop0 for
use with HDMI and vop1 for use with eDP.

Furthermore, to allow us to generate a wide range of precise pixel clocks,
we will be dedicating the NPLL exclusively for use as the parent clock
for VOP0/HDMI.

To implement the exclusive assignment of NPLL in the kernel, we remove
the NPLL entry from all clock muxes that would otherwise be able to select
it (such as vop1).  For vop0, we remove all choices *except* NPLL.

Before booting the kernel, the bios will configure vop0 and vop1 as it
sees fit - potentially assigning NPLL to vop1 and some other PLL to vop0.

Thus, at boot it is possible that from the kernel's perspective, these
clocks are orphans.  To fix this, we explicitly assign their clock parents
to ensure that they are properly parented no matter what state they are
when the kernel boots.

Change-Id: Iafe301abcbf211246fda66519cea5fc946af97ee
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
8 years agoCHROMIUM: videodev2.h: add V4L2_CTRL_FLAG_CAN_STORE
Hans Verkuil [Mon, 25 Aug 2014 12:03:36 +0000 (14:03 +0200)]
CHROMIUM: videodev2.h: add V4L2_CTRL_FLAG_CAN_STORE

Controls that have a configuration store will set this flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
BUG=chrome-os-partner:33728
TEST=build

Signed-off-by: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232581
Trybot-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Conflicts:
include/uapi/linux/videodev2.h

[rebase44(groeck): Resolved conflicts]
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Change-Id: I88ccf65a5c6f11381cfacb4c328b589194f249ec
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoFROMLIST: ARM: dts: rockchip: add the panel power supply for rk3288-evb board with...
Yakir Yang [Tue, 28 Jun 2016 04:51:24 +0000 (12:51 +0800)]
FROMLIST: ARM: dts: rockchip: add the panel power supply for rk3288-evb board with rk808 pmu

Panel regulator is controller by a normal GPIO, so we need to
write a regulator-fixed node for it.

Change-Id: I24a0f2787ef3bb93422296e8a97c076040460ccc
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9201801/)

8 years agoFROMLIST: ARM: dts: rockchip: add the panel power supply for rk3288-evb board with...
Yakir Yang [Tue, 28 Jun 2016 04:51:21 +0000 (12:51 +0800)]
FROMLIST: ARM: dts: rockchip: add the panel power supply for rk3288-evb board with act8846 pmu

Panel regulator is controller by a normal GPIO, so we need to
write a regulator-fixed node for it.

Change-Id: I4368b16bf49ef04a539aad154f7c16b094bfc382
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9201803/)

8 years agoFROMLIST: ARM: dts: rockchip: add eDP/panel display device nodes for rk3288-evb
Yakir Yang [Tue, 28 Jun 2016 04:51:18 +0000 (12:51 +0800)]
FROMLIST: ARM: dts: rockchip: add eDP/panel display device nodes for rk3288-evb

The default eDP panel on RK3288 EVB board is LG LP079QX1-SP0V TFT LCD,
we haven't declared the panel regulator in the 'panel-simple' device
node here, so the specific board like ACT8846 / RK8080 need to support
the panel power supply.

Change-Id: Ibf4a6457d606027eaa91cacf6fde2241376afd13
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9201815/)

8 years agodt-bindings: Add support for AUO B101EW05 1280x800 panel
Yakir Yang [Tue, 28 Jun 2016 10:12:24 +0000 (18:12 +0800)]
dt-bindings: Add support for AUO B101EW05 1280x800 panel

The AUO B101EW05 panel is a 10.1" 1280(RGB)x800 WXGA TFT-LCD panel,
connected using LVDS interfaces.

Change-Id: Ic80369353f5e1726d2ea2ace6d53bb2bcdae6fc2
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agodrm/panel: simple: Add support for AUO B101EW05 1280x800 panel
Yakir Yang [Tue, 28 Jun 2016 10:07:39 +0000 (18:07 +0800)]
drm/panel: simple: Add support for AUO B101EW05 1280x800 panel

The AUO B101EW05 panel is a 10.1" 1280(RGB)x800 WXGA TFT-LCD panel,
connected using LVDS interfaces

Change-Id: Ic67fe5793a975b585cecfb8da02e81cd9fa6346f
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agodt-bindings: add support Chunghwa CLAA070WP03 800x1280 panel
Yakir Yang [Tue, 28 Jun 2016 06:40:02 +0000 (14:40 +0800)]
dt-bindings: add support Chunghwa CLAA070WP03 800x1280 panel

Chunghwa CLAA070WP03 is 7” color TFT-LCD module composed of LCD
panel, LVDS driver ICs, control circuit and backlight. This module
supports 800x1280 mode.

Change-Id: I7f71464a80725d648802918740e64a0368f5c480
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agodrm/panel: simple: add support Chunghwa CLAA070WP03 800x1280 panel
Yakir Yang [Wed, 27 Jan 2016 08:48:44 +0000 (16:48 +0800)]
drm/panel: simple: add support Chunghwa CLAA070WP03 800x1280 panel

Chunghwa CLAA070WP03 is 7” color TFT-LCD module composed of LCD panel,
LVDS driver ICs, control circuit and backlight. This module supports
800x1280 mode.

Change-Id: I6a6339ad25664e2e47fc0e0de5c079db3494bd25
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoARM: dts: rockchip: enable GPU support on RK3288 EVB board with act8846 pmu
Yakir Yang [Fri, 24 Jun 2016 08:38:46 +0000 (16:38 +0800)]
ARM: dts: rockchip: enable GPU support on RK3288 EVB board with act8846 pmu

Change-Id: I92e43f6dd5563a9b8f423cf03f17dad60b4497ab
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoARM: dts: rockchip: add GPU device node for RK3288
Yakir Yang [Fri, 24 Jun 2016 08:35:59 +0000 (16:35 +0800)]
ARM: dts: rockchip: add GPU device node for RK3288

RK3288 have integrated the Mali-T760

Change-Id: Id5f98f8c236049c7936c44290e93dfef9dee0c3b
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add 2 regulators for rk3288-evb-act8846
Chris Zhong [Thu, 10 Dec 2015 05:46:38 +0000 (13:46 +0800)]
UPSTREAM: ARM: dts: rockchip: add 2 regulators for rk3288-evb-act8846

vcc_wl and vcc_lcd are 2 gpio switches for rk3288-evb-act8846 board.

Change-Id: I49fc20665adf4176d672fdd3e4030ee472f558a8
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(cherry pick from commit 662513a14c9dd1ba2b4d5928d6eae443744edefc)

8 years agovideo: rockchip: vop: 3399: fix layer0 perpixel alpha error
Huang Jiachai [Wed, 29 Jun 2016 12:40:13 +0000 (20:40 +0800)]
video: rockchip: vop: 3399: fix layer0 perpixel alpha error

Change-Id: I5d4947ab131d39ebc611ba78100e05aa95c4b3e9
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
8 years agoARM64: kernel: dump kernel addresses larger than VA_START
Huibin Hong [Wed, 29 Jun 2016 11:58:26 +0000 (19:58 +0800)]
ARM64: kernel: dump kernel addresses larger than VA_START

The arm64 virtual addresses of kernel are like:
VA_START < MODULES_VADDR < KIMAGE_VADDR < PAGE_OFFSET.
PAGE_OFFSET is the virtual address of the start of the linear map.
And the vmalloc, kernel code and so on are between VA_START and
PAGE_OFFSET, so it is necessary to expand dump addresses to VA_START,
instead of PAGE_OFFSET.

Change-Id: I810ed216862de4c6e68b92d483de4aa68da532b8
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
8 years agoARM: dts: rockchip: add the supports-emmc for rk3288 emmc property
Yakir Yang [Fri, 24 Jun 2016 06:18:27 +0000 (14:18 +0800)]
ARM: dts: rockchip: add the supports-emmc for rk3288 emmc property

I don't need send for upstream since the rockchip inside kernel
need it for tuning. At least the upstream can work it with dwmmc.

Change-Id: I73c12b455c7dc5320d6c06f9e29ddec5c4a6def5
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add GMAC nodes for RK322x SoCs
Xing Zheng [Wed, 22 Jun 2016 03:16:52 +0000 (11:16 +0800)]
UPSTREAM: ARM: dts: rockchip: add GMAC nodes for RK322x SoCs

This patch add the GMAC dt nodes for rk322x SoCs.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit 5d3d7c72b920f9aa44f9b64cdd8a1c5bf5cbea07)

Change-Id: I85467b7253fda16c242d91bcdd207d0175ee0db3
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add i2s nodes for RK322x SoCs
Xing Zheng [Wed, 22 Jun 2016 03:16:51 +0000 (11:16 +0800)]
UPSTREAM: ARM: dts: rockchip: add i2s nodes for RK322x SoCs

This patch add the i2s dt nodes for rk322x SoCs.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit ccada2489206b5f1870ac132408bf41ffe51995a)

Change-Id: I51607de71835be896b2134516c159f9d6831ae3e
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: rename rk3228.dtsi to rk322x.dtsi
Xing Zheng [Wed, 22 Jun 2016 03:16:50 +0000 (11:16 +0800)]
UPSTREAM: ARM: dts: rockchip: rename rk3228.dtsi to rk322x.dtsi

We have the brother chipset that RK3228 and RK3229, they share most
of dts configuration, but there are a number of different features.
In order to develop the future when they are easy to distinguish,
we need them to be independent.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit 8372d93df7c265a67676dcd329da9588cc769192)

Change-Id: I0b3c91cddb3ca919b165ba1ec5b2b9466945546d
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add i2c nodes for RK3228 SoCs
Yakir Yang [Mon, 14 Mar 2016 03:11:42 +0000 (11:11 +0800)]
UPSTREAM: ARM: dts: rockchip: add i2c nodes for RK3228 SoCs

This patch add the i2c dt nodes for rk3228 SoCs.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit d549df4b225ad2386cbf59254eab2ec116babdca)

Change-Id: I8f607b3af6b07bec509bb3645af6bf3ad59af3f5
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: remove broken-cd from emmc and sdio
Shawn Lin [Tue, 26 Jan 2016 02:06:43 +0000 (10:06 +0800)]
UPSTREAM: ARM: dts: rockchip: remove broken-cd from emmc and sdio

Only one of "broken-cd" and "non-removable" should be supplied
according to Documentation/devicetree/bindings/mmc/mmc.txt.
Obviously emmc and sdio-wifi are non-removable devices, while
broken-cd is for removable device whose card detect pin is broken.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit 57375d88fa3f6bf9351051529464c708f72adb1d)

Change-Id: Ie8df62156fbc96c0c9e16d05389b2f230b261f0e
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: enable the tsadc for rk3228 evb
Caesar Wang [Mon, 15 Feb 2016 07:33:33 +0000 (15:33 +0800)]
UPSTREAM: ARM: dts: rockchip: enable the tsadc for rk3228 evb

This patch enables the tsadc for rk3228 evb board.

The rk3228 evb board uses the CRU to reset the chip since it hasn't the
PMIC to connect it, and TSHUT is low active on evb board.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit 26f5e19dfb07de627112074721f254482f941dab)

Change-Id: I12ce9b1e2fb2c740bef100a22d746d5e128253e6
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add the thermal main info found on rk3228
Caesar Wang [Mon, 15 Feb 2016 07:33:32 +0000 (15:33 +0800)]
UPSTREAM: ARM: dts: rockchip: add the thermal main info found on rk3228

This patch adds the thermal needed main information for rk3228 SoCS.

Basically has the following content:

1) TSADC controller:
Add the needed attributes for rk3036 TSADC controller.

Especially for the TSHUT, in some cases if we are unable to shut it down
in orderly fashion (says: kernel is stuck holding a lock or similar), then
hardware TSHUT will reset it.
If the temperature is over 95C over a period of time the thermal shutdown
of the tsadc is invoked with can either reset the entire chip via the CRU,
or notify the PMIC via a GPIO. This should be set in the specific board.

2) Thermal zones:
Add the needed device mode for thermal generic framework.
Detail in Documentation/devicetree/bindings/thermal/thermal.txt.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit 7796031eec9e41099af35bc531f04843358fa3f1)

Change-Id: I415d5ac7ba2bca2259821dae6af98970e039d455
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add rk3228-evb board
Jeffy Chen [Fri, 11 Dec 2015 01:30:52 +0000 (09:30 +0800)]
UPSTREAM: ARM: dts: rockchip: add rk3228-evb board

Initial release for rk3228 sdk board.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/dts32 commit 67e044a510d0e00656ae2ab4f0ee30971a2f40e7)

Conflicts:

Documentation/devicetree/bindings/arm/rockchip.txt
[zx: conflict with rk339 description, place over it.]

Change-Id: I10d4e71abb424f8997145cd51fa30257c8401cfb
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoUPSTREAM: ARM: dts: rockchip: add core rk3228 dtsi
Jeffy Chen [Fri, 11 Dec 2015 01:30:51 +0000 (09:30 +0800)]
UPSTREAM: ARM: dts: rockchip: add core rk3228 dtsi

Initial release for rk3228 shared dtsi.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from
git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-armsoc/v4.8-armsoc/dts32 commit 9848ebeb952d2a46852bdde96101d280fc69b54b)

Change-Id: I98ae8a73a5a46c2d2e82ae590d24f932c5426ddb
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoARM: dts: rockchip: remove unused rk3228 dts files
Xing Zheng [Wed, 29 Jun 2016 02:36:08 +0000 (10:36 +0800)]
ARM: dts: rockchip: remove unused rk3228 dts files

There are old v3.10 dts and unsuitable for v4.4, we need to remove them.

Change-Id: I070fb1fd5d513883f43dfbdab6f173e68fe48e72
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoARM: rockchip: rk3288: Switch to use the proper PWM IP
Douglas Anderson [Mon, 18 Aug 2014 17:29:39 +0000 (10:29 -0700)]
ARM: rockchip: rk3288: Switch to use the proper PWM IP

The rk3288 SoC has an option to switch all of the PWMs in the system
between the old IP block and the new IP block.  The new IP block is
working and tested and the suggested PWM to use, so setup the SoC to
use it and then we can pretend that the other IP block doesn't exist.

This code could go lots of other places, but we've put it here.  Why?
- Pushing it to the bootloader just makes the code harder to update in
  the field.  If we later find a bug in the new IP block and want to
  change our mind about what to use we want it to be easy to update.
- Putting this code in the driver for IP block is a lot of extra work,
  device tree bindings, etc.  Now that the new IP block is validated
  it's likely no future SoCs will need this code.  Why pollute the PWM
  driver with this?  This is an rk3288 thing so it should be in rk3288
  code.
- There's a single bit that switches over PWMs, which makes it extra
  hard to put this under the PWM device tree nodes.

Change-Id: Ib178129fc4f24f71d3a6f7315f757f91b5bdf534
Signed-off-by: Doug Anderson <dianders@chromium.org>
8 years agoARM64: dts: rk3366-tb: change usb2-host vbus supply as a regulator
Frank Wang [Fri, 24 Jun 2016 03:16:26 +0000 (11:16 +0800)]
ARM64: dts: rk3366-tb: change usb2-host vbus supply as a regulator

Change-Id: I16cef5cc1b925ac26e92301ec84172213e4eb93f
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
8 years agoARM64: dts: rk3366: add usb2-vbus gpio into pinctrl entry
Frank Wang [Fri, 24 Jun 2016 03:13:07 +0000 (11:13 +0800)]
ARM64: dts: rk3366: add usb2-vbus gpio into pinctrl entry

Change-Id: I3379360efc32ba455f1934760af8b968c8748984
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>