Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'topic/drm-misc-2015-12-18' of git://anongit.freedesktop.org/drm-intel into drm-next

Seems I lied in my last drm-misc pull request and suddenly there's a big
pile of random stuff. Boris dug out Thierry's drm-trivial branch and
resubmitted everything since that branch didn't really work out.

On top of that Nicolas' changes to drm_dev_set_unique - this might
conflict with new driver pulls (I double checked and current drm-next
should be fine), so please beware. The -next/-fixes conflict in vmwgfx
will change slightly with this here too.

* tag 'topic/drm-misc-2015-12-18' of git://anongit.freedesktop.org/drm-intel: (36 commits)
drm: use dev_name as default unique name in drm_dev_alloc()
drm: make drm_dev_set_unique() not use a format string
drm/vmwgfx: Constify function pointer structs
drm/udl: Constify function pointer structs
drm/tegra: Constify function pointer structs
drm/rockchip: Constify function pointer structs
drm/nouveau: Constify function pointer structs
drm/mgag200: Constify function pointer structs
drm/imx: Constify function pointer structs
drm/i2c/sil164: Constify function pointer structs
drm/i2c/adv7511: Constify function pointer structs
drm/exynos: Constify function pointer structs
drm/cirrus: Constify function pointer structs
drm/i2c/ch7006: Constify function pointer structs
drm/bridge/nxp-ptn3460: Constify function pointer structs
drm/bridge/dw_hdmi: Constify function pointer structs
drm/bochs: Constify function pointer structs
drm/atmel-hlcdc: Constify function pointer structs
drm/armada: Constify function pointer structs
drm: Constify drm_encoder_slave_funcs
...

+207 -362
+1 -157
Documentation/DocBook/gpu.tmpl
··· 986 986 !Idrivers/gpu/drm/drm_atomic.c 987 987 </sect2> 988 988 <sect2> 989 - <title>Frame Buffer Creation</title> 990 - <synopsis>struct drm_framebuffer *(*fb_create)(struct drm_device *dev, 991 - struct drm_file *file_priv, 992 - struct drm_mode_fb_cmd2 *mode_cmd);</synopsis> 989 + <title>Frame Buffer Abstraction</title> 993 990 <para> 994 991 Frame buffers are abstract memory objects that provide a source of 995 992 pixels to scanout to a CRTC. Applications explicitly request the ··· 1003 1006 handle. Drivers are however free to use their own backing storage object 1004 1007 handles, e.g. vmwgfx directly exposes special TTM handles to userspace 1005 1008 and so expects TTM handles in the create ioctl and not GEM handles. 1006 - </para> 1007 - <para> 1008 - Drivers must first validate the requested frame buffer parameters passed 1009 - through the mode_cmd argument. In particular this is where invalid 1010 - sizes, pixel formats or pitches can be caught. 1011 - </para> 1012 - <para> 1013 - If the parameters are deemed valid, drivers then create, initialize and 1014 - return an instance of struct <structname>drm_framebuffer</structname>. 1015 - If desired the instance can be embedded in a larger driver-specific 1016 - structure. Drivers must fill its <structfield>width</structfield>, 1017 - <structfield>height</structfield>, <structfield>pitches</structfield>, 1018 - <structfield>offsets</structfield>, <structfield>depth</structfield>, 1019 - <structfield>bits_per_pixel</structfield> and 1020 - <structfield>pixel_format</structfield> fields from the values passed 1021 - through the <parameter>drm_mode_fb_cmd2</parameter> argument. They 1022 - should call the <function>drm_helper_mode_fill_fb_struct</function> 1023 - helper function to do so. 1024 - </para> 1025 - 1026 - <para> 1027 - The initialization of the new framebuffer instance is finalized with a 1028 - call to <function>drm_framebuffer_init</function> which takes a pointer 1029 - to DRM frame buffer operations (struct 1030 - <structname>drm_framebuffer_funcs</structname>). Note that this function 1031 - publishes the framebuffer and so from this point on it can be accessed 1032 - concurrently from other threads. Hence it must be the last step in the 1033 - driver's framebuffer initialization sequence. Frame buffer operations 1034 - are 1035 - <itemizedlist> 1036 - <listitem> 1037 - <synopsis>int (*create_handle)(struct drm_framebuffer *fb, 1038 - struct drm_file *file_priv, unsigned int *handle);</synopsis> 1039 - <para> 1040 - Create a handle to the frame buffer underlying memory object. If 1041 - the frame buffer uses a multi-plane format, the handle will 1042 - reference the memory object associated with the first plane. 1043 - </para> 1044 - <para> 1045 - Drivers call <function>drm_gem_handle_create</function> to create 1046 - the handle. 1047 - </para> 1048 - </listitem> 1049 - <listitem> 1050 - <synopsis>void (*destroy)(struct drm_framebuffer *framebuffer);</synopsis> 1051 - <para> 1052 - Destroy the frame buffer object and frees all associated 1053 - resources. Drivers must call 1054 - <function>drm_framebuffer_cleanup</function> to free resources 1055 - allocated by the DRM core for the frame buffer object, and must 1056 - make sure to unreference all memory objects associated with the 1057 - frame buffer. Handles created by the 1058 - <methodname>create_handle</methodname> operation are released by 1059 - the DRM core. 1060 - </para> 1061 - </listitem> 1062 - <listitem> 1063 - <synopsis>int (*dirty)(struct drm_framebuffer *framebuffer, 1064 - struct drm_file *file_priv, unsigned flags, unsigned color, 1065 - struct drm_clip_rect *clips, unsigned num_clips);</synopsis> 1066 - <para> 1067 - This optional operation notifies the driver that a region of the 1068 - frame buffer has changed in response to a DRM_IOCTL_MODE_DIRTYFB 1069 - ioctl call. 1070 - </para> 1071 - </listitem> 1072 - </itemizedlist> 1073 1009 </para> 1074 1010 <para> 1075 1011 The lifetime of a drm framebuffer is controlled with a reference count, ··· 3500 3570 <sect2> 3501 3571 <title>DPIO</title> 3502 3572 !Pdrivers/gpu/drm/i915/i915_reg.h DPIO 3503 - <table id="dpiox2"> 3504 - <title>Dual channel PHY (VLV/CHV/BXT)</title> 3505 - <tgroup cols="8"> 3506 - <colspec colname="c0" /> 3507 - <colspec colname="c1" /> 3508 - <colspec colname="c2" /> 3509 - <colspec colname="c3" /> 3510 - <colspec colname="c4" /> 3511 - <colspec colname="c5" /> 3512 - <colspec colname="c6" /> 3513 - <colspec colname="c7" /> 3514 - <spanspec spanname="ch0" namest="c0" nameend="c3" /> 3515 - <spanspec spanname="ch1" namest="c4" nameend="c7" /> 3516 - <spanspec spanname="ch0pcs01" namest="c0" nameend="c1" /> 3517 - <spanspec spanname="ch0pcs23" namest="c2" nameend="c3" /> 3518 - <spanspec spanname="ch1pcs01" namest="c4" nameend="c5" /> 3519 - <spanspec spanname="ch1pcs23" namest="c6" nameend="c7" /> 3520 - <thead> 3521 - <row> 3522 - <entry spanname="ch0">CH0</entry> 3523 - <entry spanname="ch1">CH1</entry> 3524 - </row> 3525 - </thead> 3526 - <tbody valign="top" align="center"> 3527 - <row> 3528 - <entry spanname="ch0">CMN/PLL/REF</entry> 3529 - <entry spanname="ch1">CMN/PLL/REF</entry> 3530 - </row> 3531 - <row> 3532 - <entry spanname="ch0pcs01">PCS01</entry> 3533 - <entry spanname="ch0pcs23">PCS23</entry> 3534 - <entry spanname="ch1pcs01">PCS01</entry> 3535 - <entry spanname="ch1pcs23">PCS23</entry> 3536 - </row> 3537 - <row> 3538 - <entry>TX0</entry> 3539 - <entry>TX1</entry> 3540 - <entry>TX2</entry> 3541 - <entry>TX3</entry> 3542 - <entry>TX0</entry> 3543 - <entry>TX1</entry> 3544 - <entry>TX2</entry> 3545 - <entry>TX3</entry> 3546 - </row> 3547 - <row> 3548 - <entry spanname="ch0">DDI0</entry> 3549 - <entry spanname="ch1">DDI1</entry> 3550 - </row> 3551 - </tbody> 3552 - </tgroup> 3553 - </table> 3554 - <table id="dpiox1"> 3555 - <title>Single channel PHY (CHV/BXT)</title> 3556 - <tgroup cols="4"> 3557 - <colspec colname="c0" /> 3558 - <colspec colname="c1" /> 3559 - <colspec colname="c2" /> 3560 - <colspec colname="c3" /> 3561 - <spanspec spanname="ch0" namest="c0" nameend="c3" /> 3562 - <spanspec spanname="ch0pcs01" namest="c0" nameend="c1" /> 3563 - <spanspec spanname="ch0pcs23" namest="c2" nameend="c3" /> 3564 - <thead> 3565 - <row> 3566 - <entry spanname="ch0">CH0</entry> 3567 - </row> 3568 - </thead> 3569 - <tbody valign="top" align="center"> 3570 - <row> 3571 - <entry spanname="ch0">CMN/PLL/REF</entry> 3572 - </row> 3573 - <row> 3574 - <entry spanname="ch0pcs01">PCS01</entry> 3575 - <entry spanname="ch0pcs23">PCS23</entry> 3576 - </row> 3577 - <row> 3578 - <entry>TX0</entry> 3579 - <entry>TX1</entry> 3580 - <entry>TX2</entry> 3581 - <entry>TX3</entry> 3582 - </row> 3583 - <row> 3584 - <entry spanname="ch0">DDI2</entry> 3585 - </row> 3586 - </tbody> 3587 - </tgroup> 3588 - </table> 3589 3573 </sect2> 3590 3574 3591 3575 <sect2>
+1 -1
drivers/gpu/drm/armada/armada_crtc.c
··· 1074 1074 return 0; 1075 1075 } 1076 1076 1077 - static struct drm_crtc_funcs armada_crtc_funcs = { 1077 + static const struct drm_crtc_funcs armada_crtc_funcs = { 1078 1078 .cursor_set = armada_drm_crtc_cursor_set, 1079 1079 .cursor_move = armada_drm_crtc_cursor_move, 1080 1080 .destroy = armada_drm_crtc_destroy,
+5 -4
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
··· 333 333 .data = &atmel_hlcdc_dc_at91sam9x5, 334 334 }, 335 335 { 336 + .compatible = "atmel,sama5d2-hlcdc", 337 + .data = &atmel_hlcdc_dc_sama5d4, 338 + }, 339 + { 336 340 .compatible = "atmel,sama5d3-hlcdc", 337 341 .data = &atmel_hlcdc_dc_sama5d3, 338 342 }, ··· 346 342 }, 347 343 { /* sentinel */ }, 348 344 }; 345 + MODULE_DEVICE_TABLE(of, atmel_hlcdc_of_match); 349 346 350 347 int atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc, 351 348 struct drm_display_mode *mode) ··· 737 732 ddev = drm_dev_alloc(&atmel_hlcdc_dc_driver, &pdev->dev); 738 733 if (!ddev) 739 734 return -ENOMEM; 740 - 741 - ret = drm_dev_set_unique(ddev, dev_name(ddev->dev)); 742 - if (ret) 743 - goto err_unref; 744 735 745 736 ret = atmel_hlcdc_dc_load(ddev); 746 737 if (ret)
+2 -2
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
··· 146 146 cfg); 147 147 } 148 148 149 - static struct drm_encoder_helper_funcs atmel_hlcdc_panel_encoder_helper_funcs = { 149 + static const struct drm_encoder_helper_funcs atmel_hlcdc_panel_encoder_helper_funcs = { 150 150 .mode_fixup = atmel_hlcdc_panel_encoder_mode_fixup, 151 151 .mode_set = atmel_hlcdc_rgb_encoder_mode_set, 152 152 .disable = atmel_hlcdc_panel_encoder_disable, ··· 192 192 return &rgb->encoder; 193 193 } 194 194 195 - static struct drm_connector_helper_funcs atmel_hlcdc_panel_connector_helper_funcs = { 195 + static const struct drm_connector_helper_funcs atmel_hlcdc_panel_connector_helper_funcs = { 196 196 .get_modes = atmel_hlcdc_panel_get_modes, 197 197 .mode_valid = atmel_hlcdc_rgb_mode_valid, 198 198 .best_encoder = atmel_hlcdc_rgb_best_encoder,
+4 -4
drivers/gpu/drm/bochs/bochs_kms.c
··· 119 119 bochs_crtc_mode_set_base(crtc, 0, 0, old_fb); 120 120 if (event) { 121 121 spin_lock_irqsave(&bochs->dev->event_lock, irqflags); 122 - drm_send_vblank_event(bochs->dev, -1, event); 122 + drm_crtc_send_vblank_event(crtc, event); 123 123 spin_unlock_irqrestore(&bochs->dev->event_lock, irqflags); 124 124 } 125 125 return 0; ··· 245 245 return connector_status_connected; 246 246 } 247 247 248 - struct drm_connector_helper_funcs bochs_connector_connector_helper_funcs = { 248 + static const struct drm_connector_helper_funcs bochs_connector_connector_helper_funcs = { 249 249 .get_modes = bochs_connector_get_modes, 250 250 .mode_valid = bochs_connector_mode_valid, 251 251 .best_encoder = bochs_connector_best_encoder, 252 252 }; 253 253 254 - struct drm_connector_funcs bochs_connector_connector_funcs = { 254 + static const struct drm_connector_funcs bochs_connector_connector_funcs = { 255 255 .dpms = drm_helper_connector_dpms, 256 256 .detect = bochs_connector_detect, 257 257 .fill_modes = drm_helper_probe_single_connector_modes, ··· 283 283 bochs->dev->mode_config.preferred_depth = 24; 284 284 bochs->dev->mode_config.prefer_shadow = 0; 285 285 286 - bochs->dev->mode_config.funcs = (void *)&bochs_mode_funcs; 286 + bochs->dev->mode_config.funcs = &bochs_mode_funcs; 287 287 288 288 bochs_crtc_init(bochs->dev); 289 289 bochs_encoder_init(bochs->dev);
+3 -3
drivers/gpu/drm/bridge/dw-hdmi.c
··· 1514 1514 mutex_unlock(&hdmi->mutex); 1515 1515 } 1516 1516 1517 - static struct drm_connector_funcs dw_hdmi_connector_funcs = { 1517 + static const struct drm_connector_funcs dw_hdmi_connector_funcs = { 1518 1518 .dpms = drm_helper_connector_dpms, 1519 1519 .fill_modes = drm_helper_probe_single_connector_modes, 1520 1520 .detect = dw_hdmi_connector_detect, ··· 1522 1522 .force = dw_hdmi_connector_force, 1523 1523 }; 1524 1524 1525 - static struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = { 1525 + static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = { 1526 1526 .get_modes = dw_hdmi_connector_get_modes, 1527 1527 .mode_valid = dw_hdmi_connector_mode_valid, 1528 1528 .best_encoder = dw_hdmi_connector_best_encoder, 1529 1529 }; 1530 1530 1531 - static struct drm_bridge_funcs dw_hdmi_bridge_funcs = { 1531 + static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { 1532 1532 .enable = dw_hdmi_bridge_enable, 1533 1533 .disable = dw_hdmi_bridge_disable, 1534 1534 .pre_enable = dw_hdmi_bridge_nop,
+3 -3
drivers/gpu/drm/bridge/nxp-ptn3460.c
··· 242 242 return ptn_bridge->bridge.encoder; 243 243 } 244 244 245 - static struct drm_connector_helper_funcs ptn3460_connector_helper_funcs = { 245 + static const struct drm_connector_helper_funcs ptn3460_connector_helper_funcs = { 246 246 .get_modes = ptn3460_get_modes, 247 247 .best_encoder = ptn3460_best_encoder, 248 248 }; ··· 258 258 drm_connector_cleanup(connector); 259 259 } 260 260 261 - static struct drm_connector_funcs ptn3460_connector_funcs = { 261 + static const struct drm_connector_funcs ptn3460_connector_funcs = { 262 262 .dpms = drm_atomic_helper_connector_dpms, 263 263 .fill_modes = drm_helper_probe_single_connector_modes, 264 264 .detect = ptn3460_detect, ··· 299 299 return ret; 300 300 } 301 301 302 - static struct drm_bridge_funcs ptn3460_bridge_funcs = { 302 + static const struct drm_bridge_funcs ptn3460_bridge_funcs = { 303 303 .pre_enable = ptn3460_pre_enable, 304 304 .enable = ptn3460_enable, 305 305 .disable = ptn3460_disable,
+2 -2
drivers/gpu/drm/cirrus/cirrus_mode.c
··· 533 533 kfree(connector); 534 534 } 535 535 536 - struct drm_connector_helper_funcs cirrus_vga_connector_helper_funcs = { 536 + static const struct drm_connector_helper_funcs cirrus_vga_connector_helper_funcs = { 537 537 .get_modes = cirrus_vga_get_modes, 538 538 .best_encoder = cirrus_connector_best_encoder, 539 539 }; 540 540 541 - struct drm_connector_funcs cirrus_vga_connector_funcs = { 541 + static const struct drm_connector_funcs cirrus_vga_connector_funcs = { 542 542 .dpms = drm_helper_connector_dpms, 543 543 .detect = cirrus_vga_detect, 544 544 .fill_modes = drm_helper_probe_single_connector_modes,
+2 -3
drivers/gpu/drm/drm_atomic_helper.c
··· 88 88 89 89 static bool 90 90 check_pending_encoder_assignment(struct drm_atomic_state *state, 91 - struct drm_encoder *new_encoder, 92 - struct drm_connector *new_connector) 91 + struct drm_encoder *new_encoder) 93 92 { 94 93 struct drm_connector *connector; 95 94 struct drm_connector_state *conn_state; ··· 256 257 return 0; 257 258 } 258 259 259 - if (!check_pending_encoder_assignment(state, new_encoder, connector)) { 260 + if (!check_pending_encoder_assignment(state, new_encoder)) { 260 261 DRM_DEBUG_ATOMIC("Encoder for [CONNECTOR:%d:%s] already assigned\n", 261 262 connector->base.id, 262 263 connector->name);
+3 -1
drivers/gpu/drm/drm_dp_mst_topology.c
··· 1673 1673 if (mgr->proposed_vcpis[i]) { 1674 1674 port = container_of(mgr->proposed_vcpis[i], struct drm_dp_mst_port, vcpi); 1675 1675 req_payload.num_slots = mgr->proposed_vcpis[i]->num_slots; 1676 + req_payload.vcpi = mgr->proposed_vcpis[i]->vcpi; 1676 1677 } else { 1677 1678 port = NULL; 1678 1679 req_payload.num_slots = 0; ··· 1689 1688 if (req_payload.num_slots) { 1690 1689 drm_dp_create_payload_step1(mgr, mgr->proposed_vcpis[i]->vcpi, &req_payload); 1691 1690 mgr->payloads[i].num_slots = req_payload.num_slots; 1691 + mgr->payloads[i].vcpi = req_payload.vcpi; 1692 1692 } else if (mgr->payloads[i].num_slots) { 1693 1693 mgr->payloads[i].num_slots = 0; 1694 1694 drm_dp_destroy_payload_step1(mgr, port, port->vcpi.vcpi, &mgr->payloads[i]); ··· 1825 1823 { 1826 1824 struct drm_dp_sideband_msg_reply_body reply; 1827 1825 1828 - reply.reply_type = 1; 1826 + reply.reply_type = 0; 1829 1827 reply.req_type = req_type; 1830 1828 drm_dp_encode_sideband_reply(&reply, msg); 1831 1829 return 0;
+15 -11
drivers/gpu/drm/drm_drv.c
··· 633 633 } 634 634 } 635 635 636 + if (parent) { 637 + ret = drm_dev_set_unique(dev, dev_name(parent)); 638 + if (ret) 639 + goto err_setunique; 640 + } 641 + 636 642 return dev; 637 643 644 + err_setunique: 645 + if (drm_core_check_feature(dev, DRIVER_GEM)) 646 + drm_gem_destroy(dev); 638 647 err_ctxbitmap: 639 648 drm_legacy_ctxbitmap_cleanup(dev); 640 649 drm_ht_remove(&dev->map_hash); ··· 806 797 /** 807 798 * drm_dev_set_unique - Set the unique name of a DRM device 808 799 * @dev: device of which to set the unique name 809 - * @fmt: format string for unique name 800 + * @name: unique name 810 801 * 811 - * Sets the unique name of a DRM device using the specified format string and 812 - * a variable list of arguments. Drivers can use this at driver probe time if 813 - * the unique name of the devices they drive is static. 802 + * Sets the unique name of a DRM device using the specified string. Drivers 803 + * can use this at driver probe time if the unique name of the devices they 804 + * drive is static. 814 805 * 815 806 * Return: 0 on success or a negative error code on failure. 816 807 */ 817 - int drm_dev_set_unique(struct drm_device *dev, const char *fmt, ...) 808 + int drm_dev_set_unique(struct drm_device *dev, const char *name) 818 809 { 819 - va_list ap; 820 - 821 810 kfree(dev->unique); 822 - 823 - va_start(ap, fmt); 824 - dev->unique = kvasprintf(GFP_KERNEL, fmt, ap); 825 - va_end(ap); 811 + dev->unique = kstrdup(name, GFP_KERNEL); 826 812 827 813 return dev->unique ? 0 : -ENOMEM; 828 814 }
+1 -1
drivers/gpu/drm/drm_encoder_slave.c
··· 124 124 * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs: 125 125 */ 126 126 127 - static inline struct drm_encoder_slave_funcs * 127 + static inline const struct drm_encoder_slave_funcs * 128 128 get_slave_funcs(struct drm_encoder *enc) 129 129 { 130 130 return to_encoder_slave(enc)->slave_funcs;
+3 -3
drivers/gpu/drm/drm_fb_cma_helper.c
··· 266 266 fbi = drm_fb_helper_alloc_fbi(helper); 267 267 if (IS_ERR(fbi)) { 268 268 ret = PTR_ERR(fbi); 269 - goto err_drm_gem_cma_free_object; 269 + goto err_gem_free_object; 270 270 } 271 271 272 272 fbdev_cma->fb = drm_fb_cma_alloc(dev, &mode_cmd, &obj, 1); ··· 299 299 300 300 err_fb_info_destroy: 301 301 drm_fb_helper_release_fbi(helper); 302 - err_drm_gem_cma_free_object: 303 - drm_gem_cma_free_object(&obj->base); 302 + err_gem_free_object: 303 + dev->driver->gem_free_object(&obj->base); 304 304 return ret; 305 305 } 306 306
+2 -2
drivers/gpu/drm/drm_gem_cma_helper.c
··· 121 121 return cma_obj; 122 122 123 123 error: 124 - drm_gem_cma_free_object(&cma_obj->base); 124 + drm->driver->gem_free_object(&cma_obj->base); 125 125 return ERR_PTR(ret); 126 126 } 127 127 EXPORT_SYMBOL_GPL(drm_gem_cma_create); ··· 171 171 return cma_obj; 172 172 173 173 err_handle_create: 174 - drm_gem_cma_free_object(gem_obj); 174 + drm->driver->gem_free_object(gem_obj); 175 175 176 176 return ERR_PTR(ret); 177 177 }
+5 -5
drivers/gpu/drm/drm_modes.c
··· 553 553 * drivers/video/fbmon.c 554 554 * 555 555 * Standard GTF parameters: 556 - * M = 600 557 - * C = 40 558 - * K = 128 559 - * J = 20 556 + * M = 600 557 + * C = 40 558 + * K = 128 559 + * J = 20 560 560 * 561 561 * Returns: 562 562 * The modeline based on the GTF algorithm stored in a drm_display_mode object. ··· 1244 1244 * This uses the same parameters as the fb modedb.c, except for an extra 1245 1245 * force-enable, force-enable-digital and force-disable bit at the end: 1246 1246 * 1247 - * <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] 1247 + * <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] 1248 1248 * 1249 1249 * The intermediate drm_cmdline_mode structure is required to store additional 1250 1250 * options from the command line modline like the force-enable/disable flag.
+6 -8
drivers/gpu/drm/drm_modeset_lock.c
··· 40 40 * The basic usage pattern is to: 41 41 * 42 42 * drm_modeset_acquire_init(&ctx) 43 - * retry: 43 + * retry: 44 44 * foreach (lock in random_ordered_set_of_locks) { 45 - * ret = drm_modeset_lock(lock, &ctx) 46 - * if (ret == -EDEADLK) { 47 - * drm_modeset_backoff(&ctx); 48 - * goto retry; 49 - * } 45 + * ret = drm_modeset_lock(lock, &ctx) 46 + * if (ret == -EDEADLK) { 47 + * drm_modeset_backoff(&ctx); 48 + * goto retry; 49 + * } 50 50 * } 51 - * 52 51 * ... do stuff ... 53 - * 54 52 * drm_modeset_drop_locks(&ctx); 55 53 * drm_modeset_acquire_fini(&ctx); 56 54 */
+6 -10
drivers/gpu/drm/drm_prime.c
··· 313 313 * 314 314 * Export callbacks: 315 315 * 316 - * - @gem_prime_pin (optional): prepare a GEM object for exporting 317 - * 318 - * - @gem_prime_get_sg_table: provide a scatter/gather table of pinned pages 319 - * 320 - * - @gem_prime_vmap: vmap a buffer exported by your driver 321 - * 322 - * - @gem_prime_vunmap: vunmap a buffer exported by your driver 323 - * 324 - * - @gem_prime_mmap (optional): mmap a buffer exported by your driver 316 + * * @gem_prime_pin (optional): prepare a GEM object for exporting 317 + * * @gem_prime_get_sg_table: provide a scatter/gather table of pinned pages 318 + * * @gem_prime_vmap: vmap a buffer exported by your driver 319 + * * @gem_prime_vunmap: vunmap a buffer exported by your driver 320 + * * @gem_prime_mmap (optional): mmap a buffer exported by your driver 325 321 * 326 322 * Import callback: 327 323 * 328 - * - @gem_prime_import_sg_table (import): produce a GEM object from another 324 + * * @gem_prime_import_sg_table (import): produce a GEM object from another 329 325 * driver's scatter/gather table 330 326 */ 331 327
+4 -4
drivers/gpu/drm/exynos/exynos_dp_core.c
··· 953 953 drm_connector_cleanup(connector); 954 954 } 955 955 956 - static struct drm_connector_funcs exynos_dp_connector_funcs = { 956 + static const struct drm_connector_funcs exynos_dp_connector_funcs = { 957 957 .dpms = drm_atomic_helper_connector_dpms, 958 958 .fill_modes = drm_helper_probe_single_connector_modes, 959 959 .detect = exynos_dp_detect, ··· 998 998 return &dp->encoder; 999 999 } 1000 1000 1001 - static struct drm_connector_helper_funcs exynos_dp_connector_helper_funcs = { 1001 + static const struct drm_connector_helper_funcs exynos_dp_connector_helper_funcs = { 1002 1002 .get_modes = exynos_dp_get_modes, 1003 1003 .best_encoder = exynos_dp_best_encoder, 1004 1004 }; ··· 1176 1176 { 1177 1177 } 1178 1178 1179 - static struct drm_encoder_helper_funcs exynos_dp_encoder_helper_funcs = { 1179 + static const struct drm_encoder_helper_funcs exynos_dp_encoder_helper_funcs = { 1180 1180 .mode_fixup = exynos_dp_mode_fixup, 1181 1181 .mode_set = exynos_dp_mode_set, 1182 1182 .enable = exynos_dp_enable, 1183 1183 .disable = exynos_dp_disable, 1184 1184 }; 1185 1185 1186 - static struct drm_encoder_funcs exynos_dp_encoder_funcs = { 1186 + static const struct drm_encoder_funcs exynos_dp_encoder_funcs = { 1187 1187 .destroy = drm_encoder_cleanup, 1188 1188 }; 1189 1189
+2 -2
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 93 93 } 94 94 } 95 95 96 - static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { 96 + static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { 97 97 .enable = exynos_drm_crtc_enable, 98 98 .disable = exynos_drm_crtc_disable, 99 99 .mode_set_nofb = exynos_drm_crtc_mode_set_nofb, ··· 113 113 kfree(exynos_crtc); 114 114 } 115 115 116 - static struct drm_crtc_funcs exynos_crtc_funcs = { 116 + static const struct drm_crtc_funcs exynos_crtc_funcs = { 117 117 .set_config = drm_atomic_helper_set_config, 118 118 .page_flip = drm_atomic_helper_page_flip, 119 119 .destroy = exynos_drm_crtc_destroy,
+4 -4
drivers/gpu/drm/exynos/exynos_drm_dpi.c
··· 57 57 drm_connector_cleanup(connector); 58 58 } 59 59 60 - static struct drm_connector_funcs exynos_dpi_connector_funcs = { 60 + static const struct drm_connector_funcs exynos_dpi_connector_funcs = { 61 61 .dpms = drm_atomic_helper_connector_dpms, 62 62 .detect = exynos_dpi_detect, 63 63 .fill_modes = drm_helper_probe_single_connector_modes, ··· 100 100 return &ctx->encoder; 101 101 } 102 102 103 - static struct drm_connector_helper_funcs exynos_dpi_connector_helper_funcs = { 103 + static const struct drm_connector_helper_funcs exynos_dpi_connector_helper_funcs = { 104 104 .get_modes = exynos_dpi_get_modes, 105 105 .best_encoder = exynos_dpi_best_encoder, 106 106 }; ··· 161 161 } 162 162 } 163 163 164 - static struct drm_encoder_helper_funcs exynos_dpi_encoder_helper_funcs = { 164 + static const struct drm_encoder_helper_funcs exynos_dpi_encoder_helper_funcs = { 165 165 .mode_fixup = exynos_dpi_mode_fixup, 166 166 .mode_set = exynos_dpi_mode_set, 167 167 .enable = exynos_dpi_enable, 168 168 .disable = exynos_dpi_disable, 169 169 }; 170 170 171 - static struct drm_encoder_funcs exynos_dpi_encoder_funcs = { 171 + static const struct drm_encoder_funcs exynos_dpi_encoder_funcs = { 172 172 .destroy = drm_encoder_cleanup, 173 173 }; 174 174
+4 -4
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1541 1541 connector->dev = NULL; 1542 1542 } 1543 1543 1544 - static struct drm_connector_funcs exynos_dsi_connector_funcs = { 1544 + static const struct drm_connector_funcs exynos_dsi_connector_funcs = { 1545 1545 .dpms = drm_atomic_helper_connector_dpms, 1546 1546 .detect = exynos_dsi_detect, 1547 1547 .fill_modes = drm_helper_probe_single_connector_modes, ··· 1569 1569 return &dsi->encoder; 1570 1570 } 1571 1571 1572 - static struct drm_connector_helper_funcs exynos_dsi_connector_helper_funcs = { 1572 + static const struct drm_connector_helper_funcs exynos_dsi_connector_helper_funcs = { 1573 1573 .get_modes = exynos_dsi_get_modes, 1574 1574 .best_encoder = exynos_dsi_best_encoder, 1575 1575 }; ··· 1622 1622 vm->hsync_len = m->hsync_end - m->hsync_start; 1623 1623 } 1624 1624 1625 - static struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { 1625 + static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { 1626 1626 .mode_fixup = exynos_dsi_mode_fixup, 1627 1627 .mode_set = exynos_dsi_mode_set, 1628 1628 .enable = exynos_dsi_enable, 1629 1629 .disable = exynos_dsi_disable, 1630 1630 }; 1631 1631 1632 - static struct drm_encoder_funcs exynos_dsi_encoder_funcs = { 1632 + static const struct drm_encoder_funcs exynos_dsi_encoder_funcs = { 1633 1633 .destroy = drm_encoder_cleanup, 1634 1634 }; 1635 1635
+1 -1
drivers/gpu/drm/exynos/exynos_drm_fb.c
··· 110 110 return 0; 111 111 } 112 112 113 - static struct drm_framebuffer_funcs exynos_drm_fb_funcs = { 113 + static const struct drm_framebuffer_funcs exynos_drm_fb_funcs = { 114 114 .destroy = exynos_drm_fb_destroy, 115 115 .create_handle = exynos_drm_fb_create_handle, 116 116 .dirty = exynos_drm_fb_dirty,
+1 -1
drivers/gpu/drm/exynos/exynos_drm_mic.c
··· 389 389 mutex_unlock(&mic_mutex); 390 390 } 391 391 392 - struct drm_bridge_funcs mic_bridge_funcs = { 392 + static const struct drm_bridge_funcs mic_bridge_funcs = { 393 393 .disable = mic_disable, 394 394 .post_disable = mic_post_disable, 395 395 .pre_enable = mic_pre_enable,
+4 -4
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 339 339 { 340 340 } 341 341 342 - static struct drm_connector_funcs vidi_connector_funcs = { 342 + static const struct drm_connector_funcs vidi_connector_funcs = { 343 343 .dpms = drm_atomic_helper_connector_dpms, 344 344 .fill_modes = drm_helper_probe_single_connector_modes, 345 345 .detect = vidi_detect, ··· 383 383 return &ctx->encoder; 384 384 } 385 385 386 - static struct drm_connector_helper_funcs vidi_connector_helper_funcs = { 386 + static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = { 387 387 .get_modes = vidi_get_modes, 388 388 .best_encoder = vidi_best_encoder, 389 389 }; ··· 431 431 { 432 432 } 433 433 434 - static struct drm_encoder_helper_funcs exynos_vidi_encoder_helper_funcs = { 434 + static const struct drm_encoder_helper_funcs exynos_vidi_encoder_helper_funcs = { 435 435 .mode_fixup = exynos_vidi_mode_fixup, 436 436 .mode_set = exynos_vidi_mode_set, 437 437 .enable = exynos_vidi_enable, 438 438 .disable = exynos_vidi_disable, 439 439 }; 440 440 441 - static struct drm_encoder_funcs exynos_vidi_encoder_funcs = { 441 + static const struct drm_encoder_funcs exynos_vidi_encoder_funcs = { 442 442 .destroy = drm_encoder_cleanup, 443 443 }; 444 444
+4 -4
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 956 956 drm_connector_cleanup(connector); 957 957 } 958 958 959 - static struct drm_connector_funcs hdmi_connector_funcs = { 959 + static const struct drm_connector_funcs hdmi_connector_funcs = { 960 960 .dpms = drm_atomic_helper_connector_dpms, 961 961 .fill_modes = drm_helper_probe_single_connector_modes, 962 962 .detect = hdmi_detect, ··· 1030 1030 return &hdata->encoder; 1031 1031 } 1032 1032 1033 - static struct drm_connector_helper_funcs hdmi_connector_helper_funcs = { 1033 + static const struct drm_connector_helper_funcs hdmi_connector_helper_funcs = { 1034 1034 .get_modes = hdmi_get_modes, 1035 1035 .mode_valid = hdmi_mode_valid, 1036 1036 .best_encoder = hdmi_best_encoder, ··· 1641 1641 hdata->powered = false; 1642 1642 } 1643 1643 1644 - static struct drm_encoder_helper_funcs exynos_hdmi_encoder_helper_funcs = { 1644 + static const struct drm_encoder_helper_funcs exynos_hdmi_encoder_helper_funcs = { 1645 1645 .mode_fixup = hdmi_mode_fixup, 1646 1646 .mode_set = hdmi_mode_set, 1647 1647 .enable = hdmi_enable, 1648 1648 .disable = hdmi_disable, 1649 1649 }; 1650 1650 1651 - static struct drm_encoder_funcs exynos_hdmi_encoder_funcs = { 1651 + static const struct drm_encoder_funcs exynos_hdmi_encoder_funcs = { 1652 1652 .destroy = drm_encoder_cleanup, 1653 1653 }; 1654 1654
-1
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
··· 363 363 fsl_dev->np = dev->of_node; 364 364 drm->dev_private = fsl_dev; 365 365 dev_set_drvdata(dev, fsl_dev); 366 - drm_dev_set_unique(drm, dev_name(dev)); 367 366 368 367 ret = drm_dev_register(drm, 0); 369 368 if (ret < 0)
+7 -3
drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
··· 821 821 struct drm_device *dev = dsi_config->dev; 822 822 struct drm_psb_private *dev_priv = dev->dev_private; 823 823 int pipe = mdfld_dsi_encoder_get_pipe(dsi_encoder); 824 - 825 824 u32 pipeconf_reg = PIPEACONF; 826 825 u32 dspcntr_reg = DSPACNTR; 826 + u32 pipeconf, dspcntr; 827 827 828 - u32 pipeconf = dev_priv->pipeconf[pipe]; 829 - u32 dspcntr = dev_priv->dspcntr[pipe]; 830 828 u32 mipi = MIPI_PORT_EN | PASS_FROM_SPHY_TO_AFE | SEL_FLOPPED_HSTX; 829 + 830 + if (WARN_ON(pipe < 0)) 831 + return; 832 + 833 + pipeconf = dev_priv->pipeconf[pipe]; 834 + dspcntr = dev_priv->dspcntr[pipe]; 831 835 832 836 if (pipe) { 833 837 pipeconf_reg = PIPECCONF;
+1 -1
drivers/gpu/drm/i2c/adv7511.c
··· 752 752 adv7511->f_tmds = mode->clock; 753 753 } 754 754 755 - static struct drm_encoder_slave_funcs adv7511_encoder_funcs = { 755 + static const struct drm_encoder_slave_funcs adv7511_encoder_funcs = { 756 756 .dpms = adv7511_encoder_dpms, 757 757 .mode_valid = adv7511_encoder_mode_valid, 758 758 .mode_set = adv7511_encoder_mode_set,
+1 -1
drivers/gpu/drm/i2c/ch7006_drv.c
··· 371 371 return 0; 372 372 } 373 373 374 - static struct drm_encoder_slave_funcs ch7006_encoder_funcs = { 374 + static const struct drm_encoder_slave_funcs ch7006_encoder_funcs = { 375 375 .set_config = ch7006_encoder_set_config, 376 376 .destroy = ch7006_encoder_destroy, 377 377 .dpms = ch7006_encoder_dpms,
+1 -1
drivers/gpu/drm/i2c/sil164_drv.c
··· 341 341 drm_i2c_encoder_destroy(encoder); 342 342 } 343 343 344 - static struct drm_encoder_slave_funcs sil164_encoder_funcs = { 344 + static const struct drm_encoder_slave_funcs sil164_encoder_funcs = { 345 345 .set_config = sil164_encoder_set_config, 346 346 .destroy = sil164_encoder_destroy, 347 347 .dpms = sil164_encoder_dpms,
+24 -24
drivers/gpu/drm/i915/i915_reg.h
··· 855 855 * 856 856 * Note: DDI0 is digital port B, DD1 is digital port C, and DDI2 is 857 857 * digital port D (CHV) or port A (BXT). 858 - */ 859 - /* 860 - * Dual channel PHY (VLV/CHV/BXT) 861 - * --------------------------------- 862 - * | CH0 | CH1 | 863 - * | CMN/PLL/REF | CMN/PLL/REF | 864 - * |---------------|---------------| Display PHY 865 - * | PCS01 | PCS23 | PCS01 | PCS23 | 866 - * |-------|-------|-------|-------| 867 - * |TX0|TX1|TX2|TX3|TX0|TX1|TX2|TX3| 868 - * --------------------------------- 869 - * | DDI0 | DDI1 | DP/HDMI ports 870 - * --------------------------------- 871 858 * 872 - * Single channel PHY (CHV/BXT) 873 - * ----------------- 874 - * | CH0 | 875 - * | CMN/PLL/REF | 876 - * |---------------| Display PHY 877 - * | PCS01 | PCS23 | 878 - * |-------|-------| 879 - * |TX0|TX1|TX2|TX3| 880 - * ----------------- 881 - * | DDI2 | DP/HDMI port 882 - * ----------------- 859 + * 860 + * Dual channel PHY (VLV/CHV/BXT) 861 + * --------------------------------- 862 + * | CH0 | CH1 | 863 + * | CMN/PLL/REF | CMN/PLL/REF | 864 + * |---------------|---------------| Display PHY 865 + * | PCS01 | PCS23 | PCS01 | PCS23 | 866 + * |-------|-------|-------|-------| 867 + * |TX0|TX1|TX2|TX3|TX0|TX1|TX2|TX3| 868 + * --------------------------------- 869 + * | DDI0 | DDI1 | DP/HDMI ports 870 + * --------------------------------- 871 + * 872 + * Single channel PHY (CHV/BXT) 873 + * ----------------- 874 + * | CH0 | 875 + * | CMN/PLL/REF | 876 + * |---------------| Display PHY 877 + * | PCS01 | PCS23 | 878 + * |-------|-------| 879 + * |TX0|TX1|TX2|TX3| 880 + * ----------------- 881 + * | DDI2 | DP/HDMI port 882 + * ----------------- 883 883 */ 884 884 #define DPIO_DEVFN 0 885 885
+2 -2
drivers/gpu/drm/imx/dw_hdmi-imx.c
··· 137 137 imx_drm_set_bus_format(encoder, MEDIA_BUS_FMT_RGB888_1X24); 138 138 } 139 139 140 - static struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = { 140 + static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = { 141 141 .mode_fixup = dw_hdmi_imx_encoder_mode_fixup, 142 142 .mode_set = dw_hdmi_imx_encoder_mode_set, 143 143 .prepare = dw_hdmi_imx_encoder_prepare, ··· 145 145 .disable = dw_hdmi_imx_encoder_disable, 146 146 }; 147 147 148 - static struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = { 148 + static const struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = { 149 149 .destroy = drm_encoder_cleanup, 150 150 }; 151 151
+11 -12
drivers/gpu/drm/imx/imx-drm-core.c
··· 39 39 struct imx_drm_device { 40 40 struct drm_device *drm; 41 41 struct imx_drm_crtc *crtc[MAX_CRTC]; 42 - int pipes; 42 + unsigned int pipes; 43 43 struct drm_fbdev_cma *fbhelper; 44 44 }; 45 45 46 46 struct imx_drm_crtc { 47 47 struct drm_crtc *crtc; 48 - int pipe; 49 48 struct imx_drm_crtc_helper_funcs imx_drm_helper_funcs; 50 49 }; 51 50 ··· 53 54 module_param(legacyfb_depth, int, 0444); 54 55 #endif 55 56 56 - int imx_drm_crtc_id(struct imx_drm_crtc *crtc) 57 + unsigned int imx_drm_crtc_id(struct imx_drm_crtc *crtc) 57 58 { 58 - return crtc->pipe; 59 + return drm_crtc_index(crtc->crtc); 59 60 } 60 61 EXPORT_SYMBOL_GPL(imx_drm_crtc_id); 61 62 ··· 123 124 124 125 int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc) 125 126 { 126 - return drm_vblank_get(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe); 127 + return drm_crtc_vblank_get(imx_drm_crtc->crtc); 127 128 } 128 129 EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_get); 129 130 130 131 void imx_drm_crtc_vblank_put(struct imx_drm_crtc *imx_drm_crtc) 131 132 { 132 - drm_vblank_put(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe); 133 + drm_crtc_vblank_put(imx_drm_crtc->crtc); 133 134 } 134 135 EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_put); 135 136 136 137 void imx_drm_handle_vblank(struct imx_drm_crtc *imx_drm_crtc) 137 138 { 138 - drm_handle_vblank(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe); 139 + drm_crtc_handle_vblank(imx_drm_crtc->crtc); 139 140 } 140 141 EXPORT_SYMBOL_GPL(imx_drm_handle_vblank); 141 142 ··· 214 215 drm_fbdev_cma_hotplug_event(imxdrm->fbhelper); 215 216 } 216 217 217 - static struct drm_mode_config_funcs imx_drm_mode_config_funcs = { 218 + static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = { 218 219 .fb_create = drm_fb_cma_create, 219 220 .output_poll_changed = imx_drm_output_poll_changed, 220 221 }; ··· 355 356 return -ENOMEM; 356 357 357 358 imx_drm_crtc->imx_drm_helper_funcs = *imx_drm_helper_funcs; 358 - imx_drm_crtc->pipe = imxdrm->pipes++; 359 359 imx_drm_crtc->crtc = crtc; 360 360 361 361 crtc->port = port; 362 362 363 - imxdrm->crtc[imx_drm_crtc->pipe] = imx_drm_crtc; 363 + imxdrm->crtc[imxdrm->pipes++] = imx_drm_crtc; 364 364 365 365 *new_crtc = imx_drm_crtc; 366 366 ··· 376 378 return 0; 377 379 378 380 err_register: 379 - imxdrm->crtc[imx_drm_crtc->pipe] = NULL; 381 + imxdrm->crtc[--imxdrm->pipes] = NULL; 380 382 kfree(imx_drm_crtc); 381 383 return ret; 382 384 } ··· 388 390 int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc) 389 391 { 390 392 struct imx_drm_device *imxdrm = imx_drm_crtc->crtc->dev->dev_private; 393 + unsigned int pipe = drm_crtc_index(imx_drm_crtc->crtc); 391 394 392 395 drm_crtc_cleanup(imx_drm_crtc->crtc); 393 396 394 - imxdrm->crtc[imx_drm_crtc->pipe] = NULL; 397 + imxdrm->crtc[pipe] = NULL; 395 398 396 399 kfree(imx_drm_crtc); 397 400
+1 -1
drivers/gpu/drm/imx/imx-drm.h
··· 13 13 struct imx_drm_crtc; 14 14 struct platform_device; 15 15 16 - int imx_drm_crtc_id(struct imx_drm_crtc *crtc); 16 + unsigned int imx_drm_crtc_id(struct imx_drm_crtc *crtc); 17 17 18 18 struct imx_drm_crtc_helper_funcs { 19 19 int (*enable_vblank)(struct drm_crtc *crtc);
+4 -4
drivers/gpu/drm/imx/imx-ldb.c
··· 358 358 drm_panel_unprepare(imx_ldb_ch->panel); 359 359 } 360 360 361 - static struct drm_connector_funcs imx_ldb_connector_funcs = { 361 + static const struct drm_connector_funcs imx_ldb_connector_funcs = { 362 362 .dpms = drm_helper_connector_dpms, 363 363 .fill_modes = drm_helper_probe_single_connector_modes, 364 364 .detect = imx_ldb_connector_detect, 365 365 .destroy = imx_drm_connector_destroy, 366 366 }; 367 367 368 - static struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs = { 368 + static const struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs = { 369 369 .get_modes = imx_ldb_connector_get_modes, 370 370 .best_encoder = imx_ldb_connector_best_encoder, 371 371 }; 372 372 373 - static struct drm_encoder_funcs imx_ldb_encoder_funcs = { 373 + static const struct drm_encoder_funcs imx_ldb_encoder_funcs = { 374 374 .destroy = imx_drm_encoder_destroy, 375 375 }; 376 376 377 - static struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = { 377 + static const struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = { 378 378 .dpms = imx_ldb_encoder_dpms, 379 379 .mode_fixup = imx_ldb_encoder_mode_fixup, 380 380 .prepare = imx_ldb_encoder_prepare,
+4 -4
drivers/gpu/drm/imx/imx-tve.c
··· 360 360 tve_disable(tve); 361 361 } 362 362 363 - static struct drm_connector_funcs imx_tve_connector_funcs = { 363 + static const struct drm_connector_funcs imx_tve_connector_funcs = { 364 364 .dpms = drm_helper_connector_dpms, 365 365 .fill_modes = drm_helper_probe_single_connector_modes, 366 366 .detect = imx_tve_connector_detect, 367 367 .destroy = imx_drm_connector_destroy, 368 368 }; 369 369 370 - static struct drm_connector_helper_funcs imx_tve_connector_helper_funcs = { 370 + static const struct drm_connector_helper_funcs imx_tve_connector_helper_funcs = { 371 371 .get_modes = imx_tve_connector_get_modes, 372 372 .best_encoder = imx_tve_connector_best_encoder, 373 373 .mode_valid = imx_tve_connector_mode_valid, 374 374 }; 375 375 376 - static struct drm_encoder_funcs imx_tve_encoder_funcs = { 376 + static const struct drm_encoder_funcs imx_tve_encoder_funcs = { 377 377 .destroy = imx_drm_encoder_destroy, 378 378 }; 379 379 380 - static struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = { 380 + static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = { 381 381 .dpms = imx_tve_encoder_dpms, 382 382 .mode_fixup = imx_tve_encoder_mode_fixup, 383 383 .prepare = imx_tve_encoder_prepare,
+1 -1
drivers/gpu/drm/imx/ipuv3-crtc.c
··· 270 270 ipu_fb_enable(ipu_crtc); 271 271 } 272 272 273 - static struct drm_crtc_helper_funcs ipu_helper_funcs = { 273 + static const struct drm_crtc_helper_funcs ipu_helper_funcs = { 274 274 .dpms = ipu_crtc_dpms, 275 275 .mode_fixup = ipu_crtc_mode_fixup, 276 276 .mode_set = ipu_crtc_mode_set,
+4 -4
drivers/gpu/drm/imx/parallel-display.c
··· 148 148 drm_panel_unprepare(imxpd->panel); 149 149 } 150 150 151 - static struct drm_connector_funcs imx_pd_connector_funcs = { 151 + static const struct drm_connector_funcs imx_pd_connector_funcs = { 152 152 .dpms = drm_helper_connector_dpms, 153 153 .fill_modes = drm_helper_probe_single_connector_modes, 154 154 .detect = imx_pd_connector_detect, 155 155 .destroy = imx_drm_connector_destroy, 156 156 }; 157 157 158 - static struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = { 158 + static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = { 159 159 .get_modes = imx_pd_connector_get_modes, 160 160 .best_encoder = imx_pd_connector_best_encoder, 161 161 }; 162 162 163 - static struct drm_encoder_funcs imx_pd_encoder_funcs = { 163 + static const struct drm_encoder_funcs imx_pd_encoder_funcs = { 164 164 .destroy = imx_drm_encoder_destroy, 165 165 }; 166 166 167 - static struct drm_encoder_helper_funcs imx_pd_encoder_helper_funcs = { 167 + static const struct drm_encoder_helper_funcs imx_pd_encoder_helper_funcs = { 168 168 .dpms = imx_pd_encoder_dpms, 169 169 .mode_fixup = imx_pd_encoder_mode_fixup, 170 170 .prepare = imx_pd_encoder_prepare,
+2 -2
drivers/gpu/drm/mgag200/mgag200_mode.c
··· 1684 1684 kfree(connector); 1685 1685 } 1686 1686 1687 - struct drm_connector_helper_funcs mga_vga_connector_helper_funcs = { 1687 + static const struct drm_connector_helper_funcs mga_vga_connector_helper_funcs = { 1688 1688 .get_modes = mga_vga_get_modes, 1689 1689 .mode_valid = mga_vga_mode_valid, 1690 1690 .best_encoder = mga_connector_best_encoder, 1691 1691 }; 1692 1692 1693 - struct drm_connector_funcs mga_vga_connector_funcs = { 1693 + static const struct drm_connector_funcs mga_vga_connector_funcs = { 1694 1694 .dpms = drm_helper_connector_dpms, 1695 1695 .detect = mga_vga_detect, 1696 1696 .fill_modes = drm_helper_probe_single_connector_modes,
+3 -3
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
··· 769 769 kfree(tv_enc); 770 770 } 771 771 772 - static struct drm_encoder_helper_funcs nv17_tv_helper_funcs = { 772 + static const struct drm_encoder_helper_funcs nv17_tv_helper_funcs = { 773 773 .dpms = nv17_tv_dpms, 774 774 .mode_fixup = nv17_tv_mode_fixup, 775 775 .prepare = nv17_tv_prepare, ··· 778 778 .detect = nv17_tv_detect, 779 779 }; 780 780 781 - static struct drm_encoder_slave_funcs nv17_tv_slave_funcs = { 781 + static const struct drm_encoder_slave_funcs nv17_tv_slave_funcs = { 782 782 .get_modes = nv17_tv_get_modes, 783 783 .mode_valid = nv17_tv_mode_valid, 784 784 .create_resources = nv17_tv_create_resources, 785 785 .set_property = nv17_tv_set_property, 786 786 }; 787 787 788 - static struct drm_encoder_funcs nv17_tv_funcs = { 788 + static const struct drm_encoder_funcs nv17_tv_funcs = { 789 789 .destroy = nv17_tv_destroy, 790 790 }; 791 791
-4
drivers/gpu/drm/nouveau/nouveau_drm.c
··· 1046 1046 goto err_free; 1047 1047 } 1048 1048 1049 - err = drm_dev_set_unique(drm, "%s", dev_name(&pdev->dev)); 1050 - if (err < 0) 1051 - goto err_free; 1052 - 1053 1049 drm->platformdev = pdev; 1054 1050 platform_set_drvdata(pdev, drm); 1055 1051
+1 -1
drivers/gpu/drm/nouveau/nouveau_encoder.h
··· 83 83 return &enc->base.base; 84 84 } 85 85 86 - static inline struct drm_encoder_slave_funcs * 86 + static inline const struct drm_encoder_slave_funcs * 87 87 get_slave_funcs(struct drm_encoder *enc) 88 88 { 89 89 return to_encoder_slave(enc)->slave_funcs;
+2 -5
drivers/gpu/drm/omapdrm/tcm-sita.c
··· 87 87 if (width == 0 || height == 0) 88 88 return NULL; 89 89 90 - tcm = kmalloc(sizeof(*tcm), GFP_KERNEL); 91 - pvt = kmalloc(sizeof(*pvt), GFP_KERNEL); 90 + tcm = kzalloc(sizeof(*tcm), GFP_KERNEL); 91 + pvt = kzalloc(sizeof(*pvt), GFP_KERNEL); 92 92 if (!tcm || !pvt) 93 93 goto error; 94 - 95 - memset(tcm, 0, sizeof(*tcm)); 96 - memset(pvt, 0, sizeof(*pvt)); 97 94 98 95 /* Updating the pointers to SiTA implementation APIs */ 99 96 tcm->height = height;
+1 -1
drivers/gpu/drm/qxl/qxl_object.c
··· 32 32 struct qxl_bo *bo; 33 33 struct qxl_device *qdev; 34 34 35 - bo = container_of(tbo, struct qxl_bo, tbo); 35 + bo = to_qxl_bo(tbo); 36 36 qdev = (struct qxl_device *)bo->gem_base.dev->dev_private; 37 37 38 38 qxl_surface_evict(qdev, bo, false);
+2 -2
drivers/gpu/drm/qxl/qxl_ttm.c
··· 201 201 placement->num_busy_placement = 1; 202 202 return; 203 203 } 204 - qbo = container_of(bo, struct qxl_bo, tbo); 204 + qbo = to_qxl_bo(bo); 205 205 qxl_ttm_placement_from_domain(qbo, QXL_GEM_DOMAIN_CPU, false); 206 206 *placement = qbo->placement; 207 207 } ··· 365 365 366 366 if (!qxl_ttm_bo_is_qxl_bo(bo)) 367 367 return; 368 - qbo = container_of(bo, struct qxl_bo, tbo); 368 + qbo = to_qxl_bo(bo); 369 369 qdev = qbo->gem_base.dev->dev_private; 370 370 371 371 if (bo->mem.mem_type == TTM_PL_PRIV0 && qbo->surface_id)
+3 -3
drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
··· 28 28 { 29 29 struct rcar_du_connector *con = to_rcar_connector(connector); 30 30 struct drm_encoder *encoder = rcar_encoder_to_drm_encoder(con->encoder); 31 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 31 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 32 32 33 33 if (sfuncs->get_modes == NULL) 34 34 return 0; ··· 41 41 { 42 42 struct rcar_du_connector *con = to_rcar_connector(connector); 43 43 struct drm_encoder *encoder = rcar_encoder_to_drm_encoder(con->encoder); 44 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 44 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 45 45 46 46 if (sfuncs->mode_valid == NULL) 47 47 return MODE_OK; ··· 66 66 { 67 67 struct rcar_du_connector *con = to_rcar_connector(connector); 68 68 struct drm_encoder *encoder = rcar_encoder_to_drm_encoder(con->encoder); 69 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 69 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 70 70 71 71 if (sfuncs->detect == NULL) 72 72 return connector_status_unknown;
+4 -4
drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
··· 35 35 static void rcar_du_hdmienc_disable(struct drm_encoder *encoder) 36 36 { 37 37 struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder); 38 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 38 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 39 39 40 40 if (sfuncs->dpms) 41 41 sfuncs->dpms(encoder, DRM_MODE_DPMS_OFF); ··· 50 50 static void rcar_du_hdmienc_enable(struct drm_encoder *encoder) 51 51 { 52 52 struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder); 53 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 53 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 54 54 55 55 if (hdmienc->renc->lvds) 56 56 rcar_du_lvdsenc_enable(hdmienc->renc->lvds, encoder->crtc, ··· 67 67 struct drm_connector_state *conn_state) 68 68 { 69 69 struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder); 70 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 70 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 71 71 struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; 72 72 const struct drm_display_mode *mode = &crtc_state->mode; 73 73 ··· 89 89 struct drm_display_mode *adjusted_mode) 90 90 { 91 91 struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder); 92 - struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 92 + const struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); 93 93 94 94 if (sfuncs->mode_set) 95 95 sfuncs->mode_set(encoder, mode, adjusted_mode);
+2 -2
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
··· 173 173 return (valid) ? MODE_OK : MODE_BAD; 174 174 } 175 175 176 - static struct drm_encoder_funcs dw_hdmi_rockchip_encoder_funcs = { 176 + static const struct drm_encoder_funcs dw_hdmi_rockchip_encoder_funcs = { 177 177 .destroy = drm_encoder_cleanup, 178 178 }; 179 179 ··· 218 218 ROCKCHIP_OUT_MODE_AAAA); 219 219 } 220 220 221 - static struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_funcs = { 221 + static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_funcs = { 222 222 .mode_fixup = dw_hdmi_rockchip_encoder_mode_fixup, 223 223 .mode_set = dw_hdmi_rockchip_encoder_mode_set, 224 224 .prepare = dw_hdmi_rockchip_encoder_prepare,
-4
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
··· 450 450 if (!drm) 451 451 return -ENOMEM; 452 452 453 - ret = drm_dev_set_unique(drm, "%s", dev_name(dev)); 454 - if (ret) 455 - goto err_free; 456 - 457 453 ret = drm_dev_register(drm, 0); 458 454 if (ret) 459 455 goto err_free;
+1 -1
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
··· 66 66 rockchip_fb->obj[0], handle); 67 67 } 68 68 69 - static struct drm_framebuffer_funcs rockchip_drm_fb_funcs = { 69 + static const struct drm_framebuffer_funcs rockchip_drm_fb_funcs = { 70 70 .destroy = rockchip_drm_fb_destroy, 71 71 .create_handle = rockchip_drm_fb_create_handle, 72 72 };
-1
drivers/gpu/drm/tegra/drm.c
··· 990 990 if (!drm) 991 991 return -ENOMEM; 992 992 993 - drm_dev_set_unique(drm, dev_name(&dev->dev)); 994 993 dev_set_drvdata(&dev->dev, drm); 995 994 996 995 err = drm_dev_register(drm, 0);
+1 -1
drivers/gpu/drm/tegra/fb.c
··· 88 88 return drm_gem_handle_create(file, &fb->planes[0]->gem, handle); 89 89 } 90 90 91 - static struct drm_framebuffer_funcs tegra_fb_funcs = { 91 + static const struct drm_framebuffer_funcs tegra_fb_funcs = { 92 92 .destroy = tegra_fb_destroy, 93 93 .create_handle = tegra_fb_create_handle, 94 94 };
+2 -2
drivers/gpu/drm/udl/udl_connector.c
··· 122 122 kfree(connector); 123 123 } 124 124 125 - static struct drm_connector_helper_funcs udl_connector_helper_funcs = { 125 + static const struct drm_connector_helper_funcs udl_connector_helper_funcs = { 126 126 .get_modes = udl_get_modes, 127 127 .mode_valid = udl_mode_valid, 128 128 .best_encoder = udl_best_single_encoder, 129 129 }; 130 130 131 - static struct drm_connector_funcs udl_connector_funcs = { 131 + static const struct drm_connector_funcs udl_connector_funcs = { 132 132 .dpms = drm_helper_connector_dpms, 133 133 .detect = udl_detect, 134 134 .fill_modes = drm_helper_probe_single_connector_modes,
+1 -1
drivers/gpu/drm/udl/udl_modeset.c
··· 400 400 udl_crtc_dpms(crtc, DRM_MODE_DPMS_ON); 401 401 } 402 402 403 - static struct drm_crtc_helper_funcs udl_helper_funcs = { 403 + static const struct drm_crtc_helper_funcs udl_helper_funcs = { 404 404 .dpms = udl_crtc_dpms, 405 405 .mode_fixup = udl_crtc_mode_fixup, 406 406 .mode_set = udl_crtc_mode_set,
-2
drivers/gpu/drm/vc4/vc4_drv.c
··· 184 184 vc4->dev = drm; 185 185 drm->dev_private = vc4; 186 186 187 - drm_dev_set_unique(drm, dev_name(dev)); 188 - 189 187 vc4_bo_cache_init(drm); 190 188 191 189 drm_mode_config_init(drm);
+2 -2
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 470 470 } 471 471 472 472 473 - static struct drm_framebuffer_funcs vmw_framebuffer_surface_funcs = { 473 + static const struct drm_framebuffer_funcs vmw_framebuffer_surface_funcs = { 474 474 .destroy = vmw_framebuffer_surface_destroy, 475 475 .dirty = vmw_framebuffer_surface_dirty, 476 476 }; ··· 647 647 return ret; 648 648 } 649 649 650 - static struct drm_framebuffer_funcs vmw_framebuffer_dmabuf_funcs = { 650 + static const struct drm_framebuffer_funcs vmw_framebuffer_dmabuf_funcs = { 651 651 .destroy = vmw_framebuffer_dmabuf_destroy, 652 652 .dirty = vmw_framebuffer_dmabuf_dirty, 653 653 };
+3 -3
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
··· 294 294 return vmw_ldu_commit_list(dev_priv); 295 295 } 296 296 297 - static struct drm_crtc_funcs vmw_legacy_crtc_funcs = { 297 + static const struct drm_crtc_funcs vmw_legacy_crtc_funcs = { 298 298 .cursor_set = vmw_du_crtc_cursor_set, 299 299 .cursor_move = vmw_du_crtc_cursor_move, 300 300 .gamma_set = vmw_du_crtc_gamma_set, ··· 312 312 vmw_ldu_destroy(vmw_encoder_to_ldu(encoder)); 313 313 } 314 314 315 - static struct drm_encoder_funcs vmw_legacy_encoder_funcs = { 315 + static const struct drm_encoder_funcs vmw_legacy_encoder_funcs = { 316 316 .destroy = vmw_ldu_encoder_destroy, 317 317 }; 318 318 ··· 325 325 vmw_ldu_destroy(vmw_connector_to_ldu(connector)); 326 326 } 327 327 328 - static struct drm_connector_funcs vmw_legacy_connector_funcs = { 328 + static const struct drm_connector_funcs vmw_legacy_connector_funcs = { 329 329 .dpms = vmw_du_connector_dpms, 330 330 .detect = vmw_du_connector_detect, 331 331 .fill_modes = vmw_du_connector_fill_modes,
+3 -3
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
··· 530 530 return ret; 531 531 } 532 532 533 - static struct drm_crtc_funcs vmw_screen_object_crtc_funcs = { 533 + static const struct drm_crtc_funcs vmw_screen_object_crtc_funcs = { 534 534 .cursor_set = vmw_du_crtc_cursor_set, 535 535 .cursor_move = vmw_du_crtc_cursor_move, 536 536 .gamma_set = vmw_du_crtc_gamma_set, ··· 548 548 vmw_sou_destroy(vmw_encoder_to_sou(encoder)); 549 549 } 550 550 551 - static struct drm_encoder_funcs vmw_screen_object_encoder_funcs = { 551 + static const struct drm_encoder_funcs vmw_screen_object_encoder_funcs = { 552 552 .destroy = vmw_sou_encoder_destroy, 553 553 }; 554 554 ··· 561 561 vmw_sou_destroy(vmw_connector_to_sou(connector)); 562 562 } 563 563 564 - static struct drm_connector_funcs vmw_sou_connector_funcs = { 564 + static const struct drm_connector_funcs vmw_sou_connector_funcs = { 565 565 .dpms = vmw_du_connector_dpms, 566 566 .set_property = vmw_du_connector_set_property, 567 567 .destroy = vmw_sou_connector_destroy,
+3 -3
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
··· 1040 1040 /* 1041 1041 * Screen Target CRTC dispatch table 1042 1042 */ 1043 - static struct drm_crtc_funcs vmw_stdu_crtc_funcs = { 1043 + static const struct drm_crtc_funcs vmw_stdu_crtc_funcs = { 1044 1044 .cursor_set = vmw_du_crtc_cursor_set, 1045 1045 .cursor_move = vmw_du_crtc_cursor_move, 1046 1046 .gamma_set = vmw_du_crtc_gamma_set, ··· 1070 1070 vmw_stdu_destroy(vmw_encoder_to_stdu(encoder)); 1071 1071 } 1072 1072 1073 - static struct drm_encoder_funcs vmw_stdu_encoder_funcs = { 1073 + static const struct drm_encoder_funcs vmw_stdu_encoder_funcs = { 1074 1074 .destroy = vmw_stdu_encoder_destroy, 1075 1075 }; 1076 1076 ··· 1097 1097 1098 1098 1099 1099 1100 - static struct drm_connector_funcs vmw_stdu_connector_funcs = { 1100 + static const struct drm_connector_funcs vmw_stdu_connector_funcs = { 1101 1101 .dpms = vmw_du_connector_dpms, 1102 1102 .detect = vmw_du_connector_detect, 1103 1103 .fill_modes = vmw_du_connector_fill_modes,
+3 -6
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
··· 771 771 } 772 772 srf->offsets = kmalloc(srf->num_sizes * sizeof(*srf->offsets), 773 773 GFP_KERNEL); 774 - if (unlikely(srf->sizes == NULL)) { 774 + if (unlikely(srf->offsets == NULL)) { 775 775 ret = -ENOMEM; 776 776 goto out_no_offsets; 777 777 } ··· 815 815 srf->sizes[0].height == 64 && 816 816 srf->format == SVGA3D_A8R8G8B8) { 817 817 818 - srf->snooper.image = kmalloc(64 * 64 * 4, GFP_KERNEL); 819 - /* clear the image */ 820 - if (srf->snooper.image) { 821 - memset(srf->snooper.image, 0x00, 64 * 64 * 4); 822 - } else { 818 + srf->snooper.image = kzalloc(64 * 64 * 4, GFP_KERNEL); 819 + if (!srf->snooper.image) { 823 820 DRM_ERROR("Failed to allocate cursor_image\n"); 824 821 ret = -ENOMEM; 825 822 goto out_no_copy;
+1 -1
include/drm/drmP.h
··· 1068 1068 void drm_dev_unref(struct drm_device *dev); 1069 1069 int drm_dev_register(struct drm_device *dev, unsigned long flags); 1070 1070 void drm_dev_unregister(struct drm_device *dev); 1071 - int drm_dev_set_unique(struct drm_device *dev, const char *fmt, ...); 1071 + int drm_dev_set_unique(struct drm_device *dev, const char *name); 1072 1072 1073 1073 struct drm_minor *drm_minor_acquire(unsigned int minor_id); 1074 1074 void drm_minor_release(struct drm_minor *minor);
+17 -1
include/drm/drm_crtc.h
··· 172 172 * Clean up framebuffer resources, specifically also unreference the 173 173 * backing storage. The core guarantees to call this function for every 174 174 * framebuffer successfully created by ->fb_create() in 175 - * &drm_mode_config_funcs. 175 + * &drm_mode_config_funcs. Drivers must also call 176 + * drm_framebuffer_cleanup() to release DRM core resources for this 177 + * framebuffer. 176 178 */ 177 179 void (*destroy)(struct drm_framebuffer *framebuffer); 178 180 ··· 188 186 * be used for seamless transitions between modesetting clients by 189 187 * copying the current screen contents to a private buffer and blending 190 188 * between that and the new contents. 189 + * 190 + * GEM based drivers should call drm_gem_handle_create() to create the 191 + * handle. 191 192 * 192 193 * RETURNS: 193 194 * ··· 1735 1730 * Create a new framebuffer object. The core does basic checks on the 1736 1731 * requested metadata, but most of that is left to the driver. See 1737 1732 * struct &drm_mode_fb_cmd2 for details. 1733 + * 1734 + * If the parameters are deemed valid and the backing storage objects in 1735 + * the underlying memory manager all exist, then the driver allocates 1736 + * a new &drm_framebuffer structure, subclassed to contain 1737 + * driver-specific information (like the internal native buffer object 1738 + * references). It also needs to fill out all relevant metadata, which 1739 + * should be done by calling drm_helper_mode_fill_fb_struct(). 1740 + * 1741 + * The initialization is finalized by calling drm_framebuffer_init(), 1742 + * which registers the framebuffer and makes it accessible to other 1743 + * threads. 1738 1744 * 1739 1745 * RETURNS: 1740 1746 *
+1 -1
include/drm/drm_encoder_slave.h
··· 95 95 struct drm_encoder_slave { 96 96 struct drm_encoder base; 97 97 98 - struct drm_encoder_slave_funcs *slave_funcs; 98 + const struct drm_encoder_slave_funcs *slave_funcs; 99 99 void *slave_priv; 100 100 void *bus_priv; 101 101 };