Skip to content

Commit 2b1966c

Browse files
committed
Merge tag 'drm-misc-next-2022-10-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 6.2: UAPI Changes: Cross-subsystem Changes: Core Changes: - connector: Send hotplug event on cleanup - edid: logging/debug improvements - plane_helper: Improve tests Driver Changes: - bridge: - it6505: Synchronization improvements - panel: - panel-edp: Add INX N116BGE-EA2 C2 and C4 support. - nouveau: Fix page-fault handling - vmwgfx: fb and cursor refactoring, convert to generic hashtable Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20221027073407.c2tlaczvzjrnzazi@houat
2 parents 7f7a942 + e1e7bc4 commit 2b1966c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1274
-2309
lines changed

Documentation/gpu/todo.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -651,17 +651,6 @@ See drivers/gpu/drm/amd/display/TODO for tasks.
651651

652652
Contact: Harry Wentland, Alex Deucher
653653

654-
vmwgfx: Replace hashtable with Linux' implementation
655-
----------------------------------------------------
656-
657-
The vmwgfx driver uses its own hashtable implementation. Replace the
658-
code with Linux' implementation and update the callers. It's mostly a
659-
refactoring task, but the interfaces are different.
660-
661-
Contact: Zack Rusin, Thomas Zimmermann <[email protected]>
662-
663-
Level: Intermediate
664-
665654
Bootsplash
666655
==========
667656

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6108,7 +6108,6 @@ static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
61086108
aconnector->base.name);
61096109

61106110
aconnector->base.force = DRM_FORCE_OFF;
6111-
aconnector->base.override_edid = false;
61126111
return;
61136112
}
61146113

@@ -6143,8 +6142,6 @@ static void handle_edid_mgmt(struct amdgpu_dm_connector *aconnector)
61436142
link->verified_link_cap.link_rate = LINK_RATE_HIGH2;
61446143
}
61456144

6146-
6147-
aconnector->base.override_edid = true;
61486145
create_eml_sink(aconnector);
61496146
}
61506147

drivers/gpu/drm/bridge/ite-it6505.c

Lines changed: 51 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ struct it6505 {
412412
* Mutex protects extcon and interrupt functions from interfering
413413
* each other.
414414
*/
415+
struct mutex irq_lock;
415416
struct mutex extcon_lock;
416417
struct mutex mode_lock; /* used to bridge_detect */
417418
struct mutex aux_lock; /* used to aux data transfers */
@@ -440,7 +441,7 @@ struct it6505 {
440441
enum hdcp_state hdcp_status;
441442
struct delayed_work hdcp_work;
442443
struct work_struct hdcp_wait_ksv_list;
443-
struct completion wait_edid_complete;
444+
struct completion extcon_completion;
444445
u8 auto_train_retry;
445446
bool hdcp_desired;
446447
bool is_repeater;
@@ -725,28 +726,6 @@ static void it6505_calc_video_info(struct it6505 *it6505)
725726
DRM_MODE_ARG(&it6505->video_info));
726727
}
727728

728-
static int it6505_drm_dp_link_probe(struct drm_dp_aux *aux,
729-
struct it6505_drm_dp_link *link)
730-
{
731-
u8 values[3];
732-
int err;
733-
734-
memset(link, 0, sizeof(*link));
735-
736-
err = drm_dp_dpcd_read(aux, DP_DPCD_REV, values, sizeof(values));
737-
if (err < 0)
738-
return err;
739-
740-
link->revision = values[0];
741-
link->rate = drm_dp_bw_code_to_link_rate(values[1]);
742-
link->num_lanes = values[2] & DP_MAX_LANE_COUNT_MASK;
743-
744-
if (values[2] & DP_ENHANCED_FRAME_CAP)
745-
link->capabilities = DP_ENHANCED_FRAME_CAP;
746-
747-
return 0;
748-
}
749-
750729
static int it6505_drm_dp_link_set_power(struct drm_dp_aux *aux,
751730
struct it6505_drm_dp_link *link,
752731
u8 mode)
@@ -1456,11 +1435,19 @@ static void it6505_parse_link_capabilities(struct it6505 *it6505)
14561435
int bcaps;
14571436

14581437
if (it6505->dpcd[0] == 0) {
1459-
it6505_aux_on(it6505);
1460-
it6505_get_dpcd(it6505, DP_DPCD_REV, it6505->dpcd,
1461-
ARRAY_SIZE(it6505->dpcd));
1438+
dev_err(dev, "DPCD is not initialized");
1439+
return;
14621440
}
14631441

1442+
memset(link, 0, sizeof(*link));
1443+
1444+
link->revision = it6505->dpcd[0];
1445+
link->rate = drm_dp_bw_code_to_link_rate(it6505->dpcd[1]);
1446+
link->num_lanes = it6505->dpcd[2] & DP_MAX_LANE_COUNT_MASK;
1447+
1448+
if (it6505->dpcd[2] & DP_ENHANCED_FRAME_CAP)
1449+
link->capabilities = DP_ENHANCED_FRAME_CAP;
1450+
14641451
DRM_DEV_DEBUG_DRIVER(dev, "DPCD Rev.: %d.%d",
14651452
link->revision >> 4, link->revision & 0x0F);
14661453

@@ -2323,19 +2310,32 @@ static int it6505_process_hpd_irq(struct it6505 *it6505)
23232310
static void it6505_irq_hpd(struct it6505 *it6505)
23242311
{
23252312
struct device *dev = &it6505->client->dev;
2313+
int dp_sink_count;
23262314

23272315
it6505->hpd_state = it6505_get_sink_hpd_status(it6505);
23282316
DRM_DEV_DEBUG_DRIVER(dev, "hpd change interrupt, change to %s",
23292317
it6505->hpd_state ? "high" : "low");
23302318

2331-
if (it6505->bridge.dev)
2332-
drm_helper_hpd_irq_event(it6505->bridge.dev);
2333-
DRM_DEV_DEBUG_DRIVER(dev, "it6505->sink_count: %d",
2334-
it6505->sink_count);
2335-
23362319
if (it6505->hpd_state) {
2337-
wait_for_completion_timeout(&it6505->wait_edid_complete,
2338-
msecs_to_jiffies(6000));
2320+
wait_for_completion_timeout(&it6505->extcon_completion,
2321+
msecs_to_jiffies(1000));
2322+
it6505_aux_on(it6505);
2323+
if (it6505->dpcd[0] == 0) {
2324+
it6505_get_dpcd(it6505, DP_DPCD_REV, it6505->dpcd,
2325+
ARRAY_SIZE(it6505->dpcd));
2326+
it6505_variable_config(it6505);
2327+
it6505_parse_link_capabilities(it6505);
2328+
}
2329+
it6505->auto_train_retry = AUTO_TRAIN_RETRY;
2330+
2331+
it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link,
2332+
DP_SET_POWER_D0);
2333+
dp_sink_count = it6505_dpcd_read(it6505, DP_SINK_COUNT);
2334+
it6505->sink_count = DP_GET_SINK_COUNT(dp_sink_count);
2335+
2336+
DRM_DEV_DEBUG_DRIVER(dev, "it6505->sink_count: %d",
2337+
it6505->sink_count);
2338+
23392339
it6505_lane_termination_on(it6505);
23402340
it6505_lane_power_on(it6505);
23412341

@@ -2363,6 +2363,9 @@ static void it6505_irq_hpd(struct it6505 *it6505)
23632363
it6505_lane_off(it6505);
23642364
it6505_link_reset_step_train(it6505);
23652365
}
2366+
2367+
if (it6505->bridge.dev)
2368+
drm_helper_hpd_irq_event(it6505->bridge.dev);
23662369
}
23672370

23682371
static void it6505_irq_hpd_irq(struct it6505 *it6505)
@@ -2491,8 +2494,7 @@ static irqreturn_t it6505_int_threaded_handler(int unused, void *data)
24912494
};
24922495
int int_status[3], i;
24932496

2494-
msleep(100);
2495-
mutex_lock(&it6505->extcon_lock);
2497+
mutex_lock(&it6505->irq_lock);
24962498

24972499
if (it6505->enable_drv_hold || !it6505->powered)
24982500
goto unlock;
@@ -2522,7 +2524,7 @@ static irqreturn_t it6505_int_threaded_handler(int unused, void *data)
25222524
}
25232525

25242526
unlock:
2525-
mutex_unlock(&it6505->extcon_lock);
2527+
mutex_unlock(&it6505->irq_lock);
25262528

25272529
return IRQ_HANDLED;
25282530
}
@@ -2625,26 +2627,14 @@ static enum drm_connector_status it6505_detect(struct it6505 *it6505)
26252627
goto unlock;
26262628

26272629
if (it6505->enable_drv_hold) {
2628-
status = it6505_get_sink_hpd_status(it6505) ?
2629-
connector_status_connected :
2630-
connector_status_disconnected;
2630+
status = it6505->hpd_state ? connector_status_connected :
2631+
connector_status_disconnected;
26312632
goto unlock;
26322633
}
26332634

2634-
if (it6505_get_sink_hpd_status(it6505)) {
2635-
it6505_aux_on(it6505);
2636-
it6505_drm_dp_link_probe(&it6505->aux, &it6505->link);
2635+
if (it6505->hpd_state) {
26372636
it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link,
26382637
DP_SET_POWER_D0);
2639-
it6505->auto_train_retry = AUTO_TRAIN_RETRY;
2640-
2641-
if (it6505->dpcd[0] == 0) {
2642-
it6505_get_dpcd(it6505, DP_DPCD_REV, it6505->dpcd,
2643-
ARRAY_SIZE(it6505->dpcd));
2644-
it6505_variable_config(it6505);
2645-
it6505_parse_link_capabilities(it6505);
2646-
}
2647-
26482638
dp_sink_count = it6505_dpcd_read(it6505, DP_SINK_COUNT);
26492639
it6505->sink_count = DP_GET_SINK_COUNT(dp_sink_count);
26502640
DRM_DEV_DEBUG_DRIVER(dev, "it6505->sink_count:%d branch:%d",
@@ -2711,9 +2701,12 @@ static void it6505_extcon_work(struct work_struct *work)
27112701
*/
27122702
if (ret)
27132703
it6505_poweron(it6505);
2704+
2705+
complete_all(&it6505->extcon_completion);
27142706
} else {
27152707
DRM_DEV_DEBUG_DRIVER(dev, "start to power off");
27162708
pm_runtime_put_sync(dev);
2709+
reinit_completion(&it6505->extcon_completion);
27172710

27182711
drm_helper_hpd_irq_event(it6505->bridge.dev);
27192712
memset(it6505->dpcd, 0, sizeof(it6505->dpcd));
@@ -2871,10 +2864,7 @@ static int it6505_bridge_attach(struct drm_bridge *bridge,
28712864
}
28722865

28732866
/* Register aux channel */
2874-
it6505->aux.name = "DP-AUX";
2875-
it6505->aux.dev = dev;
28762867
it6505->aux.drm_dev = bridge->dev;
2877-
it6505->aux.transfer = it6505_aux_transfer;
28782868

28792869
ret = drm_dp_aux_register(&it6505->aux);
28802870

@@ -3287,6 +3277,7 @@ static int it6505_i2c_probe(struct i2c_client *client,
32873277
if (!it6505)
32883278
return -ENOMEM;
32893279

3280+
mutex_init(&it6505->irq_lock);
32903281
mutex_init(&it6505->extcon_lock);
32913282
mutex_init(&it6505->mode_lock);
32923283
mutex_init(&it6505->aux_lock);
@@ -3342,7 +3333,7 @@ static int it6505_i2c_probe(struct i2c_client *client,
33423333
INIT_WORK(&it6505->link_works, it6505_link_training_work);
33433334
INIT_WORK(&it6505->hdcp_wait_ksv_list, it6505_hdcp_wait_ksv_list);
33443335
INIT_DELAYED_WORK(&it6505->hdcp_work, it6505_hdcp_work);
3345-
init_completion(&it6505->wait_edid_complete);
3336+
init_completion(&it6505->extcon_completion);
33463337
memset(it6505->dpcd, 0, sizeof(it6505->dpcd));
33473338
it6505->powered = false;
33483339
it6505->enable_drv_hold = DEFAULT_DRV_HOLD;
@@ -3354,6 +3345,11 @@ static int it6505_i2c_probe(struct i2c_client *client,
33543345
debugfs_init(it6505);
33553346
pm_runtime_enable(dev);
33563347

3348+
it6505->aux.name = "DP-AUX";
3349+
it6505->aux.dev = dev;
3350+
it6505->aux.transfer = it6505_aux_transfer;
3351+
drm_dp_aux_init(&it6505->aux);
3352+
33573353
it6505->bridge.funcs = &it6505_bridge_funcs;
33583354
it6505->bridge.type = DRM_MODE_CONNECTOR_DisplayPort;
33593355
it6505->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID |

drivers/gpu/drm/drm_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static void drm_client_buffer_delete(struct drm_client_buffer *buffer)
235235
{
236236
struct drm_device *dev = buffer->client->dev;
237237

238-
drm_gem_vunmap(buffer->gem, &buffer->map);
238+
drm_gem_vunmap_unlocked(buffer->gem, &buffer->map);
239239

240240
if (buffer->gem)
241241
drm_gem_object_put(buffer->gem);

drivers/gpu/drm/drm_connector.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static int __drm_connector_init(struct drm_device *dev,
274274
INIT_LIST_HEAD(&connector->probed_modes);
275275
INIT_LIST_HEAD(&connector->modes);
276276
mutex_init(&connector->mutex);
277+
mutex_init(&connector->edid_override_mutex);
277278
connector->edid_blob_ptr = NULL;
278279
connector->epoch_counter = 0;
279280
connector->tile_blob_ptr = NULL;
@@ -582,6 +583,9 @@ void drm_connector_cleanup(struct drm_connector *connector)
582583
mutex_destroy(&connector->mutex);
583584

584585
memset(connector, 0, sizeof(*connector));
586+
587+
if (dev->registered)
588+
drm_sysfs_hotplug_event(dev);
585589
}
586590
EXPORT_SYMBOL(drm_connector_cleanup);
587591

drivers/gpu/drm/drm_crtc_internal.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ struct drm_plane;
5656
struct drm_plane_state;
5757
struct drm_property;
5858
struct edid;
59+
struct fwnode_handle;
5960
struct kref;
61+
struct seq_file;
6062
struct work_struct;
61-
struct fwnode_handle;
6263

6364
/* drm_crtc.c */
6465
int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
@@ -286,5 +287,17 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
286287

287288
/* drm_edid.c */
288289
void drm_mode_fixup_1366x768(struct drm_display_mode *mode);
290+
int drm_edid_override_show(struct drm_connector *connector, struct seq_file *m);
289291
int drm_edid_override_set(struct drm_connector *connector, const void *edid, size_t size);
290292
int drm_edid_override_reset(struct drm_connector *connector);
293+
294+
/* drm_edid_load.c */
295+
#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
296+
const struct drm_edid *drm_edid_load_firmware(struct drm_connector *connector);
297+
#else
298+
static inline const struct drm_edid *
299+
drm_edid_load_firmware(struct drm_connector *connector)
300+
{
301+
return ERR_PTR(-ENOENT);
302+
}
303+
#endif

drivers/gpu/drm/drm_debugfs.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,7 @@ static ssize_t connector_write(struct file *file, const char __user *ubuf,
328328

329329
static int edid_show(struct seq_file *m, void *data)
330330
{
331-
struct drm_connector *connector = m->private;
332-
struct drm_property_blob *edid = connector->edid_blob_ptr;
333-
334-
if (connector->override_edid && edid)
335-
seq_write(m, edid->data, edid->length);
336-
337-
return 0;
331+
return drm_edid_override_show(m->private, m);
338332
}
339333

340334
static int edid_open(struct inode *inode, struct file *file)

0 commit comments

Comments
 (0)