History

Merge tag 'topic/drm-misc-2016-04-21' of git://anongit.freedesktop.org/drm-intel into drm-next

misc pull req all over. Biggest thing is the drm_connector_(un)register_all cleanup from Alexey for drivers without the load/unload midlayer hooks. I.e. all the new ones, and a bunch of the pending new atomic drivers depend upon this. Or at least I asked them to rebase ;-) * tag 'topic/drm-misc-2016-04-21' of git://anongit.freedesktop.org/drm-intel: drm: Make drm.debug parameter description more helpful drm: Remove warning from drm_connector_unregister_all() drm: probe_helper: Hide ugly ifdef drm: rcar-du: Use generic drm_connector_register_all() helper drm: atmel_hldc: Use generic drm_connector_register_all() helper drm: Introduce drm_connector_register_all() helper drm: fix lut value extraction function drm/atomic-helper: Print an error if vblank wait times out drm/dp/mst: Restore primary hub guid on resume drm: Release driver references to handle before making it available again drm/i915/dp/mst: Add source port info to debugfs output drm/dp/mst: Enhance DP MST debugfs output drm/edid: Add drm_edid_get_monitor_name() include/drm: Reword debug categories comment. drm/crtc_helper: Reset empty plane state in drm_helper_crtc_mode_set_base() drm/virtio: Drop dummy gamma table support drm/bochs: Drop fake gamma support drm/core: Fix ordering in drm_mode_config_cleanup.

Dave Airlie committed 10 years ago

Commit d57d4772 parents f230ffa 6dc3e2217 files · +183 −113Browse files

Unified · Split

17 files
  1. drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 −29
  2. drivers/gpu/drm/bochs/bochs_fbdev.c +0 −15
  3. drivers/gpu/drm/bochs/bochs_kms.c +0 −7
  4. drivers/gpu/drm/drm_atomic_helper.c +2 −0
  5. drivers/gpu/drm/drm_crtc.c +50 −10
  6. drivers/gpu/drm/drm_crtc_helper.c +5 −3
  7. drivers/gpu/drm/drm_dp_mst_topology.c +36 −5
  8. drivers/gpu/drm/drm_drv.c +17 −3
  9. drivers/gpu/drm/drm_edid.c +42 −9
  10. drivers/gpu/drm/drm_gem.c +8 −8
  11. drivers/gpu/drm/drm_probe_helper.c +0 −2
  12. drivers/gpu/drm/i915/i915_debugfs.c +2 −1
  13. drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 −8
  14. drivers/gpu/drm/virtio/virtgpu_display.c +0 −9
  15. include/drm/drmP.h +1 −1
  16. include/drm/drm_crtc.h +10 −3
  17. include/drm/drm_edid.h +8 −0
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c+1−29
@@ -584,34 +584,6 @@ static void atmel_hlcdc_dc_unload(struct drm_device *dev) · 583 unmodified lines
584584 destroy_workqueue(dc->wq);
585585 }
586586
587−static int atmel_hlcdc_dc_connector_plug_all(struct drm_device *dev)
588−{
589− struct drm_connector *connector, *failed;
590− int ret;
591−
592− mutex_lock(&dev->mode_config.mutex);
593− list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
594− ret = drm_connector_register(connector);
595− if (ret) {
596− failed = connector;
597− goto err;
598− }
599− }
600− mutex_unlock(&dev->mode_config.mutex);
601− return 0;
602−
603−err:
604− list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
605− if (failed == connector)
606− break;
607−
608− drm_connector_unregister(connector);
609− }
610− mutex_unlock(&dev->mode_config.mutex);
611−
612− return ret;
613−}
614−
615587 static void atmel_hlcdc_dc_connector_unplug_all(struct drm_device *dev)
616588 {
617589 mutex_lock(&dev->mode_config.mutex);
@@ -736,7 +708,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) · 118 unmodified lines
736708 if (ret)
737709 goto err_unload;
738710
739− ret = atmel_hlcdc_dc_connector_plug_all(ddev);
711+ ret = drm_connector_register_all(ddev);
740712 if (ret)
741713 goto err_unregister;
742714
drivers/gpu/drm/bochs/bochs_fbdev.c+0−15
@@ -162,22 +162,7 @@ static int bochs_fbdev_destroy(struct bochs_device *bochs) · 161 unmodified lines
162162 return 0;
163163 }
164164
165−void bochs_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
166− u16 blue, int regno)
167−{
168−}
169−
170−void bochs_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
171− u16 *blue, int regno)
172−{
173− *red = regno;
174− *green = regno;
175− *blue = regno;
176−}
177−
178165 static const struct drm_fb_helper_funcs bochs_fb_helper_funcs = {
179− .gamma_set = bochs_fb_gamma_set,
180− .gamma_get = bochs_fb_gamma_get,
181166 .fb_probe = bochsfb_create,
182167 };
183168
drivers/gpu/drm/bochs/bochs_kms.c+0−7
@@ -93,11 +93,6 @@ static void bochs_crtc_commit(struct drm_crtc *crtc) · 92 unmodified lines
9393 {
9494 }
9595
96−static void bochs_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
97− u16 *blue, uint32_t start, uint32_t size)
98−{
99−}
100−
10196 static int bochs_crtc_page_flip(struct drm_crtc *crtc,
10297 struct drm_framebuffer *fb,
10398 struct drm_pending_vblank_event *event,
@@ -120,7 +115,6 @@ static int bochs_crtc_page_flip(struct drm_crtc *crtc, · 16 unmodified lines
120115
121116 /* These provide the minimum set of functions required to handle a CRTC */
122117 static const struct drm_crtc_funcs bochs_crtc_funcs = {
123− .gamma_set = bochs_crtc_gamma_set,
124118 .set_config = drm_crtc_helper_set_config,
125119 .destroy = drm_crtc_cleanup,
126120 .page_flip = bochs_crtc_page_flip,
@@ -140,7 +134,6 @@ static void bochs_crtc_init(struct drm_device *dev) · 13 unmodified lines
140134 struct drm_crtc *crtc = &bochs->crtc;
141135
142136 drm_crtc_init(dev, crtc, &bochs_crtc_funcs);
143− drm_mode_crtc_set_gamma_size(crtc, 256);
144137 drm_crtc_helper_add(crtc, &bochs_helper_funcs);
145138 }
146139
drivers/gpu/drm/drm_atomic_helper.c+2−0
@@ -1103,6 +1103,8 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, · 1102 unmodified lines
11031103 drm_crtc_vblank_count(crtc),
11041104 msecs_to_jiffies(50));
11051105
1106+ WARN(!ret, "[CRTC:%d] vblank wait timed out\n", crtc->base.id);
1107+
11061108 drm_crtc_vblank_put(crtc);
11071109 }
11081110 }
drivers/gpu/drm/drm_crtc.c+50−10
@@ -1067,6 +1067,46 @@ void drm_connector_unregister(struct drm_connector *connector) · 1066 unmodified lines
10671067 }
10681068 EXPORT_SYMBOL(drm_connector_unregister);
10691069
1070+/**
1071+ * drm_connector_register_all - register all connectors
1072+ * @dev: drm device
1073+ *
1074+ * This function registers all connectors in sysfs and other places so that
1075+ * userspace can start to access them. Drivers can call it after calling
1076+ * drm_dev_register() to complete the device registration, if they don't call
1077+ * drm_connector_register() on each connector individually.
1078+ *
1079+ * When a device is unplugged and should be removed from userspace access,
1080+ * call drm_connector_unregister_all(), which is the inverse of this
1081+ * function.
1082+ *
1083+ * Returns:
1084+ * Zero on success, error code on failure.
1085+ */
1086+int drm_connector_register_all(struct drm_device *dev)
1087+{
1088+ struct drm_connector *connector;
1089+ int ret;
1090+
1091+ mutex_lock(&dev->mode_config.mutex);
1092+
1093+ drm_for_each_connector(connector, dev) {
1094+ ret = drm_connector_register(connector);
1095+ if (ret)
1096+ goto err;
1097+ }
1098+
1099+ mutex_unlock(&dev->mode_config.mutex);
1100+
1101+ return 0;
1102+
1103+err:
1104+ mutex_unlock(&dev->mode_config.mutex);
1105+ drm_connector_unregister_all(dev);
1106+ return ret;
1107+}
1108+EXPORT_SYMBOL(drm_connector_register_all);
1109+
10701110 /**
10711111 * drm_connector_unregister_all - unregister connector userspace interfaces
10721112 * @dev: drm device
@@ -1082,7 +1122,7 @@ void drm_connector_unregister_all(struct drm_device *dev) · 9 unmodified lines
10821122 struct drm_connector *connector;
10831123
10841124 /* FIXME: taking the mode config mutex ends up in a clash with sysfs */
1085− drm_for_each_connector(connector, dev)
1125+ list_for_each_entry(connector, &dev->mode_config.connector_list, head)
10861126 drm_connector_unregister(connector);
10871127 }
10881128 EXPORT_SYMBOL(drm_connector_unregister_all);
@@ -5914,6 +5954,15 @@ void drm_mode_config_cleanup(struct drm_device *dev) · 4825 unmodified lines
59145954 drm_property_destroy(dev, property);
59155955 }
59165956
5957+ list_for_each_entry_safe(plane, plt, &dev->mode_config.plane_list,
5958+ head) {
5959+ plane->funcs->destroy(plane);
5960+ }
5961+
5962+ list_for_each_entry_safe(crtc, ct, &dev->mode_config.crtc_list, head) {
5963+ crtc->funcs->destroy(crtc);
5964+ }
5965+
59175966 list_for_each_entry_safe(blob, bt, &dev->mode_config.property_blob_list,
59185967 head_global) {
59195968 drm_property_unreference_blob(blob);
@@ -5932,15 +5981,6 @@ void drm_mode_config_cleanup(struct drm_device *dev) · 12 unmodified lines
59325981 drm_framebuffer_free(&fb->refcount);
59335982 }
59345983
5935− list_for_each_entry_safe(plane, plt, &dev->mode_config.plane_list,
5936− head) {
5937− plane->funcs->destroy(plane);
5938− }
5939−
5940− list_for_each_entry_safe(crtc, ct, &dev->mode_config.crtc_list, head) {
5941− crtc->funcs->destroy(crtc);
5942− }
5943−
59445984 ida_destroy(&dev->mode_config.connector_ida);
59455985 idr_destroy(&dev->mode_config.tile_idr);
59465986 idr_destroy(&dev->mode_config.crtc_idr);
drivers/gpu/drm/drm_crtc_helper.c+5−3
@@ -1053,10 +1053,12 @@ int drm_helper_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, · 1052 unmodified lines
10531053
10541054 if (plane->funcs->atomic_duplicate_state)
10551055 plane_state = plane->funcs->atomic_duplicate_state(plane);
1056− else if (plane->state)
1056+ else {
1057+ if (!plane->state)
1058+ drm_atomic_helper_plane_reset(plane);
1059+
10571060 plane_state = drm_atomic_helper_plane_duplicate_state(plane);
1058− else
1059− plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL);
1061+ }
10601062 if (!plane_state)
10611063 return -ENOMEM;
10621064 plane_state->plane = plane;
drivers/gpu/drm/drm_dp_mst_topology.c+36−5
@@ -2121,6 +2121,8 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr) · 2120 unmodified lines
21212121
21222122 if (mgr->mst_primary) {
21232123 int sret;
2124+ u8 guid[16];
2125+
21242126 sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE);
21252127 if (sret != DP_RECEIVER_CAP_SIZE) {
21262128 DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
@@ -2135,6 +2137,16 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr) · 8 unmodified lines
21352137 ret = -1;
21362138 goto out_unlock;
21372139 }
2140+
2141+ /* Some hubs forget their guids after they resume */
2142+ sret = drm_dp_dpcd_read(mgr->aux, DP_GUID, guid, 16);
2143+ if (sret != 16) {
2144+ DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
2145+ ret = -1;
2146+ goto out_unlock;
2147+ }
2148+ drm_dp_check_mstb_guid(mgr->mst_primary, guid);
2149+
21382150 ret = 0;
21392151 } else
21402152 ret = -1;
@@ -2729,7 +2741,7 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, · 588 unmodified lines
27292741
27302742 seq_printf(m, "%smst: %p, %d\n", prefix, mstb, mstb->num_ports);
27312743 list_for_each_entry(port, &mstb->ports, next) {
2732− seq_printf(m, "%sport: %d: ddps: %d ldps: %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->ddps, port->ldps, port->num_sdp_streams, port->num_sdp_stream_sinks, port, port->connector);
2744+ seq_printf(m, "%sport: %d: input: %d: pdt: %d, ddps: %d ldps: %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->input, port->pdt, port->ddps, port->ldps, port->num_sdp_streams, port->num_sdp_stream_sinks, port, port->connector);
27332745 if (port->mstb)
27342746 drm_dp_mst_dump_mstb(m, port->mstb);
27352747 }
@@ -2750,6 +2762,16 @@ static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, · 14 unmodified lines
27502762 return false;
27512763 }
27522764
2765+static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
2766+ struct drm_dp_mst_port *port, char *name,
2767+ int namelen)
2768+{
2769+ struct edid *mst_edid;
2770+
2771+ mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
2772+ drm_edid_get_monitor_name(mst_edid, name, namelen);
2773+}
2774+
27532775 /**
27542776 * drm_dp_mst_dump_topology(): dump topology to seq file.
27552777 * @m: seq_file to dump output to
@@ -2762,6 +2784,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, · 6 unmodified lines
27622784 {
27632785 int i;
27642786 struct drm_dp_mst_port *port;
2787+
27652788 mutex_lock(&mgr->lock);
27662789 if (mgr->mst_primary)
27672790 drm_dp_mst_dump_mstb(m, mgr->mst_primary);
@@ -2770,14 +2793,21 @@ void drm_dp_mst_dump_topology(struct seq_file *m, · 2 unmodified lines
27702793 mutex_unlock(&mgr->lock);
27712794
27722795 mutex_lock(&mgr->payload_lock);
2773− seq_printf(m, "vcpi: %lx %lx\n", mgr->payload_mask, mgr->vcpi_mask);
2796+ seq_printf(m, "vcpi: %lx %lx %d\n", mgr->payload_mask, mgr->vcpi_mask,
2797+ mgr->max_payloads);
27742798
27752799 for (i = 0; i < mgr->max_payloads; i++) {
27762800 if (mgr->proposed_vcpis[i]) {
2801+ char name[14];
2802+
27772803 port = container_of(mgr->proposed_vcpis[i], struct drm_dp_mst_port, vcpi);
2778− seq_printf(m, "vcpi %d: %d %d %d\n", i, port->port_num, port->vcpi.vcpi, port->vcpi.num_slots);
2804+ fetch_monitor_name(mgr, port, name, sizeof(name));
2805+ seq_printf(m, "vcpi %d: %d %d %d sink name: %s\n", i,
2806+ port->port_num, port->vcpi.vcpi,
2807+ port->vcpi.num_slots,
2808+ (*name != 0) ? name : "Unknown");
27792809 } else
2780− seq_printf(m, "vcpi %d:unsed\n", i);
2810+ seq_printf(m, "vcpi %d:unused\n", i);
27812811 }
27822812 for (i = 0; i < mgr->max_payloads; i++) {
27832813 seq_printf(m, "payload %d: %d, %d, %d\n",
@@ -2817,8 +2847,9 @@ void drm_dp_mst_dump_topology(struct seq_file *m, · 33 unmodified lines
28172847 for (i = 0; i < 0x3; i++)
28182848 seq_printf(m, "%02x", buf[i]);
28192849 seq_printf(m, " devid: ");
2820− for (i = 0x3; i < 0x8; i++)
2850+ for (i = 0x3; i < 0x8 && buf[i]; i++)
28212851 seq_printf(m, "%c", buf[i]);
2852+
28222853 seq_printf(m, " revision: hw: %x.%x sw: %x.%x", buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]);
28232854 seq_printf(m, "\n");
28242855 bret = dump_dp_payload_table(mgr, buf);
drivers/gpu/drm/drm_drv.c+17−3
@@ -37,13 +37,23 @@ · 36 unmodified lines
3737 #include "drm_legacy.h"
3838 #include "drm_internal.h"
3939
40−unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */
40+/*
41+ * drm_debug: Enable debug output.
42+ * Bitmask of DRM_UT_x. See include/drm/drmP.h for details.
43+ */
44+unsigned int drm_debug = 0;
4145 EXPORT_SYMBOL(drm_debug);
4246
4347 MODULE_AUTHOR(CORE_AUTHOR);
4448 MODULE_DESCRIPTION(CORE_DESC);
4549 MODULE_LICENSE("GPL and additional rights");
46−MODULE_PARM_DESC(debug, "Enable debug output");
50+MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n"
51+"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n"
52+"\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n"
53+"\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n"
54+"\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n"
55+"\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n"
56+"\t\tBit 5 (0x20) will enable VBL messages (vblank code)");
4757 module_param_named(debug, drm_debug, int, 0600);
4858
4959 static DEFINE_SPINLOCK(drm_minor_lock);
@@ -715,7 +725,11 @@ EXPORT_SYMBOL(drm_dev_unref); · 665 unmodified lines
715725 *
716726 * Register the DRM device @dev with the system, advertise device to user-space
717727 * and start normal device operation. @dev must be allocated via drm_dev_alloc()
718− * previously.
728+ * previously. Right after drm_dev_register() the driver should call
729+ * drm_connector_register_all() to register all connectors in sysfs. This is
730+ * a separate call for backward compatibility with drivers still using
731+ * the deprecated ->load() callback, where connectors are registered from within
732+ * the ->load() callback.
719733 *
720734 * Never call this twice on any device!
721735 *
drivers/gpu/drm/drm_edid.c+42−9
@@ -3293,6 +3293,46 @@ monitor_name(struct detailed_timing *t, void *data) · 3292 unmodified lines
32933293 *(u8 **)data = t->data.other_data.data.str.str;
32943294 }
32953295
3296+static int get_monitor_name(struct edid *edid, char name[13])
3297+{
3298+ char *edid_name = NULL;
3299+ int mnl;
3300+
3301+ if (!edid || !name)
3302+ return 0;
3303+
3304+ drm_for_each_detailed_block((u8 *)edid, monitor_name, &edid_name);
3305+ for (mnl = 0; edid_name && mnl < 13; mnl++) {
3306+ if (edid_name[mnl] == 0x0a)
3307+ break;
3308+
3309+ name[mnl] = edid_name[mnl];
3310+ }
3311+
3312+ return mnl;
3313+}
3314+
3315+/**
3316+ * drm_edid_get_monitor_name - fetch the monitor name from the edid
3317+ * @edid: monitor EDID information
3318+ * @name: pointer to a character array to hold the name of the monitor
3319+ * @bufsize: The size of the name buffer (should be at least 14 chars.)
3320+ *
3321+ */
3322+void drm_edid_get_monitor_name(struct edid *edid, char *name, int bufsize)
3323+{
3324+ int name_length;
3325+ char buf[13];
3326+
3327+ if (bufsize <= 0)
3328+ return;
3329+
3330+ name_length = min(get_monitor_name(edid, buf), bufsize - 1);
3331+ memcpy(name, buf, name_length);
3332+ name[name_length] = '\0';
3333+}
3334+EXPORT_SYMBOL(drm_edid_get_monitor_name);
3335+
32963336 /**
32973337 * drm_edid_to_eld - build ELD from EDID
32983338 * @connector: connector corresponding to the HDMI/DP sink
@@ -3306,7 +3346,6 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) · 7 unmodified lines
33063346 {
33073347 uint8_t *eld = connector->eld;
33083348 u8 *cea;
3309− u8 *name;
33103349 u8 *db;
33113350 int total_sad_count = 0;
33123351 int mnl;
@@ -3320,14 +3359,8 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) · 7 unmodified lines
33203359 return;
33213360 }
33223361
3323− name = NULL;
3324− drm_for_each_detailed_block((u8 *)edid, monitor_name, &name);
3325− /* max: 13 bytes EDID, 16 bytes ELD */
3326− for (mnl = 0; name && mnl < 13; mnl++) {
3327− if (name[mnl] == 0x0a)
3328− break;
3329− eld[20 + mnl] = name[mnl];
3330− }
3362+ mnl = get_monitor_name(edid, eld + 20);
3363+
33313364 eld[4] = (cea[1] << 5) | mnl;
33323365 DRM_DEBUG_KMS("ELD monitor %s\n", eld + 20);
33333366
drivers/gpu/drm/drm_gem.c+8−8
@@ -279,7 +279,6 @@ drm_gem_object_release_handle(int id, void *ptr, void *data) · 278 unmodified lines
279279 int
280280 drm_gem_handle_delete(struct drm_file *filp, u32 handle)
281281 {
282− struct drm_device *dev;
283282 struct drm_gem_object *obj;
284283
285284 /* This is gross. The idr system doesn't let us try a delete and
@@ -294,18 +293,19 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) · 8 unmodified lines
294293 spin_lock(&filp->table_lock);
295294
296295 /* Check if we currently have a reference on the object */
297− obj = idr_find(&filp->object_idr, handle);
298− if (obj == NULL) {
299− spin_unlock(&filp->table_lock);
296+ obj = idr_replace(&filp->object_idr, NULL, handle);
297+ spin_unlock(&filp->table_lock);
298+ if (IS_ERR_OR_NULL(obj))
300299 return -EINVAL;
301− }
302− dev = obj->dev;
303300
304− /* Release reference and decrement refcount. */
301+ /* Release driver's reference and decrement refcount. */
302+ drm_gem_object_release_handle(handle, obj, filp);
303+
304+ /* And finally make the handle available for future allocations. */
305+ spin_lock(&filp->table_lock);
305306 idr_remove(&filp->object_idr, handle);
306307 spin_unlock(&filp->table_lock);
307308
308− drm_gem_object_release_handle(handle, obj, filp);
309309 return 0;
310310 }
311311 EXPORT_SYMBOL(drm_gem_handle_delete);
drivers/gpu/drm/drm_probe_helper.c+0−2
@@ -264,10 +264,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, · 263 unmodified lines
264264 count = drm_add_edid_modes(connector, edid);
265265 drm_edid_to_eld(connector, edid);
266266 } else {
267−#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
268267 count = drm_load_edid_firmware(connector);
269268 if (count == 0)
270−#endif
271269 count = (*connector_funcs->get_modes)(connector);
272270 }
273271
drivers/gpu/drm/i915/i915_debugfs.c+2−1
@@ -3434,7 +3434,8 @@ static int i915_dp_mst_info(struct seq_file *m, void *unused) · 3433 unmodified lines
34343434 intel_dig_port = enc_to_dig_port(encoder);
34353435 if (!intel_dig_port->dp.can_mst)
34363436 continue;
3437−
3437+ seq_printf(m, "MST Source Port %c\n",
3438+ port_name(intel_dig_port->port));
34383439 drm_dp_mst_dump_topology(m, &intel_dig_port->dp.mst_mgr);
34393440 }
34403441 drm_modeset_unlock_all(dev);
drivers/gpu/drm/rcar-du/rcar_du_drv.c+1−8
@@ -361,14 +361,7 @@ static int rcar_du_probe(struct platform_device *pdev) · 360 unmodified lines
361361 if (ret)
362362 goto error;
363363
364− mutex_lock(&ddev->mode_config.mutex);
365− drm_for_each_connector(connector, ddev) {
366− ret = drm_connector_register(connector);
367− if (ret < 0)
368− break;
369− }
370− mutex_unlock(&ddev->mode_config.mutex);
371−
364+ ret = drm_connector_register_all(ddev);
372365 if (ret < 0)
373366 goto error;
374367
drivers/gpu/drm/virtio/virtgpu_display.c+0−9
@@ -38,13 +38,6 @@ · 37 unmodified lines
3838 #define XRES_MAX 8192
3939 #define YRES_MAX 8192
4040
41−static void virtio_gpu_crtc_gamma_set(struct drm_crtc *crtc,
42− u16 *red, u16 *green, u16 *blue,
43− uint32_t start, uint32_t size)
44−{
45− /* TODO */
46−}
47−
4841 static void
4942 virtio_gpu_hide_cursor(struct virtio_gpu_device *vgdev,
5043 struct virtio_gpu_output *output)
@@ -173,7 +166,6 @@ static int virtio_gpu_page_flip(struct drm_crtc *crtc, · 122 unmodified lines
173166 static const struct drm_crtc_funcs virtio_gpu_crtc_funcs = {
174167 .cursor_set2 = virtio_gpu_crtc_cursor_set,
175168 .cursor_move = virtio_gpu_crtc_cursor_move,
176− .gamma_set = virtio_gpu_crtc_gamma_set,
177169 .set_config = drm_atomic_helper_set_config,
178170 .destroy = drm_crtc_cleanup,
179171
@@ -416,7 +408,6 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index) · 236 unmodified lines
416408 return PTR_ERR(plane);
417409 drm_crtc_init_with_planes(dev, crtc, plane, NULL,
418410 &virtio_gpu_crtc_funcs, NULL);
419− drm_mode_crtc_set_gamma_size(crtc, 256);
420411 drm_crtc_helper_add(crtc, &virtio_gpu_crtc_helper_funcs);
421412 plane->crtc = crtc;
422413
include/drm/drmP.h+1−1
@@ -90,7 +90,7 @@ struct reservation_object; · 89 unmodified lines
9090 struct dma_buf_attachment;
9191
9292 /*
93− * 4 debug categories are defined:
93+ * The following categories are defined:
9494 *
9595 * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ...
9696 * This is the category used by the DRM_DEBUG() macro.
include/drm/drm_crtc.h+10−3
@@ -2249,7 +2249,8 @@ static inline unsigned drm_connector_index(struct drm_connector *connector) · 2248 unmodified lines
22492249 return connector->connector_id;
22502250 }
22512251
2252−/* helper to unregister all connectors from sysfs for device */
2252+/* helpers to {un}register all connectors from sysfs for device */
2253+extern int drm_connector_register_all(struct drm_device *dev);
22532254 extern void drm_connector_unregister_all(struct drm_device *dev);
22542255
22552256 extern int drm_bridge_add(struct drm_bridge *bridge);
@@ -2500,6 +2501,8 @@ extern int drm_edid_header_is_valid(const u8 *raw_edid); · 244 unmodified lines
25002501 extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
25012502 bool *edid_corrupt);
25022503 extern bool drm_edid_is_valid(struct edid *edid);
2504+extern void drm_edid_get_monitor_name(struct edid *edid, char *name,
2505+ int buflen);
25032506
25042507 extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
25052508 char topology[8]);
@@ -2590,10 +2593,14 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev, · 84 unmodified lines
25902593 static inline uint32_t drm_color_lut_extract(uint32_t user_input,
25912594 uint32_t bit_precision)
25922595 {
2593− uint32_t val = user_input + (1 << (16 - bit_precision - 1));
2596+ uint32_t val = user_input;
25942597 uint32_t max = 0xffff >> (16 - bit_precision);
25952598
2596− val >>= 16 - bit_precision;
2599+ /* Round only if we're not using full precision. */
2600+ if (bit_precision < 16) {
2601+ val += 1UL << (16 - bit_precision - 1);
2602+ val >>= 16 - bit_precision;
2603+ }
25972604
25982605 return clamp_val(val, 0, max);
25992606 }
include/drm/drm_edid.h+8−0
@@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb); · 327 unmodified lines
328328 int drm_av_sync_delay(struct drm_connector *connector,
329329 const struct drm_display_mode *mode);
330330 struct drm_connector *drm_select_eld(struct drm_encoder *encoder);
331+
332+#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
331333 int drm_load_edid_firmware(struct drm_connector *connector);
334+#else
335+static inline int drm_load_edid_firmware(struct drm_connector *connector)
336+{
337+ return 0;
338+}
339+#endif
332340
333341 int
334342 drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t