* [PATCH v4 34/36] thunderbolt: Make rest of the logging to happen at debug level
From: Mika Westerberg @ 2019-04-10 13:36 UTC (permalink / raw)
To: linux-kernel
Cc: Michael Jamet, Yehezkel Bernat, Andreas Noever, Lukas Wunner,
David S . Miller, Andy Shevchenko, Christian Kellner,
Mario.Limonciello, Joe Perches, Mika Westerberg, netdev
In-Reply-To: <20190410133653.88061-1-mika.westerberg@linux.intel.com>
Now that the driver can handle every possible tunnel types there is no
point to log everything as info level so turn these to happen at debug
level instead.
While at it remove duplicated tunnel activation log message
(tb_tunnel_activate() calls tb_tunnel_restart() which print the same
message) and add one missing '\n' termination.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/ctl.c | 2 +-
drivers/thunderbolt/icm.c | 2 +-
drivers/thunderbolt/path.c | 6 +++---
drivers/thunderbolt/switch.c | 19 +++++++++----------
drivers/thunderbolt/tb.c | 11 +++++------
drivers/thunderbolt/tunnel.c | 6 ++----
6 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 73b386de4d15..2427d73be731 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -720,7 +720,7 @@ int tb_cfg_error(struct tb_ctl *ctl, u64 route, u32 port,
.port = port,
.error = error,
};
- tb_ctl_info(ctl, "resetting error on %llx:%x.\n", route, port);
+ tb_ctl_dbg(ctl, "resetting error on %llx:%x.\n", route, port);
return tb_ctl_tx(ctl, &pkg, sizeof(pkg), TB_CFG_PKG_ERROR);
}
diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index d1f6ec89763c..597507bbd8ed 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -1568,7 +1568,7 @@ static int icm_firmware_start(struct tb *tb, struct tb_nhi *nhi)
if (val & REG_FW_STS_ICM_EN)
return 0;
- dev_info(&nhi->pdev->dev, "starting ICM firmware\n");
+ dev_dbg(&nhi->pdev->dev, "starting ICM firmware\n");
ret = icm_firmware_reset(tb, nhi);
if (ret)
diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt/path.c
index e4c22f53ef4d..273e0cae9a98 100644
--- a/drivers/thunderbolt/path.c
+++ b/drivers/thunderbolt/path.c
@@ -500,8 +500,8 @@ int tb_path_activate(struct tb_path *path)
& out_mask;
hop.unknown3 = 0;
- tb_port_info(path->hops[i].in_port, "Writing hop %d, index %d",
- i, path->hops[i].in_hop_index);
+ tb_port_dbg(path->hops[i].in_port, "Writing hop %d, index %d\n",
+ i, path->hops[i].in_hop_index);
tb_dump_hop(path->hops[i].in_port, &hop);
res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS,
2 * path->hops[i].in_hop_index, 2);
@@ -512,7 +512,7 @@ int tb_path_activate(struct tb_path *path)
}
}
path->activated = true;
- tb_info(path->tb, "path activation complete\n");
+ tb_dbg(path->tb, "path activation complete\n");
return 0;
err:
tb_WARN(path->tb, "path activation failed\n");
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index a5345a6225bd..c1b016574fb4 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -493,23 +493,22 @@ int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged)
if (state < 0)
return state;
if (state == TB_PORT_DISABLED) {
- tb_port_info(port, "is disabled (state: 0)\n");
+ tb_port_dbg(port, "is disabled (state: 0)\n");
return 0;
}
if (state == TB_PORT_UNPLUGGED) {
if (wait_if_unplugged) {
/* used during resume */
- tb_port_info(port,
- "is unplugged (state: 7), retrying...\n");
+ tb_port_dbg(port,
+ "is unplugged (state: 7), retrying...\n");
msleep(100);
continue;
}
- tb_port_info(port, "is unplugged (state: 7)\n");
+ tb_port_dbg(port, "is unplugged (state: 7)\n");
return 0;
}
if (state == TB_PORT_UP) {
- tb_port_info(port,
- "is connected, link is up (state: 2)\n");
+ tb_port_dbg(port, "is connected, link is up (state: 2)\n");
return 1;
}
@@ -517,9 +516,9 @@ int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged)
* After plug-in the state is TB_PORT_CONNECTING. Give it some
* time.
*/
- tb_port_info(port,
- "is connected, link is not up (state: %d), retrying...\n",
- state);
+ tb_port_dbg(port,
+ "is connected, link is not up (state: %d), retrying...\n",
+ state);
msleep(100);
}
tb_port_warn(port,
@@ -585,7 +584,7 @@ int tb_port_set_initial_credits(struct tb_port *port, u32 credits)
int tb_port_clear_counter(struct tb_port *port, int counter)
{
u32 zero[3] = { 0, 0, 0 };
- tb_port_info(port, "clearing counter %d\n", counter);
+ tb_port_dbg(port, "clearing counter %d\n", counter);
return tb_port_write(port, zero, TB_CFG_COUNTERS, 3 * counter, 3);
}
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index e39fc1e35e6b..1f7a9e1cc09c 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -556,18 +556,17 @@ static void tb_handle_hotplug(struct work_struct *work)
} else if (tb_port_is_dpout(port)) {
tb_teardown_dp(tb, port);
} else {
- tb_port_info(port,
- "got unplug event for disconnected port, ignoring\n");
+ tb_port_dbg(port,
+ "got unplug event for disconnected port, ignoring\n");
}
} else if (port->remote) {
- tb_port_info(port,
- "got plug event for connected port, ignoring\n");
+ tb_port_dbg(port, "got plug event for connected port, ignoring\n");
} else {
if (tb_port_is_null(port)) {
- tb_port_info(port, "hotplug: scanning\n");
+ tb_port_dbg(port, "hotplug: scanning\n");
tb_scan_port(port);
if (!port->remote)
- tb_port_info(port, "hotplug: no switch found\n");
+ tb_port_dbg(port, "hotplug: no switch found\n");
} else if (tb_port_is_dpout(port)) {
tb_tunnel_dp(tb, port);
}
diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
index 9f9b26b12d0a..31d0234837e4 100644
--- a/drivers/thunderbolt/tunnel.c
+++ b/drivers/thunderbolt/tunnel.c
@@ -611,7 +611,7 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel)
{
int res, i;
- tb_tunnel_info(tunnel, "activating\n");
+ tb_tunnel_dbg(tunnel, "activating\n");
/*
* Make sure all paths are properly disabled before enabling
@@ -660,8 +660,6 @@ int tb_tunnel_activate(struct tb_tunnel *tunnel)
{
int i;
- tb_tunnel_info(tunnel, "activating\n");
-
for (i = 0; i < tunnel->npaths; i++) {
if (tunnel->paths[i]->activated) {
tb_tunnel_WARN(tunnel,
@@ -681,7 +679,7 @@ void tb_tunnel_deactivate(struct tb_tunnel *tunnel)
{
int i;
- tb_tunnel_info(tunnel, "deactivating\n");
+ tb_tunnel_dbg(tunnel, "deactivating\n");
if (tunnel->activate)
tunnel->activate(tunnel, false);
--
2.20.1
^ permalink raw reply related
* [PATCH v4 16/36] thunderbolt: Add functions for allocating and releasing HopIDs
From: Mika Westerberg @ 2019-04-10 13:36 UTC (permalink / raw)
To: linux-kernel
Cc: Michael Jamet, Yehezkel Bernat, Andreas Noever, Lukas Wunner,
David S . Miller, Andy Shevchenko, Christian Kellner,
Mario.Limonciello, Joe Perches, Mika Westerberg, netdev
In-Reply-To: <20190410133653.88061-1-mika.westerberg@linux.intel.com>
Each port has a separate path configuration space that is used for
finding the next hop (switch) in the path. HopID is an index to this
configuration space. HopIDs 0 - 7 are reserved by the protocol.
In order to get next available HopID for each direction we provide two
pairs of helper functions that can be used to allocate and release
HopIDs for a given port.
While there remove obsolete TODO comment.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/nhi.c | 3 +-
drivers/thunderbolt/switch.c | 87 +++++++++++++++++++++++++++++++++++-
drivers/thunderbolt/tb.h | 11 +++++
3 files changed, 98 insertions(+), 3 deletions(-)
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 9aa44f9762a3..cac1ead5e302 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -27,8 +27,7 @@
* use this ring for anything else.
*/
#define RING_E2E_UNUSED_HOPID 2
-/* HopIDs 0-7 are reserved by the Thunderbolt protocol */
-#define RING_FIRST_USABLE_HOPID 8
+#define RING_FIRST_USABLE_HOPID TB_PATH_MIN_HOPID
/*
* Minimal number of vectors when we use MSI-X. Two for control channel
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index b132439618da..30f3d6a9fe90 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -594,11 +594,88 @@ static int tb_init_port(struct tb_port *port)
tb_dump_port(port->sw->tb, &port->config);
- /* TODO: Read dual link port, DP port and more from EEPROM. */
+ /* Control port does not need HopID allocation */
+ if (port->port) {
+ ida_init(&port->in_hopids);
+ ida_init(&port->out_hopids);
+ }
+
return 0;
}
+static int tb_port_alloc_hopid(struct tb_port *port, bool in, int min_hopid,
+ int max_hopid)
+{
+ int port_max_hopid;
+ struct ida *ida;
+
+ if (in) {
+ port_max_hopid = port->config.max_in_hop_id;
+ ida = &port->in_hopids;
+ } else {
+ port_max_hopid = port->config.max_out_hop_id;
+ ida = &port->out_hopids;
+ }
+
+ /* HopIDs 0-7 are reserved */
+ if (min_hopid < TB_PATH_MIN_HOPID)
+ min_hopid = TB_PATH_MIN_HOPID;
+
+ if (max_hopid < 0 || max_hopid > port_max_hopid)
+ max_hopid = port_max_hopid;
+
+ return ida_simple_get(ida, min_hopid, max_hopid + 1, GFP_KERNEL);
+}
+
+/**
+ * tb_port_alloc_in_hopid() - Allocate input HopID from port
+ * @port: Port to allocate HopID for
+ * @min_hopid: Minimum acceptable input HopID
+ * @max_hopid: Maximum acceptable input HopID
+ *
+ * Return: HopID between @min_hopid and @max_hopid or negative errno in
+ * case of error.
+ */
+int tb_port_alloc_in_hopid(struct tb_port *port, int min_hopid, int max_hopid)
+{
+ return tb_port_alloc_hopid(port, true, min_hopid, max_hopid);
+}
+
+/**
+ * tb_port_alloc_out_hopid() - Allocate output HopID from port
+ * @port: Port to allocate HopID for
+ * @min_hopid: Minimum acceptable output HopID
+ * @max_hopid: Maximum acceptable output HopID
+ *
+ * Return: HopID between @min_hopid and @max_hopid or negative errno in
+ * case of error.
+ */
+int tb_port_alloc_out_hopid(struct tb_port *port, int min_hopid, int max_hopid)
+{
+ return tb_port_alloc_hopid(port, false, min_hopid, max_hopid);
+}
+
+/**
+ * tb_port_release_in_hopid() - Release allocated input HopID from port
+ * @port: Port whose HopID to release
+ * @hopid: HopID to release
+ */
+void tb_port_release_in_hopid(struct tb_port *port, int hopid)
+{
+ ida_simple_remove(&port->in_hopids, hopid);
+}
+
+/**
+ * tb_port_release_out_hopid() - Release allocated output HopID from port
+ * @port: Port whose HopID to release
+ * @hopid: HopID to release
+ */
+void tb_port_release_out_hopid(struct tb_port *port, int hopid)
+{
+ ida_simple_remove(&port->out_hopids, hopid);
+}
+
/**
* tb_pci_port_enable() - Enable PCIe adapter port
* @port: PCIe port to enable
@@ -1055,9 +1132,17 @@ static const struct attribute_group *switch_groups[] = {
static void tb_switch_release(struct device *dev)
{
struct tb_switch *sw = tb_to_switch(dev);
+ int i;
dma_port_free(sw->dma_port);
+ for (i = 1; i <= sw->config.max_port_number; i++) {
+ if (!sw->ports[i].disabled) {
+ ida_destroy(&sw->ports[i].in_hopids);
+ ida_destroy(&sw->ports[i].out_hopids);
+ }
+ }
+
kfree(sw->uuid);
kfree(sw->device_name);
kfree(sw->vendor_name);
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index d1f8e9722f33..1cb5009195f9 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -127,6 +127,8 @@ struct tb_switch {
* @dual_link_port: If the switch is connected using two ports, points
* to the other port.
* @link_nr: Is this primary or secondary port on the dual_link.
+ * @in_hopids: Currently allocated input HopIDs
+ * @out_hopids: Currently allocated output HopIDs
*/
struct tb_port {
struct tb_regs_port_header config;
@@ -139,6 +141,8 @@ struct tb_port {
bool disabled;
struct tb_port *dual_link_port;
u8 link_nr:1;
+ struct ida in_hopids;
+ struct ida out_hopids;
};
/**
@@ -194,6 +198,9 @@ struct tb_path {
int path_length; /* number of hops */
};
+/* HopIDs 0-7 are reserved by the Thunderbolt protocol */
+#define TB_PATH_MIN_HOPID 8
+
/**
* struct tb_cm_ops - Connection manager specific operations vector
* @driver_ready: Called right after control channel is started. Used by
@@ -453,6 +460,10 @@ static inline bool tb_switch_is_er(const struct tb_switch *sw)
int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged);
int tb_port_add_nfc_credits(struct tb_port *port, int credits);
int tb_port_clear_counter(struct tb_port *port, int counter);
+int tb_port_alloc_in_hopid(struct tb_port *port, int hopid, int max_hopid);
+void tb_port_release_in_hopid(struct tb_port *port, int hopid);
+int tb_port_alloc_out_hopid(struct tb_port *port, int hopid, int max_hopid);
+void tb_port_release_out_hopid(struct tb_port *port, int hopid);
int tb_switch_find_vse_cap(struct tb_switch *sw, enum tb_switch_vse_cap vsec);
int tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap);
--
2.20.1
^ permalink raw reply related
* [PATCH v4 14/36] thunderbolt: Rename tunnel_pci to tunnel
From: Mika Westerberg @ 2019-04-10 13:36 UTC (permalink / raw)
To: linux-kernel
Cc: Michael Jamet, Yehezkel Bernat, Andreas Noever, Lukas Wunner,
David S . Miller, Andy Shevchenko, Christian Kellner,
Mario.Limonciello, Joe Perches, Mika Westerberg, netdev
In-Reply-To: <20190410133653.88061-1-mika.westerberg@linux.intel.com>
In order to tunnel non-PCIe traffic as well rename tunnel_pci.[ch] to
tunnel.[ch] to reflect this fact. No functional changes.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/Makefile | 2 +-
drivers/thunderbolt/tb.c | 2 +-
drivers/thunderbolt/{tunnel_pci.c => tunnel.c} | 4 ++--
drivers/thunderbolt/{tunnel_pci.h => tunnel.h} | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
rename drivers/thunderbolt/{tunnel_pci.c => tunnel.c} (98%)
rename drivers/thunderbolt/{tunnel_pci.h => tunnel.h} (87%)
diff --git a/drivers/thunderbolt/Makefile b/drivers/thunderbolt/Makefile
index 8531f15d3b3c..833bdee3cec7 100644
--- a/drivers/thunderbolt/Makefile
+++ b/drivers/thunderbolt/Makefile
@@ -1,3 +1,3 @@
obj-${CONFIG_THUNDERBOLT} := thunderbolt.o
-thunderbolt-objs := nhi.o ctl.o tb.o switch.o cap.o path.o tunnel_pci.o eeprom.o
+thunderbolt-objs := nhi.o ctl.o tb.o switch.o cap.o path.o tunnel.o eeprom.o
thunderbolt-objs += domain.o dma_port.o icm.o property.o xdomain.o lc.o
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index e71530d0af65..8de43a2ab205 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -12,7 +12,7 @@
#include "tb.h"
#include "tb_regs.h"
-#include "tunnel_pci.h"
+#include "tunnel.h"
/**
* struct tb_cm - Simple Thunderbolt connection manager
diff --git a/drivers/thunderbolt/tunnel_pci.c b/drivers/thunderbolt/tunnel.c
similarity index 98%
rename from drivers/thunderbolt/tunnel_pci.c
rename to drivers/thunderbolt/tunnel.c
index 2de4edccbd6d..1e470564e99d 100644
--- a/drivers/thunderbolt/tunnel_pci.c
+++ b/drivers/thunderbolt/tunnel.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * Thunderbolt Cactus Ridge driver - PCIe tunnel
+ * Thunderbolt Cactus Ridge driver - Tunneling support
*
* Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com>
*/
@@ -8,7 +8,7 @@
#include <linux/slab.h>
#include <linux/list.h>
-#include "tunnel_pci.h"
+#include "tunnel.h"
#include "tb.h"
#define __TB_TUNNEL_PRINT(level, tunnel, fmt, arg...) \
diff --git a/drivers/thunderbolt/tunnel_pci.h b/drivers/thunderbolt/tunnel.h
similarity index 87%
rename from drivers/thunderbolt/tunnel_pci.h
rename to drivers/thunderbolt/tunnel.h
index f9b65fa1fd4d..dff0f27d6ab5 100644
--- a/drivers/thunderbolt/tunnel_pci.h
+++ b/drivers/thunderbolt/tunnel.h
@@ -1,12 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
- * Thunderbolt Cactus Ridge driver - PCIe tunnel
+ * Thunderbolt Cactus Ridge driver - Tunneling support
*
* Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com>
*/
-#ifndef TB_PCI_H_
-#define TB_PCI_H_
+#ifndef TB_TUNNEL_H_
+#define TB_TUNNEL_H_
#include "tb.h"
--
2.20.1
^ permalink raw reply related
* [PATCH v4 01/36] net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending
From: Mika Westerberg @ 2019-04-10 13:36 UTC (permalink / raw)
To: linux-kernel
Cc: Michael Jamet, Yehezkel Bernat, Andreas Noever, Lukas Wunner,
David S . Miller, Andy Shevchenko, Christian Kellner,
Mario.Limonciello, Joe Perches, Mika Westerberg, netdev
In-Reply-To: <20190410133653.88061-1-mika.westerberg@linux.intel.com>
The XDomain protocol messages may start as soon as Thunderbolt control
channel is started. This means that if the other host starts sending
ThunderboltIP packets early enough they will be passed to the network
driver which then gets confused because its resume hook is not called
yet.
Fix this by unregistering the ThunderboltIP protocol handler when
suspending and registering it back on resume.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
drivers/net/thunderbolt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c
index c48c3a1eb1f8..fcf31335a8b6 100644
--- a/drivers/net/thunderbolt.c
+++ b/drivers/net/thunderbolt.c
@@ -1282,6 +1282,7 @@ static int __maybe_unused tbnet_suspend(struct device *dev)
tbnet_tear_down(net, true);
}
+ tb_unregister_protocol_handler(&net->handler);
return 0;
}
@@ -1290,6 +1291,8 @@ static int __maybe_unused tbnet_resume(struct device *dev)
struct tb_service *svc = tb_to_service(dev);
struct tbnet *net = tb_service_get_drvdata(svc);
+ tb_register_protocol_handler(&net->handler);
+
netif_carrier_off(net->dev);
if (netif_running(net->dev)) {
netif_device_attach(net->dev);
--
2.20.1
^ permalink raw reply related
* [PATCH v4 00/36] thunderbolt: Software connection manager improvements
From: Mika Westerberg @ 2019-04-10 13:36 UTC (permalink / raw)
To: linux-kernel
Cc: Michael Jamet, Yehezkel Bernat, Andreas Noever, Lukas Wunner,
David S . Miller, Andy Shevchenko, Christian Kellner,
Mario.Limonciello, Joe Perches, Mika Westerberg, netdev
Hi,
This is fourth iteration of the patch series improving software connection
manager capabilities to support:
- PCIe tunnels for full daisy chain up to 6 devices
- Display port tunneling
- P2P networking
The series applies on top of thunderbolt.git/next.
Previous version of the patch series can be viewed here:
v3: https://lkml.org/lkml/2019/3/28/310
v2: https://lkml.org/lkml/2019/2/6/347
v1: https://lkml.org/lkml/2019/1/29/924
Changes from v3:
* Added tags from Lukas.
* Fixed typo get_switch_by_route() -> get_switch_at_route().
* In patch 12 drop check for port->sw->is_unplugged (done already in
patch 4) and add check for -ENODEV instead.
* Fixed tb_path_alloc() to make sure in_hopid matches the previous
out_hopid in patch 19. Also updated kernel-docs accordingly.
* Added missing \n termination in patch 34.
Changes from v2 (major):
* Always set port->remote even in case of dual link connection.
* Leave (DP, PCIe) tunnels up when the driver is unloaded. When loaded
back, it discovers the existing tunnels and updated data structures
accordingly. I noticed that the code in v2 did not support cases
properly when you unplug something before the driver gets loaded back.
This version tears down partial paths during discovery.
* Do not automatically create PCIe tunnels. Instead we implement "user"
security level in the software connection manager as well taking
advantage of the existing sysfs interfaces. This allows user to disable
PCIe tunneling completely or implement different white listing
policies. Major distros include bolt system daemon that takes care of
this.
* When testing on two-port Falcon Ridge based system I realized
that we always just pick the first available PCIe downstream adapter
regardless of which Thunderbolt port you plug the device which is not
consistent. To solve this we add mapping between host PCIe downstream
adapter and the Thunderbolt port for Cactus Ridge and Falcon Ridge
based systems.
* Take domain lock in switch sysfs callbacks. This is needed because the
software connection manager needs to walk over the topology during
tunnel creation so switch_lock is not enough anymore.
Changes from v1:
* Added ACK from David
* Add constant (TMU_ACCESS_EN) for BIT(20) when TMU access is enabled. We
keep it in cap.c close to the LR/ER workaround. Also we enable/disable
only during capability walk. If it turns we need to have it enabled
elsewhere we can move it to switch.c and enable just once during
switch enumeration.
* Use 0 to mean no cap_adap instead of negative value. This follows
cap_phy.
* Use correct PCI IDs (_BRIDGE) in the last patch where we start firmware
on Titan Ridge. It wrongly used NHI PCI IDs in v1.
Mika Westerberg (36):
net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending
thunderbolt: Remove unused work field in struct tb_switch
thunderbolt: Drop duplicated get_switch_at_route()
thunderbolt: Block reads and writes if switch is unplugged
thunderbolt: Take domain lock in switch sysfs attribute callbacks
thunderbolt: Do not allocate switch if depth is greater than 6
thunderbolt: Enable TMU access when accessing port space on legacy devices
thunderbolt: Add dummy read after port capability list walk on Light Ridge
thunderbolt: Move LC specific functionality into a separate file
thunderbolt: Configure lanes when switch is initialized
thunderbolt: Set sleep bit when suspending switch
thunderbolt: Properly disable path
thunderbolt: Cache adapter specific capability offset into struct port
thunderbolt: Rename tunnel_pci to tunnel
thunderbolt: Generalize tunnel creation functionality
thunderbolt: Add functions for allocating and releasing HopIDs
thunderbolt: Assign remote for both ports in case of dual link
thunderbolt: Add helper function to iterate from one port to another
thunderbolt: Extend tunnel creation to more than 2 adjacent switches
thunderbolt: Deactivate all paths before restarting them
thunderbolt: Discover preboot PCIe paths the boot firmware established
thunderbolt: Add support for full PCIe daisy chains
thunderbolt: Scan only valid NULL adapter ports in hotplug
thunderbolt: Generalize port finding routines to support all port types
thunderbolt: Rework NFC credits handling
thunderbolt: Add support for Display Port tunnels
thunderbolt: Do not tear down tunnels when driver is unloaded
thunderbolt: Run tb_xdp_handle_request() in system workqueue
thunderbolt: Add XDomain UUID exchange support
thunderbolt: Add support for DMA tunnels
thunderbolt: Make tb_switch_alloc() return ERR_PTR()
thunderbolt: Add support for XDomain connections
thunderbolt: Make __TB_[SW|PORT]_PRINT take const parameters
thunderbolt: Make rest of the logging to happen at debug level
thunderbolt: Reword output of tb_dump_hop()
thunderbolt: Start firmware on Titan Ridge Apple systems
drivers/net/thunderbolt.c | 3 +
drivers/thunderbolt/Makefile | 4 +-
drivers/thunderbolt/cap.c | 85 +++-
drivers/thunderbolt/ctl.c | 2 +-
drivers/thunderbolt/icm.c | 60 ++-
drivers/thunderbolt/lc.c | 179 ++++++++
drivers/thunderbolt/nhi.c | 3 +-
drivers/thunderbolt/path.c | 420 ++++++++++++++++---
drivers/thunderbolt/switch.c | 551 +++++++++++++++++++-----
drivers/thunderbolt/tb.c | 608 ++++++++++++++++++++-------
drivers/thunderbolt/tb.h | 225 ++++++++--
drivers/thunderbolt/tb_msgs.h | 11 +
drivers/thunderbolt/tb_regs.h | 50 ++-
drivers/thunderbolt/tunnel.c | 691 +++++++++++++++++++++++++++++++
drivers/thunderbolt/tunnel.h | 78 ++++
drivers/thunderbolt/tunnel_pci.c | 226 ----------
drivers/thunderbolt/tunnel_pci.h | 31 --
drivers/thunderbolt/xdomain.c | 147 ++++++-
include/linux/thunderbolt.h | 8 +
19 files changed, 2720 insertions(+), 662 deletions(-)
create mode 100644 drivers/thunderbolt/lc.c
create mode 100644 drivers/thunderbolt/tunnel.c
create mode 100644 drivers/thunderbolt/tunnel.h
delete mode 100644 drivers/thunderbolt/tunnel_pci.c
delete mode 100644 drivers/thunderbolt/tunnel_pci.h
--
2.20.1
^ permalink raw reply
* [PATCH v4 02/36] thunderbolt: Remove unused work field in struct tb_switch
From: Mika Westerberg @ 2019-04-10 13:36 UTC (permalink / raw)
To: linux-kernel
Cc: Michael Jamet, Yehezkel Bernat, Andreas Noever, Lukas Wunner,
David S . Miller, Andy Shevchenko, Christian Kellner,
Mario.Limonciello, Joe Perches, Mika Westerberg, netdev
In-Reply-To: <20190410133653.88061-1-mika.westerberg@linux.intel.com>
This field is not used anywhere so remove it.
Reported-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/tb.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index 52584c4003e3..8058ea02d572 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -70,7 +70,6 @@ struct tb_switch_nvm {
* @boot: Whether the switch was already authorized on boot or not
* @rpm: The switch supports runtime PM
* @authorized: Whether the switch is authorized by user or policy
- * @work: Work used to automatically authorize a switch
* @security_level: Switch supported security level
* @key: Contains the key used to challenge the device or %NULL if not
* supported. Size of the key is %TB_SWITCH_KEY_SIZE.
@@ -105,7 +104,6 @@ struct tb_switch {
bool boot;
bool rpm;
unsigned int authorized;
- struct work_struct work;
enum tb_security_level security_level;
u8 *key;
u8 connection_id;
--
2.20.1
^ permalink raw reply related
* Re: [linux-lvm] can't remove snapshot
From: Lentes, Bernd @ 2019-04-10 13:36 UTC (permalink / raw)
To: LVM Mailingliste, (RedHat); +Cc: Zdenek Kabelac
In-Reply-To: <6d88edff-8ec2-7724-04c2-9909f2013d29@gmail.com>
----- Am 9. Apr 2019 um 15:24 schrieb Zdenek Kabelac zdenek.kabelac@gmail.com:
> Dne 09. 04. 19 v 15:00 Lentes, Bernd napsal(a):
>> Hello list,
>>
>> I have a two-node HA-cluster which uses local and cluster LVM.
>> cLVM is currently stopped, I try to remove a snapshot from the root lv which
>> is located on a local VG.
>> I get this error:
>> ha-idg-2:/mnt/spp # lvremove -fv vg_local/lv_snap_pre_sp4
>> connect() failed on local socket: No such file or directory
>> Internal cluster locking initialisation failed.
>> WARNING: Falling back to local file-based locking.
>> Volume Groups with the clustered attribute will be inaccessible.
>> Archiving volume group "vg_local" metadata (seqno 26).
>> Removing snapshot volume vg_local/lv_snap_pre_sp4.
>> Loading table for vg_local-lv_root (254:8).
>> device-mapper: reload ioctl on (254:8) failed: Invalid argument
>> Failed to refresh lv_root without snapshot.
>>
>
> Hi
>
> Have you tried to converted clustered VG to be a non-clustered one ?
> And use file locking to proceed with operation on local device?
>
> Zdenek
Hi,
i tried all i found on the net.
Stopping udev before lvremove, dmsetup remove before, lock the device with lockdev,
tried to deactivate the snapshot before removing (which didn't work because then i also had
to deactivate the root lv which is the source for the snapshot),
stopped monitoring the snapshot, update of the complete system ...
nothing succeeded.
I have a SLES 12 SP4 with 4.12.14-95.13-default and lvm2-2.02.180-9.7.1.x86_64.
I finally did a strace on the program:
...
write(2, "Loading table for vg_local-lv_ro"..., 43Loading table for vg_local-lv_root (254:9).) = 43
write(2, "\n", 1
) = 1
ioctl(3, DM_TABLE_STATUS, 0x563eacb00c80) = 0
ioctl(3, DM_TABLE_LOAD, 0x563eacb00c80) = -1 EINVAL (Invalid argument) <========================================================
write(2, " ", 2 ) = 2
write(2, "device-mapper: reload ioctl on "..., 64device-mapper: reload ioctl on (254:9) failed: Invalid argument) = 64
write(2, "\n", 1
) = 1
brk(0x563eacf92000) = 0x563eacf92000
write(2, " ", 2 ) = 2
write(2, "Failed to refresh lv_root withou"..., 43Failed to refresh lv_root without snapshot.) = 43
write(2, "\n", 1
) = 1
This seems to be the culprit:
ioctl(3, DM_TABLE_LOAD, 0x563eacb00c80) = -1 EINVAL
fd 3 seems to be /dev/mapper/control. DM_TABLE_LOAD is defined in include/uapi/linux/dm-ioctl.h:
#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
And the memory adress is the same as the one used successfully one line before.
Error -1 is, following man:
EINVAL: request or argp is not valid
In the manpage sys/ioctl.h is mentioned, but i don't find it in my sources.
Any ideas ?
Bernd
Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Stellv. Aufsichtsratsvorsitzender: MinDirig. Dr. Manfred Wolter
Geschaeftsfuehrung: Prof. Dr. med. Dr. h.c. Matthias Tschoep, Heinrich Bassler, Kerstin Guenther
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
^ permalink raw reply
* Re: [PATCH 15/21] rt2x00: rt2800lib: hardcode txmixer gain values to zero for RT3883
From: Daniel Golle @ 2019-04-10 13:12 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: Tom Psyborg, linux-wireless, Felix Fietkau, Mathias Kresin,
Gabor Juhos
In-Reply-To: <20190410082241.GA2538@redhat.com>
On Wed, Apr 10, 2019 at 10:22:42AM +0200, Stanislaw Gruszka wrote:
> On Tue, Apr 09, 2019 at 05:26:46PM +0200, Tom Psyborg wrote:
> > On 09/04/2019, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> > > From: Gabor Juhos <juhosg@openwrt.org>
> > >
> > > Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> > > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > > ---
> > > drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++--
> > > 1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > index 0687bef990e1..4ea94c62d439 100644
> > > --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > @@ -9128,7 +9128,8 @@ static u8 rt2800_get_txmixer_gain_24g(struct
> > > rt2x00_dev *rt2x00dev)
> > > {
> > > u16 word;
> > >
> > > - if (rt2x00_rt(rt2x00dev, RT3593))
> > > + if (rt2x00_rt(rt2x00dev, RT3593) ||
> > > + rt2x00_rt(rt2x00dev, RT3883))
> > > return 0;
> > >
> > > word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG);
> > > @@ -9142,7 +9143,8 @@ static u8 rt2800_get_txmixer_gain_5g(struct rt2x00_dev
> > > *rt2x00dev)
> > > {
> > > u16 word;
> > >
> > > - if (rt2x00_rt(rt2x00dev, RT3593))
> > > + if (rt2x00_rt(rt2x00dev, RT3593) ||
> > > + rt2x00_rt(rt2x00dev, RT3883))
> > > return 0;
> > >
> > > word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A);
> > > --
> > > 2.7.5
> > >
> > >
> >
> > Did someone actually verified this is correct?
>
> I don't know if it was verified or not.
Gabor supposedly verified this when he wrote that patch 6 years ago,
it was reviewed and merged by John Crispin back then:
commit 6e3de004f9cf6724b1ad950e7cb3b98f1b4af54d
Author: John Crispin <blogic@openwrt.org>
Date: Wed Apr 23 07:52:18 2014 +0000
mac80211: rt2x00: add support for the RT3662/RT3883 SoCs
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40558 3c298f89-4303-0410-b956-a3cf2f4a3e73
Since when we carry it in OpenWrt and supposedly everyone with Rt3xx3
WiSoC devices is using it and there haven't been any complains so far.
Cheers
Daniel
>
> Stanislaw
^ permalink raw reply
* Re: [PATCH v2 0/3] Add support for STPMIC1
From: Alexandre Torgue @ 2019-04-10 13:32 UTC (permalink / raw)
To: Pascal PAILLET-LME, mcoquelin.stm32@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, linux@armlinux.org.uk,
horms+renesas@verge.net.au, olof@lixom.net, arnd@arndb.de,
geert+renesas@glider.be, biju.das@bp.renesas.com, Yannick FERTRE,
m.szyprowski@samsung.com, linus.walleij@linaro.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Linus Walleij
In-Reply-To: <1554800820-5412-1-git-send-email-p.paillet@st.com>
Hi Pascal
On 4/9/19 11:07 AM, Pascal PAILLET-LME wrote:
> Add support for STPMIC1 on:
> - stm32mp157c ed1 board
> - stm32mp157a dk1 board
> - arm multi_v7_defconfig
>
> Pascal Paillet (3):
>
> changes in v2:
> * Describe why we disable the DMAs for PMIC
>
> ARM: dts: stm32: add stpmic1 support on stm32mp157c ed1 board
> ARM: dts: stm32: add stpmic1 support on stm32mp157a dk1 board
> ARM: multi_v7_defconfig: Enable support for STPMIC1
>
> arch/arm/boot/dts/stm32mp157a-dk1.dts | 158
> ++++++++++++++++++++++++++++++++--
> arch/arm/boot/dts/stm32mp157c-ed1.dts | 156
> +++++++++++++++++++++++++++++----
> arch/arm/configs/multi_v7_defconfig | 4 +
> 3 files changed, 294 insertions(+), 24 deletions(-)
>
> --
> 1.9.1
Series applied on stm32-next.
Linus,
I saw that you made a comment on first version which has been fixed by
Pascal in v2. Sorry if I don't wait for your ack (I don't have much time
to finish my PR).
Regards
Alex
^ permalink raw reply
* Re: [PATCH] nfs4_getfacl: Add new option -c/--omit-header to not display comment header.
From: Kenneth Dsouza @ 2019-04-10 13:33 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-nfs
In-Reply-To: <20190410132607.GA2714@fieldses.org>
Thanks! Should we also add the below entries similar to getfacl?
$ nfs4_getfacl /test/
# file: /test/
# owner: test
# group: test
A::OWNER@:rwaDxtTcCy
A::GROUP@:rwaDxtcy
A::EVERYONE@:rwaDxtcy
On Wed, Apr 10, 2019 at 6:56 PM J. Bruce Fields <bfields@fieldses.org> wrote:
>
> On Wed, Apr 10, 2019 at 03:07:11PM +0530, Kenneth Dsouza wrote:
> > On Wed, Apr 10, 2019 at 2:04 AM J. Bruce Fields <bfields@fieldses.org> wrote:
> > >
> > > Thanks, applying with some fixes:
> > >
> > > On Tue, Mar 26, 2019 at 07:27:40PM +0530, Kenneth D'souza wrote:
> > > > With this patch the filename will not be printed.
> > > >
> > > > $ nfs4_getfacl /test/
> > > > # file: /test/
> > > > A::OWNER@:rwaDxtTcCy
> > > > A::GROUP@:rwaDxtcy
> > > > A::EVERYONE@:rwaDxtcy
> > > >
> > > > $ nfs4_getfacl -c /test/
> > > >
> > > > A::OWNER@:rwaDxtTcCy
> > > > A::GROUP@:rwaDxtcy
> > > > A::EVERYONE@:rwaDxtcy
> > >
> > > I don't see any reason for that blank line, I've removed it.
> > >
> > I added the blank line so we print acl for each file on a new line
> > when -c is used.
>
> OK, it does make sense to have a blank line between multiple ACLs.
>
> Again I'd rather adopt the same behavior has getfacl/setfacl whenever we
> can. Looks like getfacl just appends a blank line regardless of whether
> -c is used or whether the are multiple ACLs:
>
> [bfields@patate ~]$ getfacl .
> # file: .
> # owner: bfields
> # group: bfields
> user::rwx
> group::--x
> other::--x
>
> [bfields@patate ~]$
>
> I've added that to print_acl_from_path().
>
> --b.
>
> > # nfs4_getfacl -Rc /test
> >
> > A::OWNER@:rwaDxtTcCy
> > A::GROUP@:rwaDxtcy
> > A::EVERYONE@:rwaDxtcy
> >
> > A::OWNER@:rwatTcCy
> > A::GROUP@:tcy
> > A::EVERYONE@:tcy
> >
> > A::OWNER@:rwaDxtTcCy
> > A::GROUP@:rxtcy
> > A::EVERYONE@:rxtcy
> >
> >
> > > > @@ -115,7 +119,10 @@ static void print_acl_from_path(const char *fpath)
> > > > struct nfs4_acl *acl;
> > > > acl = nfs4_acl_for_path(fpath);
> > > > if (acl != NULL) {
> > > > + if(ignore_comment == 0)
> > > > printf("\n# file: %s\n", fpath);
> > >
> > > This needs to be indented.
> > >
> > > > + else
> > > > + printf("\n");
> > >
> > > I've removed the "else" clause.
> > >
> > > And fixed a couple minor whitespace issues.
> > >
> > > --b.
> > >
> > > > nfs4_print_acl(stdout, acl);
> > > > nfs4_free_acl(acl);
> > > > }
> > > > @@ -125,7 +132,7 @@ static void usage(int label)
> > > > {
> > > > if (label)
> > > > fprintf(stderr, "%s %s -- get NFSv4 file or directory access control lists.\n", execname, VERSION);
> > > > - fprintf(stderr, "Usage: %s [-R] file ...\n -H, --more-help\tdisplay ACL format information\n -?, -h, --help\tdisplay this help text\n -R --recursive\trecurse into subdirectories\n", execname);
> > > > + fprintf(stderr, "Usage: %s [-R] file ...\n -H, --more-help\tdisplay ACL format information\n -?, -h, --help\tdisplay this help text\n -R --recursive\trecurse into subdirectories\n -c, --omit-header\tDo not display the comment header (Do not print filename)\n", execname);
> > > > }
> > > >
> > > > static void more_help()
> > > > --
> > > > 2.20.1
^ permalink raw reply
* Re: [PATCH v2 0/3] Add support for STPMIC1
From: Alexandre Torgue @ 2019-04-10 13:32 UTC (permalink / raw)
To: Pascal PAILLET-LME, mcoquelin.stm32@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, linux@armlinux.org.uk,
horms+renesas@verge.net.au, olof@lixom.net, arnd@arndb.de,
geert+renesas@glider.be, biju.das@bp.renesas.com, Yannick FERTRE,
m.szyprowski@samsung.com, linus.walleij@linaro.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Linus Walleij
In-Reply-To: <1554800820-5412-1-git-send-email-p.paillet@st.com>
Hi Pascal
On 4/9/19 11:07 AM, Pascal PAILLET-LME wrote:
> Add support for STPMIC1 on:
> - stm32mp157c ed1 board
> - stm32mp157a dk1 board
> - arm multi_v7_defconfig
>
> Pascal Paillet (3):
>
> changes in v2:
> * Describe why we disable the DMAs for PMIC
>
> ARM: dts: stm32: add stpmic1 support on stm32mp157c ed1 board
> ARM: dts: stm32: add stpmic1 support on stm32mp157a dk1 board
> ARM: multi_v7_defconfig: Enable support for STPMIC1
>
> arch/arm/boot/dts/stm32mp157a-dk1.dts | 158
> ++++++++++++++++++++++++++++++++--
> arch/arm/boot/dts/stm32mp157c-ed1.dts | 156
> +++++++++++++++++++++++++++++----
> arch/arm/configs/multi_v7_defconfig | 4 +
> 3 files changed, 294 insertions(+), 24 deletions(-)
>
> --
> 1.9.1
Series applied on stm32-next.
Linus,
I saw that you made a comment on first version which has been fixed by
Pascal in v2. Sorry if I don't wait for your ack (I don't have much time
to finish my PR).
Regards
Alex
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: How to get useful information other than "the whole system locks up"?
From: Braiam @ 2019-04-10 13:33 UTC (permalink / raw)
To: amd-gfx list
In-Reply-To: <CAG=7Bt8VEgsiqaMDYtU31ut1pU+h6_rEaqnfh2tyR7SuEpUQ8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sat, Apr 6, 2019 at 3:25 PM Braiam <braiamp@gmail.com> wrote:
>
> At this point I decided that the system isn't going to recover, so I
> tried to soft-reboot it, but it only ended locked and had to hard
> reboot.
>
> I've found this bug[1] that seems related, user watching videos. I
> will try removing vaapi and check if that improves anything.
>
> [1]: https://bugs.freedesktop.org/show_bug.cgi?id=106547
>
Removing libva didn't help. Lock ups still occur frequently.
A new symptom is that video doesn't need to be visible on the display
for the lockup to occur. -rc4 didn't improve the situation either.
Lockups are still instantaneous, I haven't had another one where the
gpu doesn't drag all the system.
--
Braiam
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply
* Potential bug in queue_count_set
From: Maximilian Luz @ 2019-04-10 13:33 UTC (permalink / raw)
Hi all,
I just stumbled (more or less randomly) over this piece of code
(/drivers/nvme/host/pci.c, v5.1-rc4):
147: static int queue_count_set(const char *val, const struct kernel_param *kp)
148: {
149: int n = 0, ret;
150:
151: ret = kstrtoint(val, 10, &n);
152: if (ret)
153: return ret;
154: if (n > num_possible_cpus())
155: n = num_possible_cpus();
156:
157: return param_set_int(val, kp);
158: }
Link with context: https://github.com/torvalds/linux/blob/v5.1-rc4/drivers/nvme/host/pci.c#L154-L155
It looks like lines 154, 155 don't achieve anything as `n` is not being
used afterwards. Sorry if this is already known or a non-issue, just
wanted to let you guys know.
Maximilian
^ permalink raw reply
* Re: [PATCH v2 0/3] Add support for STPMIC1
From: Alexandre Torgue @ 2019-04-10 13:32 UTC (permalink / raw)
To: Pascal PAILLET-LME, mcoquelin.stm32@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, linux@armlinux.org.uk,
horms+renesas@verge.net.au, olof@lixom.net, arnd@arndb.de,
geert+renesas@glider.be, biju.das@bp.renesas.com, Yannick FERTRE,
m.szyprowski@samsung.com, linus.walleij@linaro.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
In-Reply-To: <1554800820-5412-1-git-send-email-p.paillet@st.com>
Hi Pascal
On 4/9/19 11:07 AM, Pascal PAILLET-LME wrote:
> Add support for STPMIC1 on:
> - stm32mp157c ed1 board
> - stm32mp157a dk1 board
> - arm multi_v7_defconfig
>
> Pascal Paillet (3):
>
> changes in v2:
> * Describe why we disable the DMAs for PMIC
>
> ARM: dts: stm32: add stpmic1 support on stm32mp157c ed1 board
> ARM: dts: stm32: add stpmic1 support on stm32mp157a dk1 board
> ARM: multi_v7_defconfig: Enable support for STPMIC1
>
> arch/arm/boot/dts/stm32mp157a-dk1.dts | 158
> ++++++++++++++++++++++++++++++++--
> arch/arm/boot/dts/stm32mp157c-ed1.dts | 156
> +++++++++++++++++++++++++++++----
> arch/arm/configs/multi_v7_defconfig | 4 +
> 3 files changed, 294 insertions(+), 24 deletions(-)
>
> --
> 1.9.1
Series applied on stm32-next.
Linus,
I saw that you made a comment on first version which has been fixed by
Pascal in v2. Sorry if I don't wait for your ack (I don't have much time
to finish my PR).
Regards
Alex
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [U-Boot] UBIFS mount bug when mounting from multiple MTD partitions
From: Schrempf Frieder @ 2019-04-10 13:31 UTC (permalink / raw)
To: u-boot
In-Reply-To: <0cedcdef-0d95-4485-1a1b-6d8c61f05944@denx.de>
Hi Heiko,
On 10.04.19 14:44, Heiko Schocher wrote:
> Hello Frieder,
>
> Am 10.04.2019 um 12:49 schrieb Schrempf Frieder:
>> Hi,
>>
>> I have a customer who has a NAND device with two MTD partitions and
>> each > of the partitions contains one UBI volume with a UBIFS filesystem.
>
> Bad idea ... why?
>
> You may loose lifetime of the board, as UBI cannot use PEBs between the
> 2 MTD partitions on the nand ... better you would have one big MTD
> Partition
> with n ubi volumes in it ...
>
> But ... okay... this must work also.
Yeah, I only recently learned about the disadvantages of this setup.
Maybe we can change it in the future, but for now they are using
separate partitions.
>
>> Now U-Boot can mount the UBIFS from the first partition just fine, but
>> if the UBIFS from the second partition is mounted afterwards this fails
>> in some cases.
>
> :-(
>
>> I can reproduce the error and tracked it down to uboot_ubifs_mount() in
>> fs/ubifs/super.c. If this function is run for the second mount, the
>> struct ubifs_fs_type is reused and it contains a list fs_supers, that
>> still holds one entry for the first mount.
>
> Sure?
>
> fs_supers in struct file_system_type seems used only in none
> U-Boot code...
Right, I had a closer look and fs_supers seems to be unused indeed, but
somehow it causes corruption in my case. When I apply 5a08cfee3967
(ubifs: remove useless code) the problem disappears.
Without this patch there still is hlist_add_head(&s->s_instances,
&type->fs_supers) and this line somehow seems to cause the error.
I applied this debug diff:
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2428,7 +2428,15 @@ retry:
#else
strncpy(s->s_id, type->name, sizeof(s->s_id));
#endif
+ printf("%s:%d: ubi_num: %d, vol_id: %d\n",
+ __func__, __LINE__,
+ ((struct ubifs_info *)s->s_fs_info)->vi.ubi_num,
+ ((struct ubifs_info *)s->s_fs_info)->vi.vol_id);
hlist_add_head(&s->s_instances, &type->fs_supers);
+ printf("%s:%d: ubi_num: %d, vol_id: %d\n",
+ __func__, __LINE__,
+ ((struct ubifs_info *)s->s_fs_info)->vi.ubi_num,
+ ((struct ubifs_info *)s->s_fs_info)->vi.vol_id);
#ifndef __UBOOT__
spin_unlock(&sb_lock);
get_filesystem(type);
And I'm getting this for the first mount:
sget:2431: ubi_num: 0, vol_id: 0
sget:2433: ubi_num: 0, vol_id: 0
And this for the second mount:
sget:2431: ubi_num: 0, vol_id: 0
sget:2433: ubi_num: -1678121552, vol_id: -1678120656
>> I guess, that if the second mount would happen on a volume that is on
>> the same MTD partition as the first volume, than this will work. The
>> second entry is added to ubifs_fs_type.fs_supers.
>
> I cannot see this from looking into code ... so hard to say, but
> I only looked into mainline code ...
Yeah, I was probably wrong with these first wild guesses...
>
>> In my case however, the second entry being added to
>> ubifs_fs_type.fs_supers is invalid and causes the mount error.
>>
>> Reinitializing the list in uboot_ubifs_mount() before each mount, solves
>> the problem, but I guess that it will cause failures in other setups,
>> where there are actually multiple volumes on one MTD device.
>>
>> So how can I solve this properly? Do we need one instance of struct
>> ubifs_fs_type for each MTD device?
>
> Hmm.. without digging into it, it is difficult to say...
>
>> I tested this on an old version (2017.03), but looking at the current
>> code, it looks like the same problem applies to current mainline.
>
> Is there any chance to try it with current mainline ?
The problem is a bit strange and this what I'm actually worried about.
It is persistent in a certain environment: U-Boot loaded from SPI NOR,
environment set to certain values, data written to UBIFS partition in
Linux and then power-cut.
If one of these conditions changes, the error usually disappears, for
example if I use the exact same setup, but load the Bootloader from MMC
or RAM. Or if no write access with power-cut happens.
So I wonder if there's some memory corruption somewhere else. Though,
the error happens always at the same place. Debug prints or other code
changes have no influence.
I really would like to understand what's going on so I can make sure
that 5a08cfee3967 actually solves the real issue or just hides it.
Thanks,
Frieder
^ permalink raw reply
* Re: [PATCH v8 1/2] media: uapi: Add H264 low-level decoder API compound controls.
From: Hans Verkuil @ 2019-04-10 13:30 UTC (permalink / raw)
To: Maxime Ripard, hans.verkuil, acourbot, sakari.ailus,
Laurent Pinchart
Cc: jonas, jenskuske, linux-sunxi, linux-kernel, jernej.skrabec,
tfiga, Paul Kocialkowski, Chen-Yu Tsai, posciak, Thomas Petazzoni,
Guenter Roeck, nicolas.dufresne, ezequiel, linux-arm-kernel,
linux-media
In-Reply-To: <f537c99d8b5a974f8687f4f0d018c025a4220f7a.1554382670.git-series.maxime.ripard@bootlin.com>
On 4/4/19 2:59 PM, Maxime Ripard wrote:
> From: Pawel Osciak <posciak@chromium.org>
>
> Stateless video codecs will require both the H264 metadata and slices in
> order to be able to decode frames.
>
> This introduces the definitions for a new pixel format for H264 slices that
> have been parsed, as well as the structures used to pass the metadata from
> the userspace to the kernel.
>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Signed-off-by: Pawel Osciak <posciak@chromium.org>
> Signed-off-by: Guenter Roeck <groeck@chromium.org>
> Co-developed-by: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
> Documentation/media/uapi/v4l/biblio.rst | 9 +-
> Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 569 ++++++++++++++-
> Documentation/media/uapi/v4l/pixfmt-compressed.rst | 19 +-
> Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 30 +-
> Documentation/media/videodev2.h.rst.exceptions | 5 +-
> drivers/media/v4l2-core/v4l2-ctrls.c | 42 +-
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +-
> include/media/h264-ctrls.h | 192 +++++-
> include/media/v4l2-ctrls.h | 13 +-
> include/uapi/linux/videodev2.h | 1 +-
> 10 files changed, 880 insertions(+), 1 deletion(-)
> create mode 100644 include/media/h264-ctrls.h
>
> diff --git a/Documentation/media/uapi/v4l/biblio.rst b/Documentation/media/uapi/v4l/biblio.rst
> index ec33768c055e..8f4eb8823d82 100644
> --- a/Documentation/media/uapi/v4l/biblio.rst
> +++ b/Documentation/media/uapi/v4l/biblio.rst
> @@ -122,6 +122,15 @@ ITU BT.1119
>
> :author: International Telecommunication Union (http://www.itu.ch)
>
> +.. _h264:
> +
> +ITU-T Rec. H.264 Specification (04/2017 Edition)
> +================================================
> +
> +:title: ITU-T Recommendation H.264 "Advanced Video Coding for Generic Audiovisual Services"
> +
> +:author: International Telecommunication Union (http://www.itu.ch)
> +
> .. _jfif:
>
> JFIF
> diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
> index 67a122339c0e..fe720f239f70 100644
> --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
> +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
> @@ -1371,6 +1371,575 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
> - Layer number
>
>
> +.. _v4l2-mpeg-h264:
> +
> +``V4L2_CID_MPEG_VIDEO_H264_SPS (struct)``
> + Specifies the sequence parameter set (as extracted from the
> + bitstream) for the associated H264 slice data. This includes the
> + necessary parameters for configuring a stateless hardware decoding
> + pipeline for H264. The bitstream parameters are defined according
> + to :ref:`h264`, section 7.4.2.1.1 "Sequence Parameter Set Data
> + Semantics". For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_sps
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_sps
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u8
> + - ``profile_idc``
> + -
> + * - __u8
> + - ``constraint_set_flags``
> + - See :ref:`Sequence Parameter Set Constraints Set Flags <h264_sps_constraints_set_flags>`
> + * - __u8
> + - ``level_idc``
> + -
> + * - __u8
> + - ``seq_parameter_set_id``
> + -
> + * - __u8
> + - ``chroma_format_idc``
> + -
> + * - __u8
> + - ``bit_depth_luma_minus8``
> + -
> + * - __u8
> + - ``bit_depth_chroma_minus8``
> + -
> + * - __u8
> + - ``log2_max_frame_num_minus4``
> + -
> + * - __u8
> + - ``pic_order_cnt_type``
> + -
> + * - __u8
> + - ``log2_max_pic_order_cnt_lsb_minus4``
> + -
> + * - __u8
> + - ``max_num_ref_frames``
> + -
> + * - __u8
> + - ``num_ref_frames_in_pic_order_cnt_cycle``
> + -
> + * - __s32
> + - ``offset_for_ref_frame[255]``
> + -
> + * - __s32
> + - ``offset_for_non_ref_pic``
> + -
> + * - __s32
> + - ``offset_for_top_to_bottom_field``
> + -
> + * - __u16
> + - ``pic_width_in_mbs_minus1``
> + -
> + * - __u16
> + - ``pic_height_in_map_units_minus1``
> + -
> + * - __u32
> + - ``flags``
> + - See :ref:`Sequence Parameter Set Flags <h264_sps_flags>`
> +
> +.. _h264_sps_constraints_set_flags:
> +
> +``Sequence Parameter Set Constraints Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET0_FLAG``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET1_FLAG``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET2_FLAG``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET3_FLAG``
> + - 0x00000008
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET4_FLAG``
> + - 0x00000010
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET5_FLAG``
> + - 0x00000020
> + -
> +
> +.. _h264_sps_flags:
> +
> +``Sequence Parameter Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED``
> + - 0x00000008
> + -
> + * - ``V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY``
> + - 0x00000010
> + -
> + * - ``V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD``
> + - 0x00000020
> + -
> + * - ``V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE``
> + - 0x00000040
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_PPS (struct)``
> + Specifies the picture parameter set (as extracted from the
> + bitstream) for the associated H264 slice data. This includes the
> + necessary parameters for configuring a stateless hardware decoding
> + pipeline for H264. The bitstream parameters are defined according
> + to :ref:`h264`, section 7.4.2.2 "Picture Parameter Set RBSP
> + Semantics". For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_pps
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_pps
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u8
> + - ``pic_parameter_set_id``
> + -
> + * - __u8
> + - ``seq_parameter_set_id``
> + -
> + * - __u8
> + - ``num_slice_groups_minus1``
> + -
> + * - __u8
> + - ``num_ref_idx_l0_default_active_minus1``
> + -
> + * - __u8
> + - ``num_ref_idx_l1_default_active_minus1``
> + -
> + * - __u8
> + - ``weighted_bipred_idc``
> + -
> + * - __s8
> + - ``pic_init_qp_minus26``
> + -
> + * - __s8
> + - ``pic_init_qs_minus26``
> + -
> + * - __s8
> + - ``chroma_qp_index_offset``
> + -
> + * - __s8
> + - ``second_chroma_qp_index_offset``
> + -
> + * - __u16
> + - ``flags``
> + - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
> +
> +.. _h264_pps_flags:
> +
> +``Picture Parameter Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_PPS_FLAG_WEIGHTED_PRED``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
> + - 0x00000008
> + -
> + * - ``V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED``
> + - 0x00000010
> + -
> + * - ``V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT``
> + - 0x00000020
> + -
> + * - ``V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE``
> + - 0x00000040
> + -
> + * - ``V4L2_H264_PPS_FLAG_PIC_SCALING_MATRIX_PRESENT``
> + - 0x00000080
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX (struct)``
> + Specifies the scaling matrix (as extracted from the bitstream) for
> + the associated H264 slice data. The bitstream parameters are
> + defined according to :ref:`h264`, section 7.4.2.1.1.1 "Scaling
> + List Semantics".For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_scaling_matrix
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_scaling_matrix
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u8
> + - ``scaling_list_4x4[6][16]``
> + -
> + * - __u8
> + - ``scaling_list_8x8[6][64]``
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS (struct)``
> + Specifies the slice parameters (as extracted from the bitstream)
> + for the associated H264 slice data. This includes the necessary
> + parameters for configuring a stateless hardware decoding pipeline
> + for H264. The bitstream parameters are defined according to
> + :ref:`h264`, section 7.4.3 "Slice Header Semantics". For further
> + documentation, refer to the above specification, unless there is
> + an explicit comment stating otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API
> + and it is expected to change.
> +
> + This structure is expected to be passed as an array, with one
> + entry for each slice included in the bitstream buffer.
> +
> +.. c:type:: v4l2_ctrl_h264_slice_params
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_slice_params
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u32
> + - ``size``
> + -
> + * - __u32
> + - ``header_bit_size``
> + -
> + * - __u16
> + - ``first_mb_in_slice``
> + -
> + * - __u8
> + - ``slice_type``
> + -
> + * - __u8
> + - ``pic_parameter_set_id``
> + -
> + * - __u8
> + - ``colour_plane_id``
> + -
> + * - __u8
> + - ``redundant_pic_cnt``
> + -
> + * - __u16
> + - ``frame_num``
> + -
> + * - __u16
> + - ``idr_pic_id``
> + -
> + * - __u16
> + - ``pic_order_cnt_lsb``
> + -
> + * - __s32
> + - ``delta_pic_order_cnt_bottom``
> + -
> + * - __s32
> + - ``delta_pic_order_cnt0``
> + -
> + * - __s32
> + - ``delta_pic_order_cnt1``
> + -
> + * - struct :c:type:`v4l2_h264_pred_weight_table`
> + - ``pred_weight_table``
> + -
> + * - __u32
> + - ``dec_ref_pic_marking_bit_size``
> + -
> + * - __u32
> + - ``pic_order_cnt_bit_size``
> + -
> + * - __u8
> + - ``cabac_init_idc``
> + -
> + * - __s8
> + - ``slice_qp_delta``
> + -
> + * - __s8
> + - ``slice_qs_delta``
> + -
> + * - __u8
> + - ``disable_deblocking_filter_idc``
> + -
> + * - __s8
> + - ``slice_alpha_c0_offset_div2``
> + -
> + * - __s8
> + - ``slice_beta_offset_div2``
> + -
> + * - __u8
> + - ``num_ref_idx_l0_active_minus1``
> + -
> + * - __u8
> + - ``num_ref_idx_l1_active_minus1``
> + -
> + * - __u32
> + - ``slice_group_change_cycle``
> + -
> + * - __u8
> + - ``ref_pic_list0[32]``
> + - Reference picture list after applying the per-slice modifications
> + * - __u8
> + - ``ref_pic_list1[32]``
> + - Reference picture list after applying the per-slice modifications
> + * - __u32
> + - ``flags``
> + - See :ref:`Slice Parameter Flags <h264_slice_flags>`
> +
> +.. _h264_slice_flags:
> +
> +``Slice Parameter Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_SLICE_FLAG_FIELD_PIC``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_SLICE_FLAG_BOTTOM_FIELD``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH``
> + - 0x00000008
> + -
> +
> +``Prediction Weight Table``
> +
> + The bitstream parameters are defined according to :ref:`h264`,
> + section 7.4.3.2 "Prediction Weight Table Semantics". For further
> + documentation, refer to the above specification, unless there is
> + an explicit comment stating otherwise.
> +
> +.. c:type:: v4l2_h264_pred_weight_table
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_h264_pred_weight_table
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u16
> + - ``luma_log2_weight_denom``
> + -
> + * - __u16
> + - ``chroma_log2_weight_denom``
> + -
> + * - struct :c:type:`v4l2_h264_weight_factors`
> + - ``weight_factors[2]``
> + - The weight factors at index 0 are the weight factors for the reference
> + list 0, the one at index 1 for the reference list 1.
> +
> +.. c:type:: v4l2_h264_weight_factors
> +
> +.. cssclass:: longtable
> +
/> +.. flat-table:: struct v4l2_h264_weight_factors
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __s16
> + - ``luma_weight[32]``
> + -
> + * - __s16
> + - ``luma_offset[32]``
> + -
> + * - __s16
> + - ``chroma_weight[32][2]``
> + -
> + * - __s16
> + - ``chroma_offset[32][2]``
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS (struct)``
> + Specifies the decode parameters (as extracted from the bitstream)
> + for the associated H264 slice data. This includes the necessary
> + parameters for configuring a stateless hardware decoding pipeline
> + for H264. The bitstream parameters are defined according to
> + :ref:`h264`. For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_decode_params
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_decode_params
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u32
> + - ``num_slices``
> + - Number of slices needed to decode the current frame
> + * - __u32
> + - ``nal_ref_idc``
> + - NAL reference ID value coming from the NAL Unit header
> + * - __u8
> + - ``ref_pic_list_p0[32]``
> + - Backward reference list used by P-frames in the original bitstream order
> + * - __u8
> + - ``ref_pic_list_b0[32]``
> + - Backward reference list used by B-frames in the original bitstream order
> + * - __u8
> + - ``ref_pic_list_b1[32]``
> + - Forward reference list used by B-frames in the original bitstream order
> + * - __s32
> + - ``top_field_order_cnt``
> + - Picture Order Count for the coded top field
> + * - __s32
> + - ``bottom_field_order_cnt``
> + - Picture Order Count for the coded bottom field
> + * - __u32
> + - ``flags``
> + - See :ref:`Decode Parameters Flags <h264_decode_params_flags>`
> + * - struct :c:type:`v4l2_h264_dpb_entry`
> + - ``dpb[16]``
> + -
> +
> +.. _h264_decode_params_flags:
> +
> +``Decode Parameters Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC``
> + - 0x00000001
> + - That picture is an IDR picture
> +
> +.. c:type:: v4l2_h264_dpb_entry
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_h264_dpb_entry
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u64
> + - ``reference_ts``
> + - Timestamp of the V4L2 capture buffer to use as reference, used
> + with B-coded and P-coded frames. The timestamp refers to the
> + ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
> + :c:func:`v4l2_timeval_to_ns()` function to convert the struct
> + :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
> + * - __u16
> + - ``frame_num``
> + -
> + * - __u16
> + - ``pic_num``
> + -
> + * - __s32
> + - ``top_field_order_cnt``
> + -
> + * - __s32
> + - ``bottom_field_order_cnt``
> + -
> + * - __u32
> + - ``flags``
> + - See :ref:`DPB Entry Flags <h264_dpb_flags>`
> +
> +.. _h264_dpb_flags:
> +
> +``DPB Entries Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_DPB_ENTRY_FLAG_VALID``
> + - 0x00000001
> + - The DPB entry is valid and should be considered
> + * - ``V4L2_H264_DPB_ENTRY_FLAG_ACTIVE``
> + - 0x00000002
> + - The DPB entry is currently being used as a reference frame
> + * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM``
> + - 0x00000004
> + - The DPB entry is a long term reference frame
>
> .. _v4l2-mpeg-mpeg2:
>
> diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> index 6c961cfb74da..ea0a8a68759b 100644
> --- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> +++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> @@ -52,6 +52,25 @@ Compressed Formats
> - ``V4L2_PIX_FMT_H264_MVC``
> - 'M264'
> - H264 MVC video elementary stream.
> + * .. _V4L2-PIX-FMT-H264-SLICE:
Should be _V4L2-PIX-FMT-H264-SLICE-RAW.
> +
> + - ``V4L2_PIX_FMT_H264_SLICE_RAW``
> + - 'S264'
> + - H264 parsed slice data, as extracted from the H264 bitstream.
> + This format is adapted for stateless video decoders that
> + implement an H264 pipeline (using the :ref:`codec` and
codec is now mem2mem.
> + :ref:`media-request-api`). Metadata associated with the frame
> + to decode are required to be passed through the
> + ``V4L2_CID_MPEG_VIDEO_H264_SPS``,
> + ``V4L2_CID_MPEG_VIDEO_H264_PPS``,
> + ``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX``,
> + ``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS`` and
> + ``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS`` controls. See the
> + :ref:`associated Codec Control IDs <v4l2-mpeg-h264>`.
> + Exactly one output and one capture buffer must be provided for
> + use with this pixel format. The output buffer must contain the
> + appropriate number of macroblocks to decode a full
> + corresponding frame to the matching capture buffer.
> * .. _V4L2-PIX-FMT-H263:
>
> - ``V4L2_PIX_FMT_H263``
> diff --git a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> index f824162d0ea9..dc500632095d 100644
> --- a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> +++ b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> @@ -443,6 +443,36 @@ See also the examples in :ref:`control`.
> - n/a
> - A struct :c:type:`v4l2_ctrl_mpeg2_quantization`, containing MPEG-2
> quantization matrices for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_SPS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_sps`, containing H264
> + sequence parameters for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_PPS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_pps`, containing H264
> + picture parameters for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_scaling_matrix`, containing H264
> + scaling matrices for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_slice_params`, containing H264
> + slice parameters for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_decode_params`, containing H264
> + decode parameters for stateless video decoders.
>
> .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
>
> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
> index 64d348e67df9..55cbe324b9fc 100644
> --- a/Documentation/media/videodev2.h.rst.exceptions
> +++ b/Documentation/media/videodev2.h.rst.exceptions
> @@ -136,6 +136,11 @@ replace symbol V4L2_CTRL_TYPE_U32 :c:type:`v4l2_ctrl_type`
> replace symbol V4L2_CTRL_TYPE_U8 :c:type:`v4l2_ctrl_type`
> replace symbol V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS :c:type:`v4l2_ctrl_type`
> replace symbol V4L2_CTRL_TYPE_MPEG2_QUANTIZATION :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_SPS :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_PPS :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_SCALING_MATRIX :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_SLICE_PARAMS :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_DECODE_PARAMS :c:type:`v4l2_ctrl_type`
>
> # V4L2 capability defines
> replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index b1ae2e555c68..46aec8c3acde 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -828,6 +828,11 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
> return "H264 Constrained Intra Pred";
> case V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET: return "H264 Chroma QP Index Offset";
> + case V4L2_CID_MPEG_VIDEO_H264_SPS: return "H264 Sequence Parameter Set";
> + case V4L2_CID_MPEG_VIDEO_H264_PPS: return "H264 Picture Parameter Set";
> + case V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX: return "H264 Scaling Matrix";
> + case V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS: return "H264 Slice Parameters";
> + case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS: return "H264 Decode Parameters";
> case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP: return "MPEG4 I-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP: return "MPEG4 P-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP: return "MPEG4 B-Frame QP Value";
> @@ -1309,6 +1314,21 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
> case V4L2_CID_MPEG_VIDEO_FWHT_PARAMS:
> *type = V4L2_CTRL_TYPE_FWHT_PARAMS;
> break;
> + case V4L2_CID_MPEG_VIDEO_H264_SPS:
> + *type = V4L2_CTRL_TYPE_H264_SPS;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_PPS:
> + *type = V4L2_CTRL_TYPE_H264_PPS;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX:
> + *type = V4L2_CTRL_TYPE_H264_SCALING_MATRIX;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS:
> + *type = V4L2_CTRL_TYPE_H264_SLICE_PARAMS;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS:
> + *type = V4L2_CTRL_TYPE_H264_DECODE_PARAMS;
> + break;
> default:
> *type = V4L2_CTRL_TYPE_INTEGER;
> break;
> @@ -1678,6 +1698,13 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx,
> case V4L2_CTRL_TYPE_FWHT_PARAMS:
> return 0;
>
> + case V4L2_CTRL_TYPE_H264_SPS:
> + case V4L2_CTRL_TYPE_H264_PPS:
> + case V4L2_CTRL_TYPE_H264_SCALING_MATRIX:
> + case V4L2_CTRL_TYPE_H264_SLICE_PARAMS:
> + case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> + return 0;
> +
> default:
> return -EINVAL;
> }
> @@ -2261,6 +2288,21 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
> case V4L2_CTRL_TYPE_FWHT_PARAMS:
> elem_size = sizeof(struct v4l2_ctrl_fwht_params);
> break;
> + case V4L2_CTRL_TYPE_H264_SPS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_sps);
> + break;
> + case V4L2_CTRL_TYPE_H264_PPS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_pps);
> + break;
> + case V4L2_CTRL_TYPE_H264_SCALING_MATRIX:
> + elem_size = sizeof(struct v4l2_ctrl_h264_scaling_matrix);
> + break;
> + case V4L2_CTRL_TYPE_H264_SLICE_PARAMS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_slice_params);
> + break;
> + case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_decode_params);
> + break;
> default:
> if (type < V4L2_CTRL_COMPOUND_TYPES)
> elem_size = sizeof(s32);
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index ac87c3e37280..f6e1254064d2 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1325,6 +1325,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> case V4L2_PIX_FMT_H264: descr = "H.264"; break;
> case V4L2_PIX_FMT_H264_NO_SC: descr = "H.264 (No Start Codes)"; break;
> case V4L2_PIX_FMT_H264_MVC: descr = "H.264 MVC"; break;
> + case V4L2_PIX_FMT_H264_SLICE_RAW: descr = "H.264 Parsed Slice Data"; break;
> case V4L2_PIX_FMT_H263: descr = "H.263"; break;
> case V4L2_PIX_FMT_MPEG1: descr = "MPEG-1 ES"; break;
> case V4L2_PIX_FMT_MPEG2: descr = "MPEG-2 ES"; break;
> diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h
> new file mode 100644
> index 000000000000..e2f83b3cdbef
> --- /dev/null
> +++ b/include/media/h264-ctrls.h
> @@ -0,0 +1,192 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * These are the H.264 state controls for use with stateless H.264
> + * codec drivers.
> + *
> + * It turns out that these structs are not stable yet and will undergo
> + * more changes. So keep them private until they are stable and ready to
> + * become part of the official public API.
> + */
> +
> +#ifndef _H264_CTRLS_H_
> +#define _H264_CTRLS_H_
> +
> +/*
> + * This is put insanely high to avoid conflicting with controls that
> + * would be added during the phase where those controls are not
> + * stable. It should be fixed eventually.
> + */
> +#define V4L2_CID_MPEG_VIDEO_H264_SPS (V4L2_CID_MPEG_BASE+1000)
> +#define V4L2_CID_MPEG_VIDEO_H264_PPS (V4L2_CID_MPEG_BASE+1001)
> +#define V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX (V4L2_CID_MPEG_BASE+1002)
> +#define V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS (V4L2_CID_MPEG_BASE+1003)
> +#define V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS (V4L2_CID_MPEG_BASE+1004)
> +
> +/* enum v4l2_ctrl_type type values */
> +#define V4L2_CTRL_TYPE_H264_SPS 0x0110
> +#define V4L2_CTRL_TYPE_H264_PPS 0x0111
> +#define V4L2_CTRL_TYPE_H264_SCALING_MATRIX 0x0112
> +#define V4L2_CTRL_TYPE_H264_SLICE_PARAMS 0x0113
> +#define V4L2_CTRL_TYPE_H264_DECODE_PARAMS 0x0114
> +
> +#define V4L2_H264_SPS_CONSTRAINT_SET0_FLAG 0x01
> +#define V4L2_H264_SPS_CONSTRAINT_SET1_FLAG 0x02
> +#define V4L2_H264_SPS_CONSTRAINT_SET2_FLAG 0x04
> +#define V4L2_H264_SPS_CONSTRAINT_SET3_FLAG 0x08
> +#define V4L2_H264_SPS_CONSTRAINT_SET4_FLAG 0x10
> +#define V4L2_H264_SPS_CONSTRAINT_SET5_FLAG 0x20
> +
> +#define V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE 0x01
> +#define V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS 0x02
> +#define V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO 0x04
> +#define V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED 0x08
> +#define V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY 0x10
> +#define V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD 0x20
> +#define V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE 0x40
> +
> +struct v4l2_ctrl_h264_sps {
> + __u8 profile_idc;
> + __u8 constraint_set_flags;
> + __u8 level_idc;
> + __u8 seq_parameter_set_id;
> + __u8 chroma_format_idc;
> + __u8 bit_depth_luma_minus8;
> + __u8 bit_depth_chroma_minus8;
> + __u8 log2_max_frame_num_minus4;
> + __u8 pic_order_cnt_type;
> + __u8 log2_max_pic_order_cnt_lsb_minus4;
> + __u8 max_num_ref_frames;
> + __u8 num_ref_frames_in_pic_order_cnt_cycle;
> + __s32 offset_for_ref_frame[255];
> + __s32 offset_for_non_ref_pic;
> + __s32 offset_for_top_to_bottom_field;
> + __u16 pic_width_in_mbs_minus1;
> + __u16 pic_height_in_map_units_minus1;
> + __u32 flags;
> +};
> +
> +#define V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE 0x0001
> +#define V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT 0x0002
> +#define V4L2_H264_PPS_FLAG_WEIGHTED_PRED 0x0004
> +#define V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT 0x0008
> +#define V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED 0x0010
> +#define V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT 0x0020
> +#define V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE 0x0040
> +#define V4L2_H264_PPS_FLAG_PIC_SCALING_MATRIX_PRESENT 0x0080
> +
> +struct v4l2_ctrl_h264_pps {
> + __u8 pic_parameter_set_id;
> + __u8 seq_parameter_set_id;
> + __u8 num_slice_groups_minus1;
> + __u8 num_ref_idx_l0_default_active_minus1;
> + __u8 num_ref_idx_l1_default_active_minus1;
> + __u8 weighted_bipred_idc;
> + __s8 pic_init_qp_minus26;
> + __s8 pic_init_qs_minus26;
> + __s8 chroma_qp_index_offset;
> + __s8 second_chroma_qp_index_offset;
> + __u16 flags;
> +};
> +
> +struct v4l2_ctrl_h264_scaling_matrix {
> + __u8 scaling_list_4x4[6][16];
> + __u8 scaling_list_8x8[6][64];
> +};
> +
> +struct v4l2_h264_weight_factors {
> + __s16 luma_weight[32];
> + __s16 luma_offset[32];
> + __s16 chroma_weight[32][2];
> + __s16 chroma_offset[32][2];
> +};
> +
> +struct v4l2_h264_pred_weight_table {
> + __u16 luma_log2_weight_denom;
> + __u16 chroma_log2_weight_denom;
> + struct v4l2_h264_weight_factors weight_factors[2];
> +};
> +
> +#define V4L2_H264_SLICE_TYPE_P 0
> +#define V4L2_H264_SLICE_TYPE_B 1
> +#define V4L2_H264_SLICE_TYPE_I 2
> +#define V4L2_H264_SLICE_TYPE_SP 3
> +#define V4L2_H264_SLICE_TYPE_SI 4
> +
> +#define V4L2_H264_SLICE_FLAG_FIELD_PIC 0x01
> +#define V4L2_H264_SLICE_FLAG_BOTTOM_FIELD 0x02
> +#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x04
> +#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x08
> +
> +struct v4l2_ctrl_h264_slice_params {
> + /* Size in bytes, including header */
> + __u32 size;
> + /* Offset in bits to slice_data() from the beginning of this slice. */
> + __u32 header_bit_size;
> +
> + __u16 first_mb_in_slice;
> + __u8 slice_type;
> + __u8 pic_parameter_set_id;
> + __u8 colour_plane_id;
> + __u8 redundant_pic_cnt;
> + __u16 frame_num;
> + __u16 idr_pic_id;
> + __u16 pic_order_cnt_lsb;
> + __s32 delta_pic_order_cnt_bottom;
> + __s32 delta_pic_order_cnt0;
> + __s32 delta_pic_order_cnt1;
> +
> + struct v4l2_h264_pred_weight_table pred_weight_table;
> + /* Size in bits of dec_ref_pic_marking() syntax element. */
> + __u32 dec_ref_pic_marking_bit_size;
> + /* Size in bits of pic order count syntax. */
> + __u32 pic_order_cnt_bit_size;
> +
> + __u8 cabac_init_idc;
> + __s8 slice_qp_delta;
> + __s8 slice_qs_delta;
> + __u8 disable_deblocking_filter_idc;
> + __s8 slice_alpha_c0_offset_div2;
> + __s8 slice_beta_offset_div2;
> + __u8 num_ref_idx_l0_active_minus1;
> + __u8 num_ref_idx_l1_active_minus1;
> + __u32 slice_group_change_cycle;
> +
> + /*
> + * Entries on each list are indices into
> + * v4l2_ctrl_h264_decode_params.dpb[].
> + */
> + __u8 ref_pic_list0[32];
> + __u8 ref_pic_list1[32];
> +
> + __u32 flags;
> +};
> +
> +#define V4L2_H264_DPB_ENTRY_FLAG_VALID 0x01
> +#define V4L2_H264_DPB_ENTRY_FLAG_ACTIVE 0x02
> +#define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM 0x04
> +
> +struct v4l2_h264_dpb_entry {
> + __u64 reference_ts;
> + __u16 frame_num;
> + __u16 pic_num;
> + /* Note that field is indicated by v4l2_buffer.field */
> + __s32 top_field_order_cnt;
> + __s32 bottom_field_order_cnt;
> + __u32 flags; /* V4L2_H264_DPB_ENTRY_FLAG_* */
> +};
> +
> +#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
> +
> +struct v4l2_ctrl_h264_decode_params {
> + struct v4l2_h264_dpb_entry dpb[16];
> + __u16 num_slices;
> + __u16 nal_ref_idc;
> + __u8 ref_pic_list_p0[32];
> + __u8 ref_pic_list_b0[32];
> + __u8 ref_pic_list_b1[32];
> + __s32 top_field_order_cnt;
> + __s32 bottom_field_order_cnt;
> + __u32 flags; /* V4L2_H264_DECODE_PARAM_FLAG_* */
> +};
> +
> +#endif
> diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
> index bd621cec65a5..dce6f33fd749 100644
> --- a/include/media/v4l2-ctrls.h
> +++ b/include/media/v4l2-ctrls.h
> @@ -23,11 +23,12 @@
> #include <media/media-request.h>
>
> /*
> - * Include the mpeg2 and fwht stateless codec compound control definitions.
> + * Include the stateless codec compound control definitions.
> * This will move to the public headers once this API is fully stable.
> */
> #include <media/mpeg2-ctrls.h>
> #include <media/fwht-ctrls.h>
> +#include <media/h264-ctrls.h>
>
> /* forward references */
> struct file;
> @@ -51,6 +52,11 @@ struct poll_table_struct;
> * @p_mpeg2_slice_params: Pointer to a MPEG2 slice parameters structure.
> * @p_mpeg2_quantization: Pointer to a MPEG2 quantization data structure.
> * @p_fwht_params: Pointer to a FWHT stateless parameters structure.
> + * @p_h264_sps: Pointer to a struct v4l2_ctrl_h264_sps.
> + * @p_h264_pps: Pointer to a struct v4l2_ctrl_h264_pps.
> + * @p_h264_scaling_matrix: Pointer to a struct v4l2_ctrl_h264_scaling_matrix.
> + * @p_h264_slice_param: Pointer to a struct v4l2_ctrl_h264_slice_params.
> + * @p_h264_decode_param: Pointer to a struct v4l2_ctrl_h264_decode_params.
p_h264_slice_param -> p_h264_slice_params
p_h264_decode_param -> p_h264_decode_params
> * @p: Pointer to a compound value.
> */
> union v4l2_ctrl_ptr {
> @@ -63,6 +69,11 @@ union v4l2_ctrl_ptr {
> struct v4l2_ctrl_mpeg2_slice_params *p_mpeg2_slice_params;
> struct v4l2_ctrl_mpeg2_quantization *p_mpeg2_quantization;
> struct v4l2_ctrl_fwht_params *p_fwht_params;
> + struct v4l2_ctrl_h264_sps *p_h264_sps;
> + struct v4l2_ctrl_h264_pps *p_h264_pps;
> + struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
> + struct v4l2_ctrl_h264_slice_params *p_h264_slice_param;
> + struct v4l2_ctrl_h264_decode_params *p_h264_decode_param;
Ditto.
Regards,
Hans
> void *p;
> };
>
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 496e6453450c..838732acdefc 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -657,6 +657,7 @@ struct v4l2_pix_format {
> #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
> #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
> #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
> +#define V4L2_PIX_FMT_H264_SLICE_RAW v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
> #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
> #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
> #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 20/29] drm/i915: Split engine setup/init into two phases
From: Tvrtko Ursulin @ 2019-04-10 13:30 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
In-Reply-To: <20190408091728.20207-20-chris@chris-wilson.co.uk>
On 08/04/2019 10:17, Chris Wilson wrote:
> In the next patch, we require the engine vfuncs setup prior to
> initialising the pinned kernel contexts, so split the vfunc setup from
> the engine initialisation and call it earlier.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/gt/intel_engine.h | 8 +-
> drivers/gpu/drm/i915/gt/intel_engine_cs.c | 99 ++++----
> drivers/gpu/drm/i915/gt/intel_lrc.c | 74 ++----
> drivers/gpu/drm/i915/gt/intel_lrc.h | 5 +-
> drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 232 +++++++++---------
> drivers/gpu/drm/i915/gt/intel_workarounds.c | 3 +-
> drivers/gpu/drm/i915/gt/mock_engine.c | 48 ++--
> drivers/gpu/drm/i915/gt/mock_engine.h | 2 +
> drivers/gpu/drm/i915/i915_gem.c | 6 +
> .../gpu/drm/i915/selftests/mock_gem_device.c | 12 +-
> 10 files changed, 245 insertions(+), 244 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine.h b/drivers/gpu/drm/i915/gt/intel_engine.h
> index a17152e96bf8..a8dc2740ba2f 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine.h
> +++ b/drivers/gpu/drm/i915/gt/intel_engine.h
> @@ -362,14 +362,12 @@ __intel_ring_space(unsigned int head, unsigned int tail, unsigned int size)
> return (head - tail - CACHELINE_BYTES) & (size - 1);
> }
>
> -int intel_engine_setup_common(struct intel_engine_cs *engine);
> +int intel_engines_setup(struct drm_i915_private *i915);
> int intel_engine_init_common(struct intel_engine_cs *engine);
> void intel_engine_cleanup_common(struct intel_engine_cs *engine);
>
> -int intel_init_render_ring_buffer(struct intel_engine_cs *engine);
> -int intel_init_bsd_ring_buffer(struct intel_engine_cs *engine);
> -int intel_init_blt_ring_buffer(struct intel_engine_cs *engine);
> -int intel_init_vebox_ring_buffer(struct intel_engine_cs *engine);
> +int intel_ring_submission_setup(struct intel_engine_cs *engine);
> +int intel_ring_submission_init(struct intel_engine_cs *engine);
>
> int intel_engine_stop_cs(struct intel_engine_cs *engine);
> void intel_engine_cancel_stop_cs(struct intel_engine_cs *engine);
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index f6828c0276eb..3f794bc71958 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -50,35 +50,24 @@
>
> struct engine_class_info {
> const char *name;
> - int (*init_legacy)(struct intel_engine_cs *engine);
> - int (*init_execlists)(struct intel_engine_cs *engine);
> -
> u8 uabi_class;
> };
>
> static const struct engine_class_info intel_engine_classes[] = {
> [RENDER_CLASS] = {
> .name = "rcs",
> - .init_execlists = logical_render_ring_init,
> - .init_legacy = intel_init_render_ring_buffer,
> .uabi_class = I915_ENGINE_CLASS_RENDER,
> },
> [COPY_ENGINE_CLASS] = {
> .name = "bcs",
> - .init_execlists = logical_xcs_ring_init,
> - .init_legacy = intel_init_blt_ring_buffer,
> .uabi_class = I915_ENGINE_CLASS_COPY,
> },
> [VIDEO_DECODE_CLASS] = {
> .name = "vcs",
> - .init_execlists = logical_xcs_ring_init,
> - .init_legacy = intel_init_bsd_ring_buffer,
> .uabi_class = I915_ENGINE_CLASS_VIDEO,
> },
> [VIDEO_ENHANCEMENT_CLASS] = {
> .name = "vecs",
> - .init_execlists = logical_xcs_ring_init,
> - .init_legacy = intel_init_vebox_ring_buffer,
> .uabi_class = I915_ENGINE_CLASS_VIDEO_ENHANCE,
> },
> };
> @@ -400,48 +389,39 @@ int intel_engines_init_mmio(struct drm_i915_private *dev_priv)
>
> /**
> * intel_engines_init() - init the Engine Command Streamers
> - * @dev_priv: i915 device private
> + * @i915: i915 device private
> *
> * Return: non-zero if the initialization failed.
> */
> -int intel_engines_init(struct drm_i915_private *dev_priv)
> +int intel_engines_init(struct drm_i915_private *i915)
> {
> + int (*init)(struct intel_engine_cs *engine);
> struct intel_engine_cs *engine;
> enum intel_engine_id id, err_id;
> int err;
>
> - for_each_engine(engine, dev_priv, id) {
> - const struct engine_class_info *class_info =
> - &intel_engine_classes[engine->class];
> - int (*init)(struct intel_engine_cs *engine);
> -
> - if (HAS_EXECLISTS(dev_priv))
> - init = class_info->init_execlists;
> - else
> - init = class_info->init_legacy;
> + if (HAS_EXECLISTS(i915))
> + init = intel_execlists_submission_init;
> + else
> + init = intel_ring_submission_init;
>
> - err = -EINVAL;
> + for_each_engine(engine, i915, id) {
> err_id = id;
>
> - if (GEM_DEBUG_WARN_ON(!init))
> - goto cleanup;
> -
> err = init(engine);
> if (err)
> goto cleanup;
> -
> - GEM_BUG_ON(!engine->submit_request);
> }
>
> return 0;
>
> cleanup:
> - for_each_engine(engine, dev_priv, id) {
> + for_each_engine(engine, i915, id) {
> if (id >= err_id) {
> kfree(engine);
> - dev_priv->engine[id] = NULL;
> + i915->engine[id] = NULL;
> } else {
> - dev_priv->gt.cleanup_engine(engine);
> + i915->gt.cleanup_engine(engine);
> }
> }
> return err;
> @@ -559,16 +539,7 @@ static int init_status_page(struct intel_engine_cs *engine)
> return ret;
> }
>
> -/**
> - * intel_engines_setup_common - setup engine state not requiring hw access
> - * @engine: Engine to setup.
> - *
> - * Initializes @engine@ structure members shared between legacy and execlists
> - * submission modes which do not require hardware access.
> - *
> - * Typically done early in the submission mode specific engine setup stage.
> - */
> -int intel_engine_setup_common(struct intel_engine_cs *engine)
> +static int intel_engine_setup_common(struct intel_engine_cs *engine)
> {
> int err;
>
> @@ -602,6 +573,52 @@ int intel_engine_setup_common(struct intel_engine_cs *engine)
> return err;
> }
>
> +/**
> + * intel_engines_setup- setup engine state not requiring hw access
> + * @i915: Device to setup.
> + *
> + * Initializes engine structure members shared between legacy and execlists
> + * submission modes which do not require hardware access.
> + *
> + * Typically done early in the submission mode specific engine setup stage.
> + */
> +int intel_engines_setup(struct drm_i915_private *i915)
> +{
> + int (*setup)(struct intel_engine_cs *engine);
> + struct intel_engine_cs *engine;
> + enum intel_engine_id id;
> + int err;
> +
> + if (HAS_EXECLISTS(i915))
> + setup = intel_execlists_submission_setup;
> + else
> + setup = intel_ring_submission_setup;
> +
> + for_each_engine(engine, i915, id) {
> + err = intel_engine_setup_common(engine);
> + if (err)
> + goto cleanup;
> +
> + err = setup(engine);
> + if (err)
> + goto cleanup;
> +
> + GEM_BUG_ON(!engine->cops);
> + }
> +
> + return 0;
> +
> +cleanup:
> + for_each_engine(engine, i915, id) {
> + if (engine->cops)
> + i915->gt.cleanup_engine(engine);
> + else
> + kfree(engine);
> + i915->engine[id] = NULL;
> + }
> + return err;
> +}
> +
> void intel_engines_set_scheduler_caps(struct drm_i915_private *i915)
> {
> static const struct {
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 7a5e6e962e61..d4e28fbb5dcd 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -1786,8 +1786,8 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
> unsigned int i;
> int ret;
>
> - if (GEM_DEBUG_WARN_ON(engine->id != RCS0))
> - return -EINVAL;
> + if (engine->class != RENDER_CLASS)
> + return 0;
>
> switch (INTEL_GEN(engine->i915)) {
> case 11:
> @@ -2423,15 +2423,8 @@ logical_ring_default_irqs(struct intel_engine_cs *engine)
> engine->irq_keep_mask = GT_CONTEXT_SWITCH_INTERRUPT << shift;
> }
>
> -static int
> -logical_ring_setup(struct intel_engine_cs *engine)
> +int intel_execlists_submission_setup(struct intel_engine_cs *engine)
> {
> - int err;
> -
> - err = intel_engine_setup_common(engine);
> - if (err)
> - return err;
> -
> /* Intentionally left blank. */
> engine->buffer = NULL;
>
> @@ -2441,10 +2434,16 @@ logical_ring_setup(struct intel_engine_cs *engine)
> logical_ring_default_vfuncs(engine);
> logical_ring_default_irqs(engine);
>
> + if (engine->class == RENDER_CLASS) {
> + engine->init_context = gen8_init_rcs_context;
> + engine->emit_flush = gen8_emit_flush_render;
> + engine->emit_fini_breadcrumb = gen8_emit_fini_breadcrumb_rcs;
> + }
> +
> return 0;
> }
>
> -static int logical_ring_init(struct intel_engine_cs *engine)
> +int intel_execlists_submission_init(struct intel_engine_cs *engine)
> {
> struct drm_i915_private *i915 = engine->i915;
> struct intel_engine_execlists * const execlists = &engine->execlists;
> @@ -2456,6 +2455,15 @@ static int logical_ring_init(struct intel_engine_cs *engine)
> return ret;
>
> intel_engine_init_workarounds(engine);
> + intel_engine_init_whitelist(engine);
> +
> + if (intel_init_workaround_bb(engine))
> + /*
> + * We continue even if we fail to initialize WA batch
> + * because we only expect rare glitches but nothing
> + * critical to prevent us from using GPU
> + */
> + DRM_ERROR("WA batch buffer initialization failed\n");
>
> if (HAS_LOGICAL_RING_ELSQ(i915)) {
> execlists->submit_reg = i915->uncore.regs +
> @@ -2483,50 +2491,6 @@ static int logical_ring_init(struct intel_engine_cs *engine)
> return 0;
> }
>
> -int logical_render_ring_init(struct intel_engine_cs *engine)
> -{
> - int ret;
> -
> - ret = logical_ring_setup(engine);
> - if (ret)
> - return ret;
> -
> - /* Override some for render ring. */
> - engine->init_context = gen8_init_rcs_context;
> - engine->emit_flush = gen8_emit_flush_render;
> - engine->emit_fini_breadcrumb = gen8_emit_fini_breadcrumb_rcs;
> -
> - ret = logical_ring_init(engine);
> - if (ret)
> - return ret;
> -
> - ret = intel_init_workaround_bb(engine);
> - if (ret) {
> - /*
> - * We continue even if we fail to initialize WA batch
> - * because we only expect rare glitches but nothing
> - * critical to prevent us from using GPU
> - */
> - DRM_ERROR("WA batch buffer initialization failed: %d\n",
> - ret);
> - }
> -
> - intel_engine_init_whitelist(engine);
> -
> - return 0;
> -}
> -
> -int logical_xcs_ring_init(struct intel_engine_cs *engine)
> -{
> - int err;
> -
> - err = logical_ring_setup(engine);
> - if (err)
> - return err;
> -
> - return logical_ring_init(engine);
> -}
> -
> static u32 intel_lr_indirect_ctx_offset(struct intel_engine_cs *engine)
> {
> u32 indirect_ctx_offset;
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.h b/drivers/gpu/drm/i915/gt/intel_lrc.h
> index a598f2d56de3..a56ee45b9e3c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.h
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.h
> @@ -67,8 +67,9 @@ enum {
>
> /* Logical Rings */
> void intel_logical_ring_cleanup(struct intel_engine_cs *engine);
> -int logical_render_ring_init(struct intel_engine_cs *engine);
> -int logical_xcs_ring_init(struct intel_engine_cs *engine);
> +
> +int intel_execlists_submission_setup(struct intel_engine_cs *engine);
> +int intel_execlists_submission_init(struct intel_engine_cs *engine);
>
> /* Logical Ring Contexts */
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ringbuffer.c b/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
> index 748c133b83b4..3204dbb541f6 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
> @@ -1523,54 +1523,6 @@ static const struct intel_context_ops ring_context_ops = {
> .destroy = ring_context_destroy,
> };
>
> -static int intel_init_ring_buffer(struct intel_engine_cs *engine)
> -{
> - struct i915_timeline *timeline;
> - struct intel_ring *ring;
> - int err;
> -
> - err = intel_engine_setup_common(engine);
> - if (err)
> - return err;
> -
> - timeline = i915_timeline_create(engine->i915, engine->status_page.vma);
> - if (IS_ERR(timeline)) {
> - err = PTR_ERR(timeline);
> - goto err;
> - }
> - GEM_BUG_ON(timeline->has_initial_breadcrumb);
> -
> - ring = intel_engine_create_ring(engine, timeline, 32 * PAGE_SIZE);
> - i915_timeline_put(timeline);
> - if (IS_ERR(ring)) {
> - err = PTR_ERR(ring);
> - goto err;
> - }
> -
> - err = intel_ring_pin(ring);
> - if (err)
> - goto err_ring;
> -
> - GEM_BUG_ON(engine->buffer);
> - engine->buffer = ring;
> -
> - err = intel_engine_init_common(engine);
> - if (err)
> - goto err_unpin;
> -
> - GEM_BUG_ON(ring->timeline->hwsp_ggtt != engine->status_page.vma);
> -
> - return 0;
> -
> -err_unpin:
> - intel_ring_unpin(ring);
> -err_ring:
> - intel_ring_put(ring);
> -err:
> - intel_engine_cleanup_common(engine);
> - return err;
> -}
> -
> void intel_engine_cleanup(struct intel_engine_cs *engine)
> {
> struct drm_i915_private *dev_priv = engine->i915;
> @@ -2166,24 +2118,6 @@ static int gen6_ring_flush(struct i915_request *rq, u32 mode)
> return gen6_flush_dw(rq, mode, MI_INVALIDATE_TLB);
> }
>
> -static void intel_ring_init_irq(struct drm_i915_private *dev_priv,
> - struct intel_engine_cs *engine)
> -{
> - if (INTEL_GEN(dev_priv) >= 6) {
> - engine->irq_enable = gen6_irq_enable;
> - engine->irq_disable = gen6_irq_disable;
> - } else if (INTEL_GEN(dev_priv) >= 5) {
> - engine->irq_enable = gen5_irq_enable;
> - engine->irq_disable = gen5_irq_disable;
> - } else if (INTEL_GEN(dev_priv) >= 3) {
> - engine->irq_enable = i9xx_irq_enable;
> - engine->irq_disable = i9xx_irq_disable;
> - } else {
> - engine->irq_enable = i8xx_irq_enable;
> - engine->irq_disable = i8xx_irq_disable;
> - }
> -}
> -
> static void i9xx_set_default_submission(struct intel_engine_cs *engine)
> {
> engine->submit_request = i9xx_submit_request;
> @@ -2199,13 +2133,33 @@ static void gen6_bsd_set_default_submission(struct intel_engine_cs *engine)
> engine->submit_request = gen6_bsd_submit_request;
> }
>
> -static void intel_ring_default_vfuncs(struct drm_i915_private *dev_priv,
> - struct intel_engine_cs *engine)
> +static void setup_irq(struct intel_engine_cs *engine)
> +{
> + struct drm_i915_private *i915 = engine->i915;
> +
> + if (INTEL_GEN(i915) >= 6) {
> + engine->irq_enable = gen6_irq_enable;
> + engine->irq_disable = gen6_irq_disable;
> + } else if (INTEL_GEN(i915) >= 5) {
> + engine->irq_enable = gen5_irq_enable;
> + engine->irq_disable = gen5_irq_disable;
> + } else if (INTEL_GEN(i915) >= 3) {
> + engine->irq_enable = i9xx_irq_enable;
> + engine->irq_disable = i9xx_irq_disable;
> + } else {
> + engine->irq_enable = i8xx_irq_enable;
> + engine->irq_disable = i8xx_irq_disable;
> + }
> +}
> +
> +static void setup_xcs(struct intel_engine_cs *engine)
> {
> + struct drm_i915_private *i915 = engine->i915;
> +
> /* gen8+ are only supported with execlists */
> - GEM_BUG_ON(INTEL_GEN(dev_priv) >= 8);
> + GEM_BUG_ON(INTEL_GEN(i915) >= 8);
>
> - intel_ring_init_irq(dev_priv, engine);
> + setup_irq(engine);
>
> engine->resume = xcs_resume;
> engine->reset.prepare = reset_prepare;
> @@ -2221,117 +2175,96 @@ static void intel_ring_default_vfuncs(struct drm_i915_private *dev_priv,
> * engine->emit_init_breadcrumb().
> */
> engine->emit_fini_breadcrumb = i9xx_emit_breadcrumb;
> - if (IS_GEN(dev_priv, 5))
> + if (IS_GEN(i915, 5))
> engine->emit_fini_breadcrumb = gen5_emit_breadcrumb;
>
> engine->set_default_submission = i9xx_set_default_submission;
>
> - if (INTEL_GEN(dev_priv) >= 6)
> + if (INTEL_GEN(i915) >= 6)
> engine->emit_bb_start = gen6_emit_bb_start;
> - else if (INTEL_GEN(dev_priv) >= 4)
> + else if (INTEL_GEN(i915) >= 4)
> engine->emit_bb_start = i965_emit_bb_start;
> - else if (IS_I830(dev_priv) || IS_I845G(dev_priv))
> + else if (IS_I830(i915) || IS_I845G(i915))
> engine->emit_bb_start = i830_emit_bb_start;
> else
> engine->emit_bb_start = i915_emit_bb_start;
> }
>
> -int intel_init_render_ring_buffer(struct intel_engine_cs *engine)
> +static void setup_rcs(struct intel_engine_cs *engine)
> {
> - struct drm_i915_private *dev_priv = engine->i915;
> - int ret;
> -
> - intel_ring_default_vfuncs(dev_priv, engine);
> + struct drm_i915_private *i915 = engine->i915;
>
> - if (HAS_L3_DPF(dev_priv))
> + if (HAS_L3_DPF(i915))
> engine->irq_keep_mask = GT_RENDER_L3_PARITY_ERROR_INTERRUPT;
>
> engine->irq_enable_mask = GT_RENDER_USER_INTERRUPT;
>
> - if (INTEL_GEN(dev_priv) >= 7) {
> + if (INTEL_GEN(i915) >= 7) {
> engine->init_context = intel_rcs_ctx_init;
> engine->emit_flush = gen7_render_ring_flush;
> engine->emit_fini_breadcrumb = gen7_rcs_emit_breadcrumb;
> - } else if (IS_GEN(dev_priv, 6)) {
> + } else if (IS_GEN(i915, 6)) {
> engine->init_context = intel_rcs_ctx_init;
> engine->emit_flush = gen6_render_ring_flush;
> engine->emit_fini_breadcrumb = gen6_rcs_emit_breadcrumb;
> - } else if (IS_GEN(dev_priv, 5)) {
> + } else if (IS_GEN(i915, 5)) {
> engine->emit_flush = gen4_render_ring_flush;
> } else {
> - if (INTEL_GEN(dev_priv) < 4)
> + if (INTEL_GEN(i915) < 4)
> engine->emit_flush = gen2_render_ring_flush;
> else
> engine->emit_flush = gen4_render_ring_flush;
> engine->irq_enable_mask = I915_USER_INTERRUPT;
> }
>
> - if (IS_HASWELL(dev_priv))
> + if (IS_HASWELL(i915))
> engine->emit_bb_start = hsw_emit_bb_start;
>
> engine->resume = rcs_resume;
> -
> - ret = intel_init_ring_buffer(engine);
> - if (ret)
> - return ret;
> -
> - return 0;
> }
>
> -int intel_init_bsd_ring_buffer(struct intel_engine_cs *engine)
> +static void setup_vcs(struct intel_engine_cs *engine)
> {
> - struct drm_i915_private *dev_priv = engine->i915;
> -
> - intel_ring_default_vfuncs(dev_priv, engine);
> + struct drm_i915_private *i915 = engine->i915;
>
> - if (INTEL_GEN(dev_priv) >= 6) {
> + if (INTEL_GEN(i915) >= 6) {
> /* gen6 bsd needs a special wa for tail updates */
> - if (IS_GEN(dev_priv, 6))
> + if (IS_GEN(i915, 6))
> engine->set_default_submission = gen6_bsd_set_default_submission;
> engine->emit_flush = gen6_bsd_ring_flush;
> engine->irq_enable_mask = GT_BSD_USER_INTERRUPT;
>
> - if (IS_GEN(dev_priv, 6))
> + if (IS_GEN(i915, 6))
> engine->emit_fini_breadcrumb = gen6_xcs_emit_breadcrumb;
> else
> engine->emit_fini_breadcrumb = gen7_xcs_emit_breadcrumb;
> } else {
> engine->emit_flush = bsd_ring_flush;
> - if (IS_GEN(dev_priv, 5))
> + if (IS_GEN(i915, 5))
> engine->irq_enable_mask = ILK_BSD_USER_INTERRUPT;
> else
> engine->irq_enable_mask = I915_BSD_USER_INTERRUPT;
> }
> -
> - return intel_init_ring_buffer(engine);
> }
>
> -int intel_init_blt_ring_buffer(struct intel_engine_cs *engine)
> +static void setup_bcs(struct intel_engine_cs *engine)
> {
> - struct drm_i915_private *dev_priv = engine->i915;
> -
> - GEM_BUG_ON(INTEL_GEN(dev_priv) < 6);
> -
> - intel_ring_default_vfuncs(dev_priv, engine);
> + struct drm_i915_private *i915 = engine->i915;
>
> engine->emit_flush = gen6_ring_flush;
> engine->irq_enable_mask = GT_BLT_USER_INTERRUPT;
>
> - if (IS_GEN(dev_priv, 6))
> + if (IS_GEN(i915, 6))
> engine->emit_fini_breadcrumb = gen6_xcs_emit_breadcrumb;
> else
> engine->emit_fini_breadcrumb = gen7_xcs_emit_breadcrumb;
> -
> - return intel_init_ring_buffer(engine);
> }
>
> -int intel_init_vebox_ring_buffer(struct intel_engine_cs *engine)
> +static void setup_vecs(struct intel_engine_cs *engine)
> {
> - struct drm_i915_private *dev_priv = engine->i915;
> -
> - GEM_BUG_ON(INTEL_GEN(dev_priv) < 7);
> + struct drm_i915_private *i915 = engine->i915;
>
> - intel_ring_default_vfuncs(dev_priv, engine);
> + GEM_BUG_ON(INTEL_GEN(i915) < 7);
>
> engine->emit_flush = gen6_ring_flush;
> engine->irq_enable_mask = PM_VEBOX_USER_INTERRUPT;
> @@ -2339,6 +2272,73 @@ int intel_init_vebox_ring_buffer(struct intel_engine_cs *engine)
> engine->irq_disable = hsw_vebox_irq_disable;
>
> engine->emit_fini_breadcrumb = gen7_xcs_emit_breadcrumb;
> +}
> +
> +int intel_ring_submission_setup(struct intel_engine_cs *engine)
> +{
> + setup_xcs(engine);
It is actually setup_common, no? I think it would be clearer since we
use to have xcs mean !rcs.
> +
> + switch (engine->class) {
> + case RENDER_CLASS:
> + setup_rcs(engine);
> + break;
> + case VIDEO_DECODE_CLASS:
> + setup_vcs(engine);
> + break;
> + case COPY_ENGINE_CLASS:
> + setup_bcs(engine);
> + break;
> + case VIDEO_ENHANCEMENT_CLASS:
> + setup_vecs(engine);
> + break;
> + default:
> + MISSING_CASE(engine->class);
> + return -ENODEV;
> + }
> +
> + return 0;
> +}
> +
> +int intel_ring_submission_init(struct intel_engine_cs *engine)
> +{
> + struct i915_timeline *timeline;
> + struct intel_ring *ring;
> + int err;
> +
> + timeline = i915_timeline_create(engine->i915, engine->status_page.vma);
> + if (IS_ERR(timeline)) {
> + err = PTR_ERR(timeline);
> + goto err;
> + }
> + GEM_BUG_ON(timeline->has_initial_breadcrumb);
> +
> + ring = intel_engine_create_ring(engine, timeline, 32 * PAGE_SIZE);
> + i915_timeline_put(timeline);
> + if (IS_ERR(ring)) {
> + err = PTR_ERR(ring);
> + goto err;
> + }
> +
> + err = intel_ring_pin(ring);
> + if (err)
> + goto err_ring;
>
> - return intel_init_ring_buffer(engine);
> + GEM_BUG_ON(engine->buffer);
> + engine->buffer = ring;
> +
> + err = intel_engine_init_common(engine);
> + if (err)
> + goto err_unpin;
> +
> + GEM_BUG_ON(ring->timeline->hwsp_ggtt != engine->status_page.vma);
> +
> + return 0;
> +
> +err_unpin:
> + intel_ring_unpin(ring);
> +err_ring:
> + intel_ring_put(ring);
> +err:
> + intel_engine_cleanup_common(engine);
> + return err;
> }
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index 2d6d17ee3601..e9d8174b24e8 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -1060,7 +1060,8 @@ void intel_engine_init_whitelist(struct intel_engine_cs *engine)
> struct drm_i915_private *i915 = engine->i915;
> struct i915_wa_list *w = &engine->whitelist;
>
> - GEM_BUG_ON(engine->id != RCS0);
> + if (engine->class != RENDER_CLASS)
> + return;
>
> wa_init_start(w, "whitelist");
>
> diff --git a/drivers/gpu/drm/i915/gt/mock_engine.c b/drivers/gpu/drm/i915/gt/mock_engine.c
> index a79d9909d171..3b672e011cf0 100644
> --- a/drivers/gpu/drm/i915/gt/mock_engine.c
> +++ b/drivers/gpu/drm/i915/gt/mock_engine.c
> @@ -239,7 +239,6 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
> int id)
> {
> struct mock_engine *engine;
> - int err;
>
> GEM_BUG_ON(id >= I915_NUM_ENGINES);
>
> @@ -265,37 +264,44 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
> engine->base.reset.finish = mock_reset_finish;
> engine->base.cancel_requests = mock_cancel_requests;
>
> - if (i915_timeline_init(i915, &engine->base.timeline, NULL))
> - goto err_free;
> - i915_timeline_set_subclass(&engine->base.timeline, TIMELINE_ENGINE);
> -
> - intel_engine_init_breadcrumbs(&engine->base);
> - intel_engine_init_execlists(&engine->base);
> - intel_engine_init__pm(&engine->base);
> -
> /* fake hw queue */
> spin_lock_init(&engine->hw_lock);
> timer_setup(&engine->hw_delay, hw_delay_complete, 0);
> INIT_LIST_HEAD(&engine->hw_queue);
>
> - engine->base.kernel_context =
> - intel_context_instance(i915->kernel_context, &engine->base);
> - if (IS_ERR(engine->base.kernel_context))
> + return &engine->base;
> +}
> +
> +int mock_engine_init(struct intel_engine_cs *engine)
> +{
> + struct drm_i915_private *i915 = engine->i915;
> + int err;
> +
> + intel_engine_init_breadcrumbs(engine);
> + intel_engine_init_execlists(engine);
> + intel_engine_init__pm(engine);
> +
> + if (i915_timeline_init(i915, &engine->timeline, NULL))
> goto err_breadcrumbs;
> + i915_timeline_set_subclass(&engine->timeline, TIMELINE_ENGINE);
> +
> + engine->kernel_context =
> + intel_context_instance(i915->kernel_context, engine);
> + if (IS_ERR(engine->kernel_context))
> + goto err_timeline;
>
> - err = intel_context_pin(engine->base.kernel_context);
> - intel_context_put(engine->base.kernel_context);
> + err = intel_context_pin(engine->kernel_context);
> + intel_context_put(engine->kernel_context);
> if (err)
> - goto err_breadcrumbs;
> + goto err_timeline;
>
> - return &engine->base;
> + return 0;
>
> +err_timeline:
> + i915_timeline_fini(&engine->timeline);
> err_breadcrumbs:
> - intel_engine_fini_breadcrumbs(&engine->base);
> - i915_timeline_fini(&engine->base.timeline);
> -err_free:
> - kfree(engine);
> - return NULL;
> + intel_engine_fini_breadcrumbs(engine);
> + return -ENOMEM;
> }
>
> void mock_engine_flush(struct intel_engine_cs *engine)
> diff --git a/drivers/gpu/drm/i915/gt/mock_engine.h b/drivers/gpu/drm/i915/gt/mock_engine.h
> index 44b35a85e9d1..3f9b698c49d2 100644
> --- a/drivers/gpu/drm/i915/gt/mock_engine.h
> +++ b/drivers/gpu/drm/i915/gt/mock_engine.h
> @@ -42,6 +42,8 @@ struct mock_engine {
> struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
> const char *name,
> int id);
> +int mock_engine_init(struct intel_engine_cs *engine);
> +
> void mock_engine_flush(struct intel_engine_cs *engine);
> void mock_engine_reset(struct intel_engine_cs *engine);
> void mock_engine_free(struct intel_engine_cs *engine);
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index a6436c77109a..50266e87c225 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4523,6 +4523,12 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
> goto err_ggtt;
> }
>
> + ret = intel_engines_setup(dev_priv);
> + if (ret) {
> + GEM_BUG_ON(ret == -EIO);
> + goto err_unlock;
> + }
> +
> ret = i915_gem_contexts_init(dev_priv);
> if (ret) {
> GEM_BUG_ON(ret == -EIO);
> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> index c072424c6b7c..e4033d0576c4 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -209,12 +209,16 @@ struct drm_i915_private *mock_gem_device(void)
> mock_init_ggtt(i915, &i915->ggtt);
>
> mkwrite_device_info(i915)->engine_mask = BIT(0);
> - i915->kernel_context = mock_context(i915, NULL);
> - if (!i915->kernel_context)
> - goto err_unlock;
>
> i915->engine[RCS0] = mock_engine(i915, "mock", RCS0);
> if (!i915->engine[RCS0])
> + goto err_unlock;
> +
> + i915->kernel_context = mock_context(i915, NULL);
> + if (!i915->kernel_context)
> + goto err_engine;
> +
> + if (mock_engine_init(i915->engine[RCS0]))
> goto err_context;
>
> mutex_unlock(&i915->drm.struct_mutex);
> @@ -225,6 +229,8 @@ struct drm_i915_private *mock_gem_device(void)
>
> err_context:
> i915_gem_contexts_fini(i915);
> +err_engine:
> + mock_engine_free(i915->engine[RCS0]);
> err_unlock:
> mutex_unlock(&i915->drm.struct_mutex);
> i915_timelines_fini(i915);
>
After a couple backs and forth to triple check things I did not spot any
mistakes in code split and movement so:
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH v8 1/2] media: uapi: Add H264 low-level decoder API compound controls.
From: Hans Verkuil @ 2019-04-10 13:30 UTC (permalink / raw)
To: Maxime Ripard, hans.verkuil, acourbot, sakari.ailus,
Laurent Pinchart
Cc: tfiga, posciak, Paul Kocialkowski, Chen-Yu Tsai, linux-kernel,
linux-arm-kernel, linux-media, nicolas.dufresne, jenskuske,
jernej.skrabec, jonas, ezequiel, linux-sunxi, Thomas Petazzoni,
Guenter Roeck
In-Reply-To: <f537c99d8b5a974f8687f4f0d018c025a4220f7a.1554382670.git-series.maxime.ripard@bootlin.com>
On 4/4/19 2:59 PM, Maxime Ripard wrote:
> From: Pawel Osciak <posciak@chromium.org>
>
> Stateless video codecs will require both the H264 metadata and slices in
> order to be able to decode frames.
>
> This introduces the definitions for a new pixel format for H264 slices that
> have been parsed, as well as the structures used to pass the metadata from
> the userspace to the kernel.
>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Signed-off-by: Pawel Osciak <posciak@chromium.org>
> Signed-off-by: Guenter Roeck <groeck@chromium.org>
> Co-developed-by: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
> Documentation/media/uapi/v4l/biblio.rst | 9 +-
> Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 569 ++++++++++++++-
> Documentation/media/uapi/v4l/pixfmt-compressed.rst | 19 +-
> Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 30 +-
> Documentation/media/videodev2.h.rst.exceptions | 5 +-
> drivers/media/v4l2-core/v4l2-ctrls.c | 42 +-
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +-
> include/media/h264-ctrls.h | 192 +++++-
> include/media/v4l2-ctrls.h | 13 +-
> include/uapi/linux/videodev2.h | 1 +-
> 10 files changed, 880 insertions(+), 1 deletion(-)
> create mode 100644 include/media/h264-ctrls.h
>
> diff --git a/Documentation/media/uapi/v4l/biblio.rst b/Documentation/media/uapi/v4l/biblio.rst
> index ec33768c055e..8f4eb8823d82 100644
> --- a/Documentation/media/uapi/v4l/biblio.rst
> +++ b/Documentation/media/uapi/v4l/biblio.rst
> @@ -122,6 +122,15 @@ ITU BT.1119
>
> :author: International Telecommunication Union (http://www.itu.ch)
>
> +.. _h264:
> +
> +ITU-T Rec. H.264 Specification (04/2017 Edition)
> +================================================
> +
> +:title: ITU-T Recommendation H.264 "Advanced Video Coding for Generic Audiovisual Services"
> +
> +:author: International Telecommunication Union (http://www.itu.ch)
> +
> .. _jfif:
>
> JFIF
> diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
> index 67a122339c0e..fe720f239f70 100644
> --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
> +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst
> @@ -1371,6 +1371,575 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
> - Layer number
>
>
> +.. _v4l2-mpeg-h264:
> +
> +``V4L2_CID_MPEG_VIDEO_H264_SPS (struct)``
> + Specifies the sequence parameter set (as extracted from the
> + bitstream) for the associated H264 slice data. This includes the
> + necessary parameters for configuring a stateless hardware decoding
> + pipeline for H264. The bitstream parameters are defined according
> + to :ref:`h264`, section 7.4.2.1.1 "Sequence Parameter Set Data
> + Semantics". For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_sps
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_sps
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u8
> + - ``profile_idc``
> + -
> + * - __u8
> + - ``constraint_set_flags``
> + - See :ref:`Sequence Parameter Set Constraints Set Flags <h264_sps_constraints_set_flags>`
> + * - __u8
> + - ``level_idc``
> + -
> + * - __u8
> + - ``seq_parameter_set_id``
> + -
> + * - __u8
> + - ``chroma_format_idc``
> + -
> + * - __u8
> + - ``bit_depth_luma_minus8``
> + -
> + * - __u8
> + - ``bit_depth_chroma_minus8``
> + -
> + * - __u8
> + - ``log2_max_frame_num_minus4``
> + -
> + * - __u8
> + - ``pic_order_cnt_type``
> + -
> + * - __u8
> + - ``log2_max_pic_order_cnt_lsb_minus4``
> + -
> + * - __u8
> + - ``max_num_ref_frames``
> + -
> + * - __u8
> + - ``num_ref_frames_in_pic_order_cnt_cycle``
> + -
> + * - __s32
> + - ``offset_for_ref_frame[255]``
> + -
> + * - __s32
> + - ``offset_for_non_ref_pic``
> + -
> + * - __s32
> + - ``offset_for_top_to_bottom_field``
> + -
> + * - __u16
> + - ``pic_width_in_mbs_minus1``
> + -
> + * - __u16
> + - ``pic_height_in_map_units_minus1``
> + -
> + * - __u32
> + - ``flags``
> + - See :ref:`Sequence Parameter Set Flags <h264_sps_flags>`
> +
> +.. _h264_sps_constraints_set_flags:
> +
> +``Sequence Parameter Set Constraints Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET0_FLAG``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET1_FLAG``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET2_FLAG``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET3_FLAG``
> + - 0x00000008
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET4_FLAG``
> + - 0x00000010
> + -
> + * - ``V4L2_H264_SPS_CONSTRAINT_SET5_FLAG``
> + - 0x00000020
> + -
> +
> +.. _h264_sps_flags:
> +
> +``Sequence Parameter Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED``
> + - 0x00000008
> + -
> + * - ``V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY``
> + - 0x00000010
> + -
> + * - ``V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD``
> + - 0x00000020
> + -
> + * - ``V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE``
> + - 0x00000040
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_PPS (struct)``
> + Specifies the picture parameter set (as extracted from the
> + bitstream) for the associated H264 slice data. This includes the
> + necessary parameters for configuring a stateless hardware decoding
> + pipeline for H264. The bitstream parameters are defined according
> + to :ref:`h264`, section 7.4.2.2 "Picture Parameter Set RBSP
> + Semantics". For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_pps
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_pps
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u8
> + - ``pic_parameter_set_id``
> + -
> + * - __u8
> + - ``seq_parameter_set_id``
> + -
> + * - __u8
> + - ``num_slice_groups_minus1``
> + -
> + * - __u8
> + - ``num_ref_idx_l0_default_active_minus1``
> + -
> + * - __u8
> + - ``num_ref_idx_l1_default_active_minus1``
> + -
> + * - __u8
> + - ``weighted_bipred_idc``
> + -
> + * - __s8
> + - ``pic_init_qp_minus26``
> + -
> + * - __s8
> + - ``pic_init_qs_minus26``
> + -
> + * - __s8
> + - ``chroma_qp_index_offset``
> + -
> + * - __s8
> + - ``second_chroma_qp_index_offset``
> + -
> + * - __u16
> + - ``flags``
> + - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
> +
> +.. _h264_pps_flags:
> +
> +``Picture Parameter Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_PPS_FLAG_WEIGHTED_PRED``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
> + - 0x00000008
> + -
> + * - ``V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED``
> + - 0x00000010
> + -
> + * - ``V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT``
> + - 0x00000020
> + -
> + * - ``V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE``
> + - 0x00000040
> + -
> + * - ``V4L2_H264_PPS_FLAG_PIC_SCALING_MATRIX_PRESENT``
> + - 0x00000080
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX (struct)``
> + Specifies the scaling matrix (as extracted from the bitstream) for
> + the associated H264 slice data. The bitstream parameters are
> + defined according to :ref:`h264`, section 7.4.2.1.1.1 "Scaling
> + List Semantics".For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_scaling_matrix
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_scaling_matrix
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u8
> + - ``scaling_list_4x4[6][16]``
> + -
> + * - __u8
> + - ``scaling_list_8x8[6][64]``
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS (struct)``
> + Specifies the slice parameters (as extracted from the bitstream)
> + for the associated H264 slice data. This includes the necessary
> + parameters for configuring a stateless hardware decoding pipeline
> + for H264. The bitstream parameters are defined according to
> + :ref:`h264`, section 7.4.3 "Slice Header Semantics". For further
> + documentation, refer to the above specification, unless there is
> + an explicit comment stating otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API
> + and it is expected to change.
> +
> + This structure is expected to be passed as an array, with one
> + entry for each slice included in the bitstream buffer.
> +
> +.. c:type:: v4l2_ctrl_h264_slice_params
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_slice_params
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u32
> + - ``size``
> + -
> + * - __u32
> + - ``header_bit_size``
> + -
> + * - __u16
> + - ``first_mb_in_slice``
> + -
> + * - __u8
> + - ``slice_type``
> + -
> + * - __u8
> + - ``pic_parameter_set_id``
> + -
> + * - __u8
> + - ``colour_plane_id``
> + -
> + * - __u8
> + - ``redundant_pic_cnt``
> + -
> + * - __u16
> + - ``frame_num``
> + -
> + * - __u16
> + - ``idr_pic_id``
> + -
> + * - __u16
> + - ``pic_order_cnt_lsb``
> + -
> + * - __s32
> + - ``delta_pic_order_cnt_bottom``
> + -
> + * - __s32
> + - ``delta_pic_order_cnt0``
> + -
> + * - __s32
> + - ``delta_pic_order_cnt1``
> + -
> + * - struct :c:type:`v4l2_h264_pred_weight_table`
> + - ``pred_weight_table``
> + -
> + * - __u32
> + - ``dec_ref_pic_marking_bit_size``
> + -
> + * - __u32
> + - ``pic_order_cnt_bit_size``
> + -
> + * - __u8
> + - ``cabac_init_idc``
> + -
> + * - __s8
> + - ``slice_qp_delta``
> + -
> + * - __s8
> + - ``slice_qs_delta``
> + -
> + * - __u8
> + - ``disable_deblocking_filter_idc``
> + -
> + * - __s8
> + - ``slice_alpha_c0_offset_div2``
> + -
> + * - __s8
> + - ``slice_beta_offset_div2``
> + -
> + * - __u8
> + - ``num_ref_idx_l0_active_minus1``
> + -
> + * - __u8
> + - ``num_ref_idx_l1_active_minus1``
> + -
> + * - __u32
> + - ``slice_group_change_cycle``
> + -
> + * - __u8
> + - ``ref_pic_list0[32]``
> + - Reference picture list after applying the per-slice modifications
> + * - __u8
> + - ``ref_pic_list1[32]``
> + - Reference picture list after applying the per-slice modifications
> + * - __u32
> + - ``flags``
> + - See :ref:`Slice Parameter Flags <h264_slice_flags>`
> +
> +.. _h264_slice_flags:
> +
> +``Slice Parameter Set Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_SLICE_FLAG_FIELD_PIC``
> + - 0x00000001
> + -
> + * - ``V4L2_H264_SLICE_FLAG_BOTTOM_FIELD``
> + - 0x00000002
> + -
> + * - ``V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED``
> + - 0x00000004
> + -
> + * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH``
> + - 0x00000008
> + -
> +
> +``Prediction Weight Table``
> +
> + The bitstream parameters are defined according to :ref:`h264`,
> + section 7.4.3.2 "Prediction Weight Table Semantics". For further
> + documentation, refer to the above specification, unless there is
> + an explicit comment stating otherwise.
> +
> +.. c:type:: v4l2_h264_pred_weight_table
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_h264_pred_weight_table
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u16
> + - ``luma_log2_weight_denom``
> + -
> + * - __u16
> + - ``chroma_log2_weight_denom``
> + -
> + * - struct :c:type:`v4l2_h264_weight_factors`
> + - ``weight_factors[2]``
> + - The weight factors at index 0 are the weight factors for the reference
> + list 0, the one at index 1 for the reference list 1.
> +
> +.. c:type:: v4l2_h264_weight_factors
> +
> +.. cssclass:: longtable
> +
/> +.. flat-table:: struct v4l2_h264_weight_factors
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __s16
> + - ``luma_weight[32]``
> + -
> + * - __s16
> + - ``luma_offset[32]``
> + -
> + * - __s16
> + - ``chroma_weight[32][2]``
> + -
> + * - __s16
> + - ``chroma_offset[32][2]``
> + -
> +
> +``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS (struct)``
> + Specifies the decode parameters (as extracted from the bitstream)
> + for the associated H264 slice data. This includes the necessary
> + parameters for configuring a stateless hardware decoding pipeline
> + for H264. The bitstream parameters are defined according to
> + :ref:`h264`. For further documentation, refer to the above
> + specification, unless there is an explicit comment stating
> + otherwise.
> +
> + .. note::
> +
> + This compound control is not yet part of the public kernel API and
> + it is expected to change.
> +
> +.. c:type:: v4l2_ctrl_h264_decode_params
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_ctrl_h264_decode_params
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u32
> + - ``num_slices``
> + - Number of slices needed to decode the current frame
> + * - __u32
> + - ``nal_ref_idc``
> + - NAL reference ID value coming from the NAL Unit header
> + * - __u8
> + - ``ref_pic_list_p0[32]``
> + - Backward reference list used by P-frames in the original bitstream order
> + * - __u8
> + - ``ref_pic_list_b0[32]``
> + - Backward reference list used by B-frames in the original bitstream order
> + * - __u8
> + - ``ref_pic_list_b1[32]``
> + - Forward reference list used by B-frames in the original bitstream order
> + * - __s32
> + - ``top_field_order_cnt``
> + - Picture Order Count for the coded top field
> + * - __s32
> + - ``bottom_field_order_cnt``
> + - Picture Order Count for the coded bottom field
> + * - __u32
> + - ``flags``
> + - See :ref:`Decode Parameters Flags <h264_decode_params_flags>`
> + * - struct :c:type:`v4l2_h264_dpb_entry`
> + - ``dpb[16]``
> + -
> +
> +.. _h264_decode_params_flags:
> +
> +``Decode Parameters Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC``
> + - 0x00000001
> + - That picture is an IDR picture
> +
> +.. c:type:: v4l2_h264_dpb_entry
> +
> +.. cssclass:: longtable
> +
> +.. flat-table:: struct v4l2_h264_dpb_entry
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - __u64
> + - ``reference_ts``
> + - Timestamp of the V4L2 capture buffer to use as reference, used
> + with B-coded and P-coded frames. The timestamp refers to the
> + ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
> + :c:func:`v4l2_timeval_to_ns()` function to convert the struct
> + :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
> + * - __u16
> + - ``frame_num``
> + -
> + * - __u16
> + - ``pic_num``
> + -
> + * - __s32
> + - ``top_field_order_cnt``
> + -
> + * - __s32
> + - ``bottom_field_order_cnt``
> + -
> + * - __u32
> + - ``flags``
> + - See :ref:`DPB Entry Flags <h264_dpb_flags>`
> +
> +.. _h264_dpb_flags:
> +
> +``DPB Entries Flags``
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> + :header-rows: 0
> + :stub-columns: 0
> + :widths: 1 1 2
> +
> + * - ``V4L2_H264_DPB_ENTRY_FLAG_VALID``
> + - 0x00000001
> + - The DPB entry is valid and should be considered
> + * - ``V4L2_H264_DPB_ENTRY_FLAG_ACTIVE``
> + - 0x00000002
> + - The DPB entry is currently being used as a reference frame
> + * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM``
> + - 0x00000004
> + - The DPB entry is a long term reference frame
>
> .. _v4l2-mpeg-mpeg2:
>
> diff --git a/Documentation/media/uapi/v4l/pixfmt-compressed.rst b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> index 6c961cfb74da..ea0a8a68759b 100644
> --- a/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> +++ b/Documentation/media/uapi/v4l/pixfmt-compressed.rst
> @@ -52,6 +52,25 @@ Compressed Formats
> - ``V4L2_PIX_FMT_H264_MVC``
> - 'M264'
> - H264 MVC video elementary stream.
> + * .. _V4L2-PIX-FMT-H264-SLICE:
Should be _V4L2-PIX-FMT-H264-SLICE-RAW.
> +
> + - ``V4L2_PIX_FMT_H264_SLICE_RAW``
> + - 'S264'
> + - H264 parsed slice data, as extracted from the H264 bitstream.
> + This format is adapted for stateless video decoders that
> + implement an H264 pipeline (using the :ref:`codec` and
codec is now mem2mem.
> + :ref:`media-request-api`). Metadata associated with the frame
> + to decode are required to be passed through the
> + ``V4L2_CID_MPEG_VIDEO_H264_SPS``,
> + ``V4L2_CID_MPEG_VIDEO_H264_PPS``,
> + ``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX``,
> + ``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS`` and
> + ``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS`` controls. See the
> + :ref:`associated Codec Control IDs <v4l2-mpeg-h264>`.
> + Exactly one output and one capture buffer must be provided for
> + use with this pixel format. The output buffer must contain the
> + appropriate number of macroblocks to decode a full
> + corresponding frame to the matching capture buffer.
> * .. _V4L2-PIX-FMT-H263:
>
> - ``V4L2_PIX_FMT_H263``
> diff --git a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> index f824162d0ea9..dc500632095d 100644
> --- a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> +++ b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> @@ -443,6 +443,36 @@ See also the examples in :ref:`control`.
> - n/a
> - A struct :c:type:`v4l2_ctrl_mpeg2_quantization`, containing MPEG-2
> quantization matrices for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_SPS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_sps`, containing H264
> + sequence parameters for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_PPS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_pps`, containing H264
> + picture parameters for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_scaling_matrix`, containing H264
> + scaling matrices for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_slice_params`, containing H264
> + slice parameters for stateless video decoders.
> + * - ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``
> + - n/a
> + - n/a
> + - n/a
> + - A struct :c:type:`v4l2_ctrl_h264_decode_params`, containing H264
> + decode parameters for stateless video decoders.
>
> .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
>
> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
> index 64d348e67df9..55cbe324b9fc 100644
> --- a/Documentation/media/videodev2.h.rst.exceptions
> +++ b/Documentation/media/videodev2.h.rst.exceptions
> @@ -136,6 +136,11 @@ replace symbol V4L2_CTRL_TYPE_U32 :c:type:`v4l2_ctrl_type`
> replace symbol V4L2_CTRL_TYPE_U8 :c:type:`v4l2_ctrl_type`
> replace symbol V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS :c:type:`v4l2_ctrl_type`
> replace symbol V4L2_CTRL_TYPE_MPEG2_QUANTIZATION :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_SPS :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_PPS :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_SCALING_MATRIX :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_SLICE_PARAMS :c:type:`v4l2_ctrl_type`
> +replace symbol V4L2_CTRL_TYPE_H264_DECODE_PARAMS :c:type:`v4l2_ctrl_type`
>
> # V4L2 capability defines
> replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index b1ae2e555c68..46aec8c3acde 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -828,6 +828,11 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
> return "H264 Constrained Intra Pred";
> case V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET: return "H264 Chroma QP Index Offset";
> + case V4L2_CID_MPEG_VIDEO_H264_SPS: return "H264 Sequence Parameter Set";
> + case V4L2_CID_MPEG_VIDEO_H264_PPS: return "H264 Picture Parameter Set";
> + case V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX: return "H264 Scaling Matrix";
> + case V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS: return "H264 Slice Parameters";
> + case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS: return "H264 Decode Parameters";
> case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP: return "MPEG4 I-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP: return "MPEG4 P-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP: return "MPEG4 B-Frame QP Value";
> @@ -1309,6 +1314,21 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
> case V4L2_CID_MPEG_VIDEO_FWHT_PARAMS:
> *type = V4L2_CTRL_TYPE_FWHT_PARAMS;
> break;
> + case V4L2_CID_MPEG_VIDEO_H264_SPS:
> + *type = V4L2_CTRL_TYPE_H264_SPS;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_PPS:
> + *type = V4L2_CTRL_TYPE_H264_PPS;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX:
> + *type = V4L2_CTRL_TYPE_H264_SCALING_MATRIX;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS:
> + *type = V4L2_CTRL_TYPE_H264_SLICE_PARAMS;
> + break;
> + case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS:
> + *type = V4L2_CTRL_TYPE_H264_DECODE_PARAMS;
> + break;
> default:
> *type = V4L2_CTRL_TYPE_INTEGER;
> break;
> @@ -1678,6 +1698,13 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx,
> case V4L2_CTRL_TYPE_FWHT_PARAMS:
> return 0;
>
> + case V4L2_CTRL_TYPE_H264_SPS:
> + case V4L2_CTRL_TYPE_H264_PPS:
> + case V4L2_CTRL_TYPE_H264_SCALING_MATRIX:
> + case V4L2_CTRL_TYPE_H264_SLICE_PARAMS:
> + case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> + return 0;
> +
> default:
> return -EINVAL;
> }
> @@ -2261,6 +2288,21 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
> case V4L2_CTRL_TYPE_FWHT_PARAMS:
> elem_size = sizeof(struct v4l2_ctrl_fwht_params);
> break;
> + case V4L2_CTRL_TYPE_H264_SPS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_sps);
> + break;
> + case V4L2_CTRL_TYPE_H264_PPS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_pps);
> + break;
> + case V4L2_CTRL_TYPE_H264_SCALING_MATRIX:
> + elem_size = sizeof(struct v4l2_ctrl_h264_scaling_matrix);
> + break;
> + case V4L2_CTRL_TYPE_H264_SLICE_PARAMS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_slice_params);
> + break;
> + case V4L2_CTRL_TYPE_H264_DECODE_PARAMS:
> + elem_size = sizeof(struct v4l2_ctrl_h264_decode_params);
> + break;
> default:
> if (type < V4L2_CTRL_COMPOUND_TYPES)
> elem_size = sizeof(s32);
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index ac87c3e37280..f6e1254064d2 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1325,6 +1325,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> case V4L2_PIX_FMT_H264: descr = "H.264"; break;
> case V4L2_PIX_FMT_H264_NO_SC: descr = "H.264 (No Start Codes)"; break;
> case V4L2_PIX_FMT_H264_MVC: descr = "H.264 MVC"; break;
> + case V4L2_PIX_FMT_H264_SLICE_RAW: descr = "H.264 Parsed Slice Data"; break;
> case V4L2_PIX_FMT_H263: descr = "H.263"; break;
> case V4L2_PIX_FMT_MPEG1: descr = "MPEG-1 ES"; break;
> case V4L2_PIX_FMT_MPEG2: descr = "MPEG-2 ES"; break;
> diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h
> new file mode 100644
> index 000000000000..e2f83b3cdbef
> --- /dev/null
> +++ b/include/media/h264-ctrls.h
> @@ -0,0 +1,192 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * These are the H.264 state controls for use with stateless H.264
> + * codec drivers.
> + *
> + * It turns out that these structs are not stable yet and will undergo
> + * more changes. So keep them private until they are stable and ready to
> + * become part of the official public API.
> + */
> +
> +#ifndef _H264_CTRLS_H_
> +#define _H264_CTRLS_H_
> +
> +/*
> + * This is put insanely high to avoid conflicting with controls that
> + * would be added during the phase where those controls are not
> + * stable. It should be fixed eventually.
> + */
> +#define V4L2_CID_MPEG_VIDEO_H264_SPS (V4L2_CID_MPEG_BASE+1000)
> +#define V4L2_CID_MPEG_VIDEO_H264_PPS (V4L2_CID_MPEG_BASE+1001)
> +#define V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX (V4L2_CID_MPEG_BASE+1002)
> +#define V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS (V4L2_CID_MPEG_BASE+1003)
> +#define V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS (V4L2_CID_MPEG_BASE+1004)
> +
> +/* enum v4l2_ctrl_type type values */
> +#define V4L2_CTRL_TYPE_H264_SPS 0x0110
> +#define V4L2_CTRL_TYPE_H264_PPS 0x0111
> +#define V4L2_CTRL_TYPE_H264_SCALING_MATRIX 0x0112
> +#define V4L2_CTRL_TYPE_H264_SLICE_PARAMS 0x0113
> +#define V4L2_CTRL_TYPE_H264_DECODE_PARAMS 0x0114
> +
> +#define V4L2_H264_SPS_CONSTRAINT_SET0_FLAG 0x01
> +#define V4L2_H264_SPS_CONSTRAINT_SET1_FLAG 0x02
> +#define V4L2_H264_SPS_CONSTRAINT_SET2_FLAG 0x04
> +#define V4L2_H264_SPS_CONSTRAINT_SET3_FLAG 0x08
> +#define V4L2_H264_SPS_CONSTRAINT_SET4_FLAG 0x10
> +#define V4L2_H264_SPS_CONSTRAINT_SET5_FLAG 0x20
> +
> +#define V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE 0x01
> +#define V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS 0x02
> +#define V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO 0x04
> +#define V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED 0x08
> +#define V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY 0x10
> +#define V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD 0x20
> +#define V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE 0x40
> +
> +struct v4l2_ctrl_h264_sps {
> + __u8 profile_idc;
> + __u8 constraint_set_flags;
> + __u8 level_idc;
> + __u8 seq_parameter_set_id;
> + __u8 chroma_format_idc;
> + __u8 bit_depth_luma_minus8;
> + __u8 bit_depth_chroma_minus8;
> + __u8 log2_max_frame_num_minus4;
> + __u8 pic_order_cnt_type;
> + __u8 log2_max_pic_order_cnt_lsb_minus4;
> + __u8 max_num_ref_frames;
> + __u8 num_ref_frames_in_pic_order_cnt_cycle;
> + __s32 offset_for_ref_frame[255];
> + __s32 offset_for_non_ref_pic;
> + __s32 offset_for_top_to_bottom_field;
> + __u16 pic_width_in_mbs_minus1;
> + __u16 pic_height_in_map_units_minus1;
> + __u32 flags;
> +};
> +
> +#define V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE 0x0001
> +#define V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT 0x0002
> +#define V4L2_H264_PPS_FLAG_WEIGHTED_PRED 0x0004
> +#define V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT 0x0008
> +#define V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED 0x0010
> +#define V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT 0x0020
> +#define V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE 0x0040
> +#define V4L2_H264_PPS_FLAG_PIC_SCALING_MATRIX_PRESENT 0x0080
> +
> +struct v4l2_ctrl_h264_pps {
> + __u8 pic_parameter_set_id;
> + __u8 seq_parameter_set_id;
> + __u8 num_slice_groups_minus1;
> + __u8 num_ref_idx_l0_default_active_minus1;
> + __u8 num_ref_idx_l1_default_active_minus1;
> + __u8 weighted_bipred_idc;
> + __s8 pic_init_qp_minus26;
> + __s8 pic_init_qs_minus26;
> + __s8 chroma_qp_index_offset;
> + __s8 second_chroma_qp_index_offset;
> + __u16 flags;
> +};
> +
> +struct v4l2_ctrl_h264_scaling_matrix {
> + __u8 scaling_list_4x4[6][16];
> + __u8 scaling_list_8x8[6][64];
> +};
> +
> +struct v4l2_h264_weight_factors {
> + __s16 luma_weight[32];
> + __s16 luma_offset[32];
> + __s16 chroma_weight[32][2];
> + __s16 chroma_offset[32][2];
> +};
> +
> +struct v4l2_h264_pred_weight_table {
> + __u16 luma_log2_weight_denom;
> + __u16 chroma_log2_weight_denom;
> + struct v4l2_h264_weight_factors weight_factors[2];
> +};
> +
> +#define V4L2_H264_SLICE_TYPE_P 0
> +#define V4L2_H264_SLICE_TYPE_B 1
> +#define V4L2_H264_SLICE_TYPE_I 2
> +#define V4L2_H264_SLICE_TYPE_SP 3
> +#define V4L2_H264_SLICE_TYPE_SI 4
> +
> +#define V4L2_H264_SLICE_FLAG_FIELD_PIC 0x01
> +#define V4L2_H264_SLICE_FLAG_BOTTOM_FIELD 0x02
> +#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x04
> +#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x08
> +
> +struct v4l2_ctrl_h264_slice_params {
> + /* Size in bytes, including header */
> + __u32 size;
> + /* Offset in bits to slice_data() from the beginning of this slice. */
> + __u32 header_bit_size;
> +
> + __u16 first_mb_in_slice;
> + __u8 slice_type;
> + __u8 pic_parameter_set_id;
> + __u8 colour_plane_id;
> + __u8 redundant_pic_cnt;
> + __u16 frame_num;
> + __u16 idr_pic_id;
> + __u16 pic_order_cnt_lsb;
> + __s32 delta_pic_order_cnt_bottom;
> + __s32 delta_pic_order_cnt0;
> + __s32 delta_pic_order_cnt1;
> +
> + struct v4l2_h264_pred_weight_table pred_weight_table;
> + /* Size in bits of dec_ref_pic_marking() syntax element. */
> + __u32 dec_ref_pic_marking_bit_size;
> + /* Size in bits of pic order count syntax. */
> + __u32 pic_order_cnt_bit_size;
> +
> + __u8 cabac_init_idc;
> + __s8 slice_qp_delta;
> + __s8 slice_qs_delta;
> + __u8 disable_deblocking_filter_idc;
> + __s8 slice_alpha_c0_offset_div2;
> + __s8 slice_beta_offset_div2;
> + __u8 num_ref_idx_l0_active_minus1;
> + __u8 num_ref_idx_l1_active_minus1;
> + __u32 slice_group_change_cycle;
> +
> + /*
> + * Entries on each list are indices into
> + * v4l2_ctrl_h264_decode_params.dpb[].
> + */
> + __u8 ref_pic_list0[32];
> + __u8 ref_pic_list1[32];
> +
> + __u32 flags;
> +};
> +
> +#define V4L2_H264_DPB_ENTRY_FLAG_VALID 0x01
> +#define V4L2_H264_DPB_ENTRY_FLAG_ACTIVE 0x02
> +#define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM 0x04
> +
> +struct v4l2_h264_dpb_entry {
> + __u64 reference_ts;
> + __u16 frame_num;
> + __u16 pic_num;
> + /* Note that field is indicated by v4l2_buffer.field */
> + __s32 top_field_order_cnt;
> + __s32 bottom_field_order_cnt;
> + __u32 flags; /* V4L2_H264_DPB_ENTRY_FLAG_* */
> +};
> +
> +#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
> +
> +struct v4l2_ctrl_h264_decode_params {
> + struct v4l2_h264_dpb_entry dpb[16];
> + __u16 num_slices;
> + __u16 nal_ref_idc;
> + __u8 ref_pic_list_p0[32];
> + __u8 ref_pic_list_b0[32];
> + __u8 ref_pic_list_b1[32];
> + __s32 top_field_order_cnt;
> + __s32 bottom_field_order_cnt;
> + __u32 flags; /* V4L2_H264_DECODE_PARAM_FLAG_* */
> +};
> +
> +#endif
> diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
> index bd621cec65a5..dce6f33fd749 100644
> --- a/include/media/v4l2-ctrls.h
> +++ b/include/media/v4l2-ctrls.h
> @@ -23,11 +23,12 @@
> #include <media/media-request.h>
>
> /*
> - * Include the mpeg2 and fwht stateless codec compound control definitions.
> + * Include the stateless codec compound control definitions.
> * This will move to the public headers once this API is fully stable.
> */
> #include <media/mpeg2-ctrls.h>
> #include <media/fwht-ctrls.h>
> +#include <media/h264-ctrls.h>
>
> /* forward references */
> struct file;
> @@ -51,6 +52,11 @@ struct poll_table_struct;
> * @p_mpeg2_slice_params: Pointer to a MPEG2 slice parameters structure.
> * @p_mpeg2_quantization: Pointer to a MPEG2 quantization data structure.
> * @p_fwht_params: Pointer to a FWHT stateless parameters structure.
> + * @p_h264_sps: Pointer to a struct v4l2_ctrl_h264_sps.
> + * @p_h264_pps: Pointer to a struct v4l2_ctrl_h264_pps.
> + * @p_h264_scaling_matrix: Pointer to a struct v4l2_ctrl_h264_scaling_matrix.
> + * @p_h264_slice_param: Pointer to a struct v4l2_ctrl_h264_slice_params.
> + * @p_h264_decode_param: Pointer to a struct v4l2_ctrl_h264_decode_params.
p_h264_slice_param -> p_h264_slice_params
p_h264_decode_param -> p_h264_decode_params
> * @p: Pointer to a compound value.
> */
> union v4l2_ctrl_ptr {
> @@ -63,6 +69,11 @@ union v4l2_ctrl_ptr {
> struct v4l2_ctrl_mpeg2_slice_params *p_mpeg2_slice_params;
> struct v4l2_ctrl_mpeg2_quantization *p_mpeg2_quantization;
> struct v4l2_ctrl_fwht_params *p_fwht_params;
> + struct v4l2_ctrl_h264_sps *p_h264_sps;
> + struct v4l2_ctrl_h264_pps *p_h264_pps;
> + struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
> + struct v4l2_ctrl_h264_slice_params *p_h264_slice_param;
> + struct v4l2_ctrl_h264_decode_params *p_h264_decode_param;
Ditto.
Regards,
Hans
> void *p;
> };
>
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 496e6453450c..838732acdefc 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -657,6 +657,7 @@ struct v4l2_pix_format {
> #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
> #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
> #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
> +#define V4L2_PIX_FMT_H264_SLICE_RAW v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
> #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
> #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
> #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
>
^ permalink raw reply
* Re: [meta-networking] [PATCH] wireshark: upgrade 3.0.0 -> 3.0.1
From: akuster808 @ 2019-04-10 13:29 UTC (permalink / raw)
To: Zang Ruochen, openembedded-devel
In-Reply-To: <20190410064405.28359-1-zangrc.fnst@cn.fujitsu.com>
On 4/10/19 12:14 PM, Zang Ruochen wrote:
> -Upgrade from wireshark_3.0.0.bb to wireshark_3.0.1.bb.
How is the graphical aspect of wireshark being tested?
>
> Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
> ---
> .../wireshark/{wireshark_3.0.0.bb => wireshark_3.0.1.bb} | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> rename meta-networking/recipes-support/wireshark/{wireshark_3.0.0.bb => wireshark_3.0.1.bb} (95%)
>
> diff --git a/meta-networking/recipes-support/wireshark/wireshark_3.0.0.bb b/meta-networking/recipes-support/wireshark/wireshark_3.0.1.bb
> similarity index 95%
> rename from meta-networking/recipes-support/wireshark/wireshark_3.0.0.bb
> rename to meta-networking/recipes-support/wireshark/wireshark_3.0.1.bb
> index dc55e3de0..572dc1a45 100644
> --- a/meta-networking/recipes-support/wireshark/wireshark_3.0.0.bb
> +++ b/meta-networking/recipes-support/wireshark/wireshark_3.0.1.bb
> @@ -12,8 +12,8 @@ SRC_URI = "https://1.eu.dl.wireshark.org/src/wireshark-${PV}.tar.xz"
>
> UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src"
>
> -SRC_URI[md5sum] = "258d62ac7434d126dc497303c8f7961b"
> -SRC_URI[sha256sum] = "bc4f30f5b2e94f3a696fef9de44673cdf402db90aac5299966da647f708f009e"
> +SRC_URI[md5sum] = "370a113e1c8ec240c4621cfb5abb0c52"
> +SRC_URI[sha256sum] = "86864c3d0f6c2311992a98d8ea7dfd429097fe62dae2e5516e1a2f6bef2ac08c"
>
> PE = "1"
>
^ permalink raw reply
* Re: [PATCH v3 1/3] perf: use hweight64 instead of hweight_long
From: Arnaldo Carvalho de Melo @ 2019-04-10 13:28 UTC (permalink / raw)
To: Mao Han
Cc: linux-kernel, Peter Zijlstra, Ingo Molnar, Alexander Shishkin,
Jiri Olsa, Namhyung Kim, Adrian Hunter, Stephane Eranian
In-Reply-To: <20190410131042.GF13888@kernel.org>
Em Wed, Apr 10, 2019 at 10:10:42AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Apr 10, 2019 at 10:08:41AM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Apr 10, 2019 at 04:16:43PM +0800, Mao Han escreveu:
> > > On 32-bits platform with more than 32 registers, the 64 bits mask is
> > > truncate to the lower 32 bits and the return value of hweight_long will
> > > always smaller than 32. When kernel outputs more than 32 registers, but
> > > the user perf program only counts 32, there will be a data mismatch
> > > result to overflow check fail.
> > >
> > > CC: Peter Zijlstra <peterz@infradead.org>
> > > CC: Ingo Molnar <mingo@redhat.com>
> > > CC: Arnaldo Carvalho de Melo <acme@kernel.org>
> > > CC: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> > > CC: Jiri Olsa <jolsa@redhat.com>
> > > CC: Namhyung Kim <namhyung@kernel.org>
> > >
> > > Signed-off-by: Mao Han <han_mao@c-sky.com>
> > > ---
> > > tools/perf/util/evsel.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> > > index 7835e05..73c78be 100644
> > > --- a/tools/perf/util/evsel.c
> > > +++ b/tools/perf/util/evsel.c
> > > @@ -2322,7 +2322,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
> > > if (data->user_regs.abi) {
> > > u64 mask = evsel->attr.sample_regs_user;
> > >
> > > - sz = hweight_long(mask) * sizeof(u64);
> > > + sz = hweight64(mask) * sizeof(u64);
> > > OVERFLOW_CHECK(array, sz, max_size);
> > > data->user_regs.mask = mask;
> > > data->user_regs.regs = (u64 *)array;
> >
> > Later on, in the same function, perf_evsel__parse_sample() we have:
> >
> > data->intr_regs.abi = PERF_SAMPLE_REGS_ABI_NONE;
> > if (type & PERF_SAMPLE_REGS_INTR) {
> > OVERFLOW_CHECK_u64(array);
> > data->intr_regs.abi = *array;
> > array++;
> >
> > if (data->intr_regs.abi != PERF_SAMPLE_REGS_ABI_NONE) {
> > u64 mask = evsel->attr.sample_regs_intr;
> >
> > sz = hweight_long(mask) * sizeof(u64);
> > OVERFLOW_CHECK(array, sz, max_size);
> > data->intr_regs.mask = mask;
> > data->intr_regs.regs = (u64 *)array;
> > array = (void *)array + sz;
> > }
> > }
> >
> > You forgot to convert that one, doing it for you,
>
> Also in perf_event__sample_event_size() we need to do the same thing,
> right?
and perf_event__synthesize_sample()
Done, resulting patch is at the end of this messages, and matches the
kernel, that uses only hweight64().
I've also added Fixes tags to the patches that used hweight_long() in
various places, to help with the stable trees backporting process,
please consider doing it next time.
- Arnaldo
commit 21e6dfe04861c2c1b529f2759850bc62a80ca050
Author: Mao Han <han_mao@c-sky.com>
Date: Wed Apr 10 16:16:43 2019 +0800
perf evsel: Use hweight64() instead of hweight_long(attr.sample_regs_user)
On 32-bits platform with more than 32 registers, the 64 bits mask is
truncate to the lower 32 bits and the return value of hweight_long will
always smaller than 32. When kernel outputs more than 32 registers, but
the user perf program only counts 32, there will be a data mismatch
result to overflow check fail.
Signed-off-by: Mao Han <han_mao@c-sky.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Fixes: 6a21c0b5c2ab ("perf tools: Add core support for sampling intr machine state regs")
Fixes: d03f2170546d ("perf tools: Expand perf_event__synthesize_sample()")
Fixes: 0f6a30150ca2 ("perf tools: Support user regs and stack in sample parsing")
Link: http://lkml.kernel.org/r/29ad7947dc8fd1ff0abd2093a72cc27a2446be9f.1554883878.git.han_mao@c-sky.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 66d066f18b5b..966360844fff 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2368,7 +2368,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
if (data->user_regs.abi) {
u64 mask = evsel->attr.sample_regs_user;
- sz = hweight_long(mask) * sizeof(u64);
+ sz = hweight64(mask) * sizeof(u64);
OVERFLOW_CHECK(array, sz, max_size);
data->user_regs.mask = mask;
data->user_regs.regs = (u64 *)array;
@@ -2424,7 +2424,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
if (data->intr_regs.abi != PERF_SAMPLE_REGS_ABI_NONE) {
u64 mask = evsel->attr.sample_regs_intr;
- sz = hweight_long(mask) * sizeof(u64);
+ sz = hweight64(mask) * sizeof(u64);
OVERFLOW_CHECK(array, sz, max_size);
data->intr_regs.mask = mask;
data->intr_regs.regs = (u64 *)array;
@@ -2552,7 +2552,7 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
if (type & PERF_SAMPLE_REGS_USER) {
if (sample->user_regs.abi) {
result += sizeof(u64);
- sz = hweight_long(sample->user_regs.mask) * sizeof(u64);
+ sz = hweight64(sample->user_regs.mask) * sizeof(u64);
result += sz;
} else {
result += sizeof(u64);
@@ -2580,7 +2580,7 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
if (type & PERF_SAMPLE_REGS_INTR) {
if (sample->intr_regs.abi) {
result += sizeof(u64);
- sz = hweight_long(sample->intr_regs.mask) * sizeof(u64);
+ sz = hweight64(sample->intr_regs.mask) * sizeof(u64);
result += sz;
} else {
result += sizeof(u64);
@@ -2710,7 +2710,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
if (type & PERF_SAMPLE_REGS_USER) {
if (sample->user_regs.abi) {
*array++ = sample->user_regs.abi;
- sz = hweight_long(sample->user_regs.mask) * sizeof(u64);
+ sz = hweight64(sample->user_regs.mask) * sizeof(u64);
memcpy(array, sample->user_regs.regs, sz);
array = (void *)array + sz;
} else {
@@ -2746,7 +2746,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
if (type & PERF_SAMPLE_REGS_INTR) {
if (sample->intr_regs.abi) {
*array++ = sample->intr_regs.abi;
- sz = hweight_long(sample->intr_regs.mask) * sizeof(u64);
+ sz = hweight64(sample->intr_regs.mask) * sizeof(u64);
memcpy(array, sample->intr_regs.regs, sz);
array = (void *)array + sz;
} else {
^ permalink raw reply related
* [tip:timers/urgent] alarmtimer: Return correct remaining time
From: tip-bot for Andrei Vagin @ 2019-04-10 13:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: tglx, linux-kernel, mojha, hpa, mingo, john.stultz, avagin, sboyd
In-Reply-To: <20190408041542.26338-1-avagin@gmail.com>
Commit-ID: 07d7e12091f4ab869cc6a4bb276399057e73b0b3
Gitweb: https://git.kernel.org/tip/07d7e12091f4ab869cc6a4bb276399057e73b0b3
Author: Andrei Vagin <avagin@gmail.com>
AuthorDate: Sun, 7 Apr 2019 21:15:42 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 10 Apr 2019 15:23:26 +0200
alarmtimer: Return correct remaining time
To calculate a remaining time, it's required to subtract the current time
from the expiration time. In alarm_timer_remaining() the arguments of
ktime_sub are swapped.
Fixes: d653d8457c76 ("alarmtimer: Implement remaining callback")
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20190408041542.26338-1-avagin@gmail.com
---
kernel/time/alarmtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 2c97e8c2d29f..0519a8805aab 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -594,7 +594,7 @@ static ktime_t alarm_timer_remaining(struct k_itimer *timr, ktime_t now)
{
struct alarm *alarm = &timr->it.alarm.alarmtimer;
- return ktime_sub(now, alarm->node.expires);
+ return ktime_sub(alarm->node.expires, now);
}
/**
^ permalink raw reply related
* Re: [PATCH 00/16] thud-next patch review
From: akuster808 @ 2019-04-10 13:27 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CA+chaQd2dqK4LyTeKRwROvSwtwFC23GO9fWB3GpFTwGz91ytMQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5343 bytes --]
On 4/10/19 3:01 AM, Martin Jansa wrote:
> Please don't forget to include:
> http://lists.openembedded.org/pipermail/openembedded-core/2019-March/280094.html
> and similar one for sumo:
> http://lists.openembedded.org/pipermail/openembedded-core/2019-March/280093.html
> in the next pull.
Thanks for the reminder. My focus on this batch was getting more of the
automated QA bits in.
- armin
> I don't see them included in any thud-next/thud-nmut branches.
>
> On Sun, Apr 7, 2019 at 11:24 AM Armin Kuster <akuster808@gmail.com
> <mailto:akuster808@gmail.com>> wrote:
>
> There are the commit I intend on sending a pull request for in two
> days. Tuesday my timezone (IST)
>
> Please provide feedback by then if there are any issues. This is
> mostly OEQA changes. They have been througt the AB a-full and passed.
>
> The following changes since commit
> 45032e30be70503faeee468159b216031b729309:
>
> build-appliance-image: Update to thud head revision (2019-03-27
> 23:22:49 +0000)
>
> are available in the git repository at:
>
> git://git.openembedded.org/openembedded-core-contrib
> <http://git.openembedded.org/openembedded-core-contrib>
> stable/thud-nmut
> http://cgit.openembedded.org//log/?h=stable/thud-nmut
>
> Armin Kuster (1):
> Revert "boost: update to 1.69.0"
>
> Chen Qi (1):
> pkgdata.py: avoid target-sdk-dummy-provides to mess things up
>
> Mazliana (1):
> oeqa/manual/bsp-hw.json: add non-IA tests
>
> Richard Purdie (2):
> resulttool: Allow store to work on single files
> resulttool: Allow extraction of ptest data
>
> Sudhir Sharma (1):
> oeqa/manual: Add manual runtime 'compliance' testcases to json
>
> Yeoh Ee Peng (6):
> oeqa/manual/toaster: transfer manual toaster test cases to oeqa
> oeqa/manual/toaster: updated test id naming
> resulttool/manualexecution: Standardize input check
> resulttool/manualexecution: Enable display full steps without press
> enter
> resulttool/manualexecution: Fixed step sorted by integer
> resulttool/manualexecution: Refactor and simplify codebase
>
> sangeeta jain (4):
> oeqa/manual/sdk.json: Updated toolchain tarball to core-image-sato
> oeqa/manual/bsp-hw.json: test id updated and obsolete test cases
> removed
> oeqa/manual/compliance-test.json: test id updated and missing test
> cases added
> oeqa/manual/kernel-dev.json: test id updated
>
> meta/lib/oeqa/manual/bsp-hw.json | 264 +-
> meta/lib/oeqa/manual/compliance-test.json | 194 ++
> meta/lib/oeqa/manual/kernel-dev.json | 36 +-
> meta/lib/oeqa/manual/sdk.json | 14 +-
> meta/lib/oeqa/manual/toaster-managed-mode.json | 2572
> ++++++++++++++++++++
> meta/lib/oeqa/manual/toaster-unmanaged-mode.json | 1170 +++++++++
> meta/lib/oeqa/selftest/cases/pkgdata.py | 1 +
> ...bjam-native_1.69.0.bb <http://bjam-native_1.69.0.bb> =>
> bjam-native_1.68.0.bb <http://bjam-native_1.68.0.bb>} | 0
> .../boost/{boost-1.69.0.inc => boost-1.68.0.inc} | 4 +-
> meta/recipes-support/boost/boost.inc | 1 +
> ...-arch-instruction-set-flags-we-do-that-o.patch} | 23 +-
> ...ucibility-add-file-directive-to-assembler.patch | 243 ++
> .../boost/{boost_1.69.0.bb <http://boost_1.69.0.bb> =>
> boost_1.68.0.bb <http://boost_1.68.0.bb>} | 6 +-
> scripts/lib/resulttool/manualexecution.py | 61 +-
> scripts/lib/resulttool/resultutils.py | 39 +-
> scripts/lib/resulttool/store.py | 23 +-
> 16 files changed, 4467 insertions(+), 184 deletions(-)
> create mode 100644 meta/lib/oeqa/manual/compliance-test.json
> create mode 100644 meta/lib/oeqa/manual/toaster-managed-mode.json
> create mode 100644 meta/lib/oeqa/manual/toaster-unmanaged-mode.json
> rename meta/recipes-support/boost/{bjam-native_1.69.0.bb
> <http://bjam-native_1.69.0.bb> => bjam-native_1.68.0.bb
> <http://bjam-native_1.68.0.bb>} (100%)
> rename meta/recipes-support/boost/{boost-1.69.0.inc =>
> boost-1.68.0.inc} (85%)
> rename
> meta/recipes-support/boost/boost/{0001-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch
> =>
> 0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch} (93%)
> create mode 100644
> meta/recipes-support/boost/boost/reproducibility-add-file-directive-to-assembler.patch
> rename meta/recipes-support/boost/{boost_1.69.0.bb
> <http://boost_1.69.0.bb> => boost_1.68.0.bb
> <http://boost_1.68.0.bb>} (56%)
>
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> <mailto:Openembedded-core@lists.openembedded.org>
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 8898 bytes --]
^ permalink raw reply
* Re: [PATCH dev-5.0 0/3] Improve stability of Aspeed video engine driver
From: Joel Stanley @ 2019-04-10 13:26 UTC (permalink / raw)
To: Jae Hyun Yoo; +Cc: Eddie James, Andrew Jeffery, OpenBMC Maillist
In-Reply-To: <20190409192059.1160-1-jae.hyun.yoo@linux.intel.com>
Hi Jae,
On Tue, 9 Apr 2019 at 19:21, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> This patch series improves stability of Aspeed video engine driver by fixing
> clock control and irq handling logic in the driver.
>
> Jae Hyun Yoo (3):
> media: platform: aspeed: fix a kernel warning on clk control
> media: platform: aspeed: refine clock control logic
> media: platform: aspeed: change irq to threaded irq
I had a glance at these patches and they look okay to me. Thanks for
the testing and sending fixes. Can you please send them upstream?
I can apply them to the openbmc tree once we have Eddie's ack.
>
> drivers/media/platform/aspeed-video.c | 75 ++++++++++++++++++++++-----
> 1 file changed, 61 insertions(+), 14 deletions(-)
>
> --
> 2.21.0
>
^ permalink raw reply
* Re: [PATCH] nfs4_getfacl: Add new option -c/--omit-header to not display comment header.
From: J. Bruce Fields @ 2019-04-10 13:26 UTC (permalink / raw)
To: Kenneth Dsouza; +Cc: linux-nfs
In-Reply-To: <CAA_-hQ+fhGCiue4aGZiDtdHy1_grHCnSPa8q8-bMdnxE-PP=AA@mail.gmail.com>
On Wed, Apr 10, 2019 at 03:07:11PM +0530, Kenneth Dsouza wrote:
> On Wed, Apr 10, 2019 at 2:04 AM J. Bruce Fields <bfields@fieldses.org> wrote:
> >
> > Thanks, applying with some fixes:
> >
> > On Tue, Mar 26, 2019 at 07:27:40PM +0530, Kenneth D'souza wrote:
> > > With this patch the filename will not be printed.
> > >
> > > $ nfs4_getfacl /test/
> > > # file: /test/
> > > A::OWNER@:rwaDxtTcCy
> > > A::GROUP@:rwaDxtcy
> > > A::EVERYONE@:rwaDxtcy
> > >
> > > $ nfs4_getfacl -c /test/
> > >
> > > A::OWNER@:rwaDxtTcCy
> > > A::GROUP@:rwaDxtcy
> > > A::EVERYONE@:rwaDxtcy
> >
> > I don't see any reason for that blank line, I've removed it.
> >
> I added the blank line so we print acl for each file on a new line
> when -c is used.
OK, it does make sense to have a blank line between multiple ACLs.
Again I'd rather adopt the same behavior has getfacl/setfacl whenever we
can. Looks like getfacl just appends a blank line regardless of whether
-c is used or whether the are multiple ACLs:
[bfields@patate ~]$ getfacl .
# file: .
# owner: bfields
# group: bfields
user::rwx
group::--x
other::--x
[bfields@patate ~]$
I've added that to print_acl_from_path().
--b.
> # nfs4_getfacl -Rc /test
>
> A::OWNER@:rwaDxtTcCy
> A::GROUP@:rwaDxtcy
> A::EVERYONE@:rwaDxtcy
>
> A::OWNER@:rwatTcCy
> A::GROUP@:tcy
> A::EVERYONE@:tcy
>
> A::OWNER@:rwaDxtTcCy
> A::GROUP@:rxtcy
> A::EVERYONE@:rxtcy
>
>
> > > @@ -115,7 +119,10 @@ static void print_acl_from_path(const char *fpath)
> > > struct nfs4_acl *acl;
> > > acl = nfs4_acl_for_path(fpath);
> > > if (acl != NULL) {
> > > + if(ignore_comment == 0)
> > > printf("\n# file: %s\n", fpath);
> >
> > This needs to be indented.
> >
> > > + else
> > > + printf("\n");
> >
> > I've removed the "else" clause.
> >
> > And fixed a couple minor whitespace issues.
> >
> > --b.
> >
> > > nfs4_print_acl(stdout, acl);
> > > nfs4_free_acl(acl);
> > > }
> > > @@ -125,7 +132,7 @@ static void usage(int label)
> > > {
> > > if (label)
> > > fprintf(stderr, "%s %s -- get NFSv4 file or directory access control lists.\n", execname, VERSION);
> > > - fprintf(stderr, "Usage: %s [-R] file ...\n -H, --more-help\tdisplay ACL format information\n -?, -h, --help\tdisplay this help text\n -R --recursive\trecurse into subdirectories\n", execname);
> > > + fprintf(stderr, "Usage: %s [-R] file ...\n -H, --more-help\tdisplay ACL format information\n -?, -h, --help\tdisplay this help text\n -R --recursive\trecurse into subdirectories\n -c, --omit-header\tDo not display the comment header (Do not print filename)\n", execname);
> > > }
> > >
> > > static void more_help()
> > > --
> > > 2.20.1
^ permalink raw reply
* [meta-filesystems][PATCH v2] fatresize_1.0.2.bb: Add recipe for fatresize command line tool
From: Nathan Rossi @ 2019-04-10 13:25 UTC (permalink / raw)
To: openembedded-devel
The fatresize command line tool provides command line access to the
libparted-fs-resize library implementation of the FAT partition
resizing.
This tool is useful for safely resizing FAT partitions which are
commonly found as the boot partition on a variety of SoC targets (e.g.
RaspberryPi).
The Debian version of the source is used as the original upstream on
SourceForge is no longer actively maintained.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
---
Changes in v2:
- Removed '-git+${SRCPV}' from PV, as SRCREV matches exact version
---
.../recipes-utils/fatresize/fatresize_1.0.2.bb | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 meta-filesystems/recipes-utils/fatresize/fatresize_1.0.2.bb
diff --git a/meta-filesystems/recipes-utils/fatresize/fatresize_1.0.2.bb b/meta-filesystems/recipes-utils/fatresize/fatresize_1.0.2.bb
new file mode 100644
index 0000000000..88d495b685
--- /dev/null
+++ b/meta-filesystems/recipes-utils/fatresize/fatresize_1.0.2.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Resize FAT partitions using libparted"
+SECTION = "console/tools"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "git://salsa.debian.org/parted-team/fatresize.git;protocol=https"
+SRCREV = "3f80afc76ad82d4a1b852a6c8dea24cd9f5e7a24"
+
+PV = "1.0.2-11"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "parted"
+
+inherit autotools pkgconfig
---
2.20.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.