Skip to content

Commit c103b85

Browse files
committed
Merge tag 'drm-misc-next-2021-04-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.13: UAPI Changes: Cross-subsystem Changes: Core Changes: - bridge: Fix Kconfig dependency - cmdline: Refuse zero width/height mode - ttm: Ignore signaled move fences, ioremap buffer according to mem caching settins Driver Changes: - Conversions to sysfs_emit - tegra: Don't register DP AUX channels before connectors - zynqmp: Fix for an out-of-bound (but within struct padding) memset Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20210409090020.jroa2d4p4qansrpa@gilmour
2 parents 9c0fed8 + e8b8b0d commit c103b85

22 files changed

+142
-73
lines changed

drivers/dma-buf/dma-fence.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ static const struct dma_fence_ops dma_fence_stub_ops = {
123123
/**
124124
* dma_fence_get_stub - return a signaled fence
125125
*
126-
* Return a stub fence which is already signaled.
126+
* Return a stub fence which is already signaled. The fence's
127+
* timestamp corresponds to the first time after boot this
128+
* function is called.
127129
*/
128130
struct dma_fence *dma_fence_get_stub(void)
129131
{
@@ -141,6 +143,29 @@ struct dma_fence *dma_fence_get_stub(void)
141143
}
142144
EXPORT_SYMBOL(dma_fence_get_stub);
143145

146+
/**
147+
* dma_fence_allocate_private_stub - return a private, signaled fence
148+
*
149+
* Return a newly allocated and signaled stub fence.
150+
*/
151+
struct dma_fence *dma_fence_allocate_private_stub(void)
152+
{
153+
struct dma_fence *fence;
154+
155+
fence = kzalloc(sizeof(*fence), GFP_KERNEL);
156+
if (fence == NULL)
157+
return ERR_PTR(-ENOMEM);
158+
159+
dma_fence_init(fence,
160+
&dma_fence_stub_ops,
161+
&dma_fence_stub_lock,
162+
0, 0);
163+
dma_fence_signal(fence);
164+
165+
return fence;
166+
}
167+
EXPORT_SYMBOL(dma_fence_allocate_private_stub);
168+
144169
/**
145170
* dma_fence_context_alloc - allocate an array of fence contexts
146171
* @num: amount of contexts to allocate

drivers/gpu/drm/arm/display/include/malidp_utils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#define has_bit(nr, mask) (BIT(nr) & (mask))
1414
#define has_bits(bits, mask) (((bits) & (mask)) == (bits))
1515

16-
#define dp_for_each_set_bit(bit, mask) \
17-
for_each_set_bit((bit), ((unsigned long *)&(mask)), sizeof(mask) * 8)
18-
1916
#define dp_wait_cond(__cond, __tries, __min_range, __max_range) \
2017
({ \
2118
int num_tries = __tries; \

drivers/gpu/drm/arm/display/komeda/komeda_dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ core_id_show(struct device *dev, struct device_attribute *attr, char *buf)
6262
{
6363
struct komeda_dev *mdev = dev_to_mdev(dev);
6464

65-
return snprintf(buf, PAGE_SIZE, "0x%08x\n", mdev->chip.core_id);
65+
return sysfs_emit(buf, "0x%08x\n", mdev->chip.core_id);
6666
}
6767
static DEVICE_ATTR_RO(core_id);
6868

@@ -85,7 +85,7 @@ config_id_show(struct device *dev, struct device_attribute *attr, char *buf)
8585
if (pipe->layers[i]->layer_type == KOMEDA_FMT_RICH_LAYER)
8686
config_id.n_richs++;
8787
}
88-
return snprintf(buf, PAGE_SIZE, "0x%08x\n", config_id.value);
88+
return sysfs_emit(buf, "0x%08x\n", config_id.value);
8989
}
9090
static DEVICE_ATTR_RO(config_id);
9191

@@ -94,7 +94,7 @@ aclk_hz_show(struct device *dev, struct device_attribute *attr, char *buf)
9494
{
9595
struct komeda_dev *mdev = dev_to_mdev(dev);
9696

97-
return snprintf(buf, PAGE_SIZE, "%lu\n", clk_get_rate(mdev->aclk));
97+
return sysfs_emit(buf, "%lu\n", clk_get_rate(mdev->aclk));
9898
}
9999
static DEVICE_ATTR_RO(aclk_hz);
100100

drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ void komeda_pipeline_destroy(struct komeda_dev *mdev,
4646
{
4747
struct komeda_component *c;
4848
int i;
49+
unsigned long avail_comps = pipe->avail_comps;
4950

50-
dp_for_each_set_bit(i, pipe->avail_comps) {
51+
for_each_set_bit(i, &avail_comps, 32) {
5152
c = komeda_pipeline_get_component(pipe, i);
5253
komeda_component_destroy(mdev, c);
5354
}
@@ -247,6 +248,7 @@ static void komeda_pipeline_dump(struct komeda_pipeline *pipe)
247248
{
248249
struct komeda_component *c;
249250
int id;
251+
unsigned long avail_comps = pipe->avail_comps;
250252

251253
DRM_INFO("Pipeline-%d: n_layers: %d, n_scalers: %d, output: %s.\n",
252254
pipe->id, pipe->n_layers, pipe->n_scalers,
@@ -258,7 +260,7 @@ static void komeda_pipeline_dump(struct komeda_pipeline *pipe)
258260
pipe->of_output_links[1] ?
259261
pipe->of_output_links[1]->full_name : "none");
260262

261-
dp_for_each_set_bit(id, pipe->avail_comps) {
263+
for_each_set_bit(id, &avail_comps, 32) {
262264
c = komeda_pipeline_get_component(pipe, id);
263265

264266
komeda_component_dump(c);
@@ -270,8 +272,9 @@ static void komeda_component_verify_inputs(struct komeda_component *c)
270272
struct komeda_pipeline *pipe = c->pipeline;
271273
struct komeda_component *input;
272274
int id;
275+
unsigned long supported_inputs = c->supported_inputs;
273276

274-
dp_for_each_set_bit(id, c->supported_inputs) {
277+
for_each_set_bit(id, &supported_inputs, 32) {
275278
input = komeda_pipeline_get_component(pipe, id);
276279
if (!input) {
277280
c->supported_inputs &= ~(BIT(id));
@@ -302,8 +305,9 @@ static void komeda_pipeline_assemble(struct komeda_pipeline *pipe)
302305
struct komeda_component *c;
303306
struct komeda_layer *layer;
304307
int i, id;
308+
unsigned long avail_comps = pipe->avail_comps;
305309

306-
dp_for_each_set_bit(id, pipe->avail_comps) {
310+
for_each_set_bit(id, &avail_comps, 32) {
307311
c = komeda_pipeline_get_component(pipe, id);
308312
komeda_component_verify_inputs(c);
309313
}
@@ -355,13 +359,15 @@ void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,
355359
{
356360
struct komeda_component *c;
357361
u32 id;
362+
unsigned long avail_comps;
358363

359364
seq_printf(sf, "\n======== Pipeline-%d ==========\n", pipe->id);
360365

361366
if (pipe->funcs && pipe->funcs->dump_register)
362367
pipe->funcs->dump_register(pipe, sf);
363368

364-
dp_for_each_set_bit(id, pipe->avail_comps) {
369+
avail_comps = pipe->avail_comps;
370+
for_each_set_bit(id, &avail_comps, 32) {
365371
c = komeda_pipeline_get_component(pipe, id);
366372

367373
seq_printf(sf, "\n------%s------\n", c->name);

drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,14 +1231,15 @@ komeda_pipeline_unbound_components(struct komeda_pipeline *pipe,
12311231
struct komeda_pipeline_state *old = priv_to_pipe_st(pipe->obj.state);
12321232
struct komeda_component_state *c_st;
12331233
struct komeda_component *c;
1234-
u32 disabling_comps, id;
1234+
u32 id;
1235+
unsigned long disabling_comps;
12351236

12361237
WARN_ON(!old);
12371238

12381239
disabling_comps = (~new->active_comps) & old->active_comps;
12391240

12401241
/* unbound all disabling component */
1241-
dp_for_each_set_bit(id, disabling_comps) {
1242+
for_each_set_bit(id, &disabling_comps, 32) {
12421243
c = komeda_pipeline_get_component(pipe, id);
12431244
c_st = komeda_component_get_state_and_set_user(c,
12441245
drm_st, NULL, new->crtc);
@@ -1286,7 +1287,8 @@ bool komeda_pipeline_disable(struct komeda_pipeline *pipe,
12861287
struct komeda_pipeline_state *old;
12871288
struct komeda_component *c;
12881289
struct komeda_component_state *c_st;
1289-
u32 id, disabling_comps = 0;
1290+
u32 id;
1291+
unsigned long disabling_comps;
12901292

12911293
old = komeda_pipeline_get_old_state(pipe, old_state);
12921294

@@ -1296,10 +1298,10 @@ bool komeda_pipeline_disable(struct komeda_pipeline *pipe,
12961298
disabling_comps = old->active_comps &
12971299
pipe->standalone_disabled_comps;
12981300

1299-
DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, disabling_comps: 0x%x.\n",
1301+
DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, disabling_comps: 0x%lx.\n",
13001302
pipe->id, old->active_comps, disabling_comps);
13011303

1302-
dp_for_each_set_bit(id, disabling_comps) {
1304+
for_each_set_bit(id, &disabling_comps, 32) {
13031305
c = komeda_pipeline_get_component(pipe, id);
13041306
c_st = priv_to_comp_st(c->obj.state);
13051307

@@ -1330,16 +1332,17 @@ void komeda_pipeline_update(struct komeda_pipeline *pipe,
13301332
struct komeda_pipeline_state *new = priv_to_pipe_st(pipe->obj.state);
13311333
struct komeda_pipeline_state *old;
13321334
struct komeda_component *c;
1333-
u32 id, changed_comps = 0;
1335+
u32 id;
1336+
unsigned long changed_comps;
13341337

13351338
old = komeda_pipeline_get_old_state(pipe, old_state);
13361339

13371340
changed_comps = new->active_comps | old->active_comps;
13381341

1339-
DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, changed: 0x%x.\n",
1342+
DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, changed: 0x%lx.\n",
13401343
pipe->id, new->active_comps, changed_comps);
13411344

1342-
dp_for_each_set_bit(id, changed_comps) {
1345+
for_each_set_bit(id, &changed_comps, 32) {
13431346
c = komeda_pipeline_get_component(pipe, id);
13441347

13451348
if (new->active_comps & BIT(c->id))

drivers/gpu/drm/bridge/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ config DRM_DISPLAY_CONNECTOR
5555
depends on OF
5656
help
5757
Driver for display connectors with support for DDC and hot-plug
58-
detection. Most display controller handle display connectors
58+
detection. Most display controllers handle display connectors
5959
internally and don't need this driver, but the DRM subsystem is
6060
moving towards separating connector handling from display controllers
6161
on ARM-based platforms. Saying Y here when this driver is not needed
@@ -210,6 +210,7 @@ config DRM_TOSHIBA_TC358762
210210
tristate "TC358762 DSI/DPI bridge"
211211
depends on OF
212212
select DRM_MIPI_DSI
213+
select DRM_KMS_HELPER
213214
select DRM_PANEL_BRIDGE
214215
help
215216
Toshiba TC358762 DSI/DPI bridge driver.

drivers/gpu/drm/bridge/lontium-lt8912b.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <linux/device.h>
77
#include <linux/delay.h>
8+
#include <linux/gpio/consumer.h>
89
#include <linux/i2c.h>
910
#include <linux/gpio.h>
1011
#include <linux/of_gpio.h>

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4109,10 +4109,9 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
41094109
return 0;
41104110

41114111
up_req = kzalloc(sizeof(*up_req), GFP_KERNEL);
4112-
if (!up_req) {
4113-
DRM_ERROR("Not enough memory to process MST up req\n");
4112+
if (!up_req)
41144113
return -ENOMEM;
4115-
}
4114+
41164115
INIT_LIST_HEAD(&up_req->next);
41174116

41184117
drm_dp_sideband_parse_req(&mgr->up_req_recv, &up_req->msg);

drivers/gpu/drm/drm_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ void drm_sysfs_connector_remove(struct drm_connector *connector);
170170
void drm_sysfs_lease_event(struct drm_device *dev);
171171

172172
/* drm_gem.c */
173-
struct drm_gem_object;
174173
int drm_gem_init(struct drm_device *dev);
175174
int drm_gem_handle_create_tail(struct drm_file *file_priv,
176175
struct drm_gem_object *obj,

drivers/gpu/drm/drm_modes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,9 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev,
18641864
{
18651865
struct drm_display_mode *mode;
18661866

1867+
if (cmd->xres == 0 || cmd->yres == 0)
1868+
return NULL;
1869+
18671870
if (cmd->cvt)
18681871
mode = drm_cvt_mode(dev,
18691872
cmd->xres, cmd->yres,

0 commit comments

Comments
 (0)