History

Merge tag 'drm-misc-next-2021-01-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v5.12: Core Changes: - Lots of drm documentation updates by Simor Ser. - Require that each crtc has a unique primary plane. - Add fixme that fbdev_generic_setup is confusing. Driver Changes: - Update addresses for TI display drivers maintainers. - Make DRM_VIRTIO_GPU select VIRTIO. - Small fixes to qxl, virtio, hisilicon, tve200, panel/s6e63m0.

Daniel Vetter committed 5 years ago

Commit cb3cfbf2 parents 73dc923 cf9a4be15 files · +174 −99Browse files

Unified · Split

15 files
  1. Documentation/gpu/drm-kms.rst +35 −17
  2. Documentation/gpu/drm-uapi.rst +3 −0
  3. MAINTAINERS +5 −5
  4. drivers/gpu/drm/drm_blend.c +0 −6
  5. drivers/gpu/drm/drm_fb_helper.c +5 −0
  6. drivers/gpu/drm/drm_mode_config.c +30 −0
  7. drivers/gpu/drm/drm_plane.c +18 −0
  8. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +4 −8
  9. drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +13 −4
  10. drivers/gpu/drm/qxl/qxl_dev.h +8 −8
  11. drivers/gpu/drm/tve200/tve200_display.c +0 −1
  12. drivers/gpu/drm/tve200/tve200_drv.c +0 −1
  13. drivers/gpu/drm/virtio/Kconfig +2 −1
  14. drivers/gpu/drm/virtio/virtgpu_vram.c +2 −0
  15. include/uapi/drm/drm.h +49 −48
Documentation/gpu/drm-kms.rst+35−17
@@ -319,6 +319,15 @@ CRTC Functions Reference · 318 unmodified lines
319.. kernel-doc:: drivers/gpu/drm/drm_crtc.c319.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
320 :export:320 :export:
321 321
322Color Management Functions Reference
323------------------------------------
324
325.. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c
326 :export:
327
328.. kernel-doc:: include/drm/drm_color_mgmt.h
329 :internal:
330
322Frame Buffer Abstraction331Frame Buffer Abstraction
323========================332========================
324 333
@@ -370,6 +379,21 @@ Plane Functions Reference · 45 unmodified lines
370.. kernel-doc:: drivers/gpu/drm/drm_plane.c379.. kernel-doc:: drivers/gpu/drm/drm_plane.c
371 :export:380 :export:
372 381
382Plane Composition Functions Reference
383-------------------------------------
384
385.. kernel-doc:: drivers/gpu/drm/drm_blend.c
386 :export:
387
388Plane Damage Tracking Functions Reference
389-----------------------------------------
390
391.. kernel-doc:: drivers/gpu/drm/drm_damage_helper.c
392 :export:
393
394.. kernel-doc:: include/drm/drm_damage_helper.h
395 :internal:
396
373Display Modes Function Reference397Display Modes Function Reference
374================================398================================
375 399
@@ -436,6 +460,9 @@ KMS Locking · 60 unmodified lines
436KMS Properties460KMS Properties
437==============461==============
438 462
463This section of the documentation is primarily aimed at user-space developers.
464For the driver APIs, see the other sections.
465
439Property Types and Blob Property Support466Property Types and Blob Property Support
440----------------------------------------467----------------------------------------
441 468
@@ -466,39 +493,30 @@ Standard CRTC Properties · 24 unmodified lines
466.. kernel-doc:: drivers/gpu/drm/drm_crtc.c493.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
467 :doc: standard CRTC properties494 :doc: standard CRTC properties
468 495
496Standard Plane Properties
497-------------------------
498
499.. kernel-doc:: drivers/gpu/drm/drm_plane.c
500 :doc: standard plane properties
501
469Plane Composition Properties502Plane Composition Properties
470----------------------------503----------------------------
471 504
472.. kernel-doc:: drivers/gpu/drm/drm_blend.c505.. kernel-doc:: drivers/gpu/drm/drm_blend.c
473 :doc: overview506 :doc: overview
474 507
475.. kernel-doc:: drivers/gpu/drm/drm_blend.c508Damage Tracking Properties
476 :export:509--------------------------
477
478FB_DAMAGE_CLIPS
479~~~~~~~~~~~~~~~
480 510
481.. kernel-doc:: drivers/gpu/drm/drm_damage_helper.c511.. kernel-doc:: drivers/gpu/drm/drm_damage_helper.c
482 :doc: overview512 :doc: overview
483 513
484.. kernel-doc:: drivers/gpu/drm/drm_damage_helper.c
485 :export:
486
487.. kernel-doc:: include/drm/drm_damage_helper.h
488 :internal:
489
490Color Management Properties514Color Management Properties
491---------------------------515---------------------------
492 516
493.. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c517.. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c
494 :doc: overview518 :doc: overview
495 519
496.. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c
497 :export:
498
499.. kernel-doc:: include/drm/drm_color_mgmt.h
500 :internal:
501
502Tile Group Property520Tile Group Property
503-------------------521-------------------
504 522
Documentation/gpu/drm-uapi.rst+3−0
@@ -457,5 +457,8 @@ Userspace API Structures · 456 unmodified lines
457.. kernel-doc:: include/uapi/drm/drm_mode.h457.. kernel-doc:: include/uapi/drm/drm_mode.h
458 :doc: overview458 :doc: overview
459 459
460.. kernel-doc:: include/uapi/drm/drm.h
461 :internal:
462
460.. kernel-doc:: include/uapi/drm/drm_mode.h463.. kernel-doc:: include/uapi/drm/drm_mode.h
461 :internal:464 :internal:
MAINTAINERS+5−5
@@ -5985,8 +5985,8 @@ F: Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml · 5984 unmodified lines
5985F: drivers/gpu/drm/stm5985F: drivers/gpu/drm/stm
5986 5986
5987DRM DRIVERS FOR TI KEYSTONE5987DRM DRIVERS FOR TI KEYSTONE
5988M: Jyri Sarha <jsarha@ti.com>5988M: Jyri Sarha <jyri.sarha@iki.fi>
5989M: Tomi Valkeinen <tomi.valkeinen@ti.com>5989M: Tomi Valkeinen <tomba@kernel.org>
5990L: dri-devel@lists.freedesktop.org5990L: dri-devel@lists.freedesktop.org
5991S: Maintained5991S: Maintained
5992T: git git://anongit.freedesktop.org/drm/drm-misc5992T: git git://anongit.freedesktop.org/drm/drm-misc
@@ -5996,15 +5996,15 @@ F: Documentation/devicetree/bindings/display/ti/ti,k2g-dss.yaml · 3 unmodified lines
5996F: drivers/gpu/drm/tidss/5996F: drivers/gpu/drm/tidss/
5997 5997
5998DRM DRIVERS FOR TI LCDC5998DRM DRIVERS FOR TI LCDC
5999M: Jyri Sarha <jsarha@ti.com>5999M: Jyri Sarha <jyri.sarha@iki.fi>
6000R: Tomi Valkeinen <tomi.valkeinen@ti.com>6000R: Tomi Valkeinen <tomba@kernel.org>
6001L: dri-devel@lists.freedesktop.org6001L: dri-devel@lists.freedesktop.org
6002S: Maintained6002S: Maintained
6003F: Documentation/devicetree/bindings/display/tilcdc/6003F: Documentation/devicetree/bindings/display/tilcdc/
6004F: drivers/gpu/drm/tilcdc/6004F: drivers/gpu/drm/tilcdc/
6005 6005
6006DRM DRIVERS FOR TI OMAP6006DRM DRIVERS FOR TI OMAP
6007M: Tomi Valkeinen <tomi.valkeinen@ti.com>6007M: Tomi Valkeinen <tomba@kernel.org>
6008L: dri-devel@lists.freedesktop.org6008L: dri-devel@lists.freedesktop.org
6009S: Maintained6009S: Maintained
6010F: Documentation/devicetree/bindings/display/ti/6010F: Documentation/devicetree/bindings/display/ti/
drivers/gpu/drm/drm_blend.c+0−6
@@ -185,12 +185,6 @@ · 184 unmodified lines
185 * plane does not expose the "alpha" property, then this is185 * plane does not expose the "alpha" property, then this is
186 * assumed to be 1.0186 * assumed to be 1.0
187 *187 *
188 * IN_FORMATS:
189 * Blob property which contains the set of buffer format and modifier
190 * pairs supported by this plane. The blob is a drm_format_modifier_blob
191 * struct. Without this property the plane doesn't support buffers with
192 * modifiers. Userspace cannot change this property.
193 *
194 * Note that all the property extensions described here apply either to the188 * Note that all the property extensions described here apply either to the
195 * plane or the CRTC (e.g. for the background color, which currently is not189 * plane or the CRTC (e.g. for the background color, which currently is not
196 * exposed and assumed to be black).190 * exposed and assumed to be black).
drivers/gpu/drm/drm_fb_helper.c+5−0
@@ -2496,6 +2496,11 @@ void drm_fbdev_generic_setup(struct drm_device *dev, · 2495 unmodified lines
2496 return;2496 return;
2497 }2497 }
2498 2498
2499 /*
2500 * FIXME: This mixes up depth with bpp, which results in a glorious
2501 * mess, resulting in some drivers picking wrong fbdev defaults and
2502 * others wrong preferred_depth defaults.
2503 */
2499 if (!preferred_bpp)2504 if (!preferred_bpp)
2500 preferred_bpp = dev->mode_config.preferred_depth;2505 preferred_bpp = dev->mode_config.preferred_depth;
2501 if (!preferred_bpp)2506 if (!preferred_bpp)
drivers/gpu/drm/drm_mode_config.c+30−0
@@ -626,6 +626,9 @@ void drm_mode_config_validate(struct drm_device *dev) · 625 unmodified lines
626{626{
627 struct drm_encoder *encoder;627 struct drm_encoder *encoder;
628 struct drm_crtc *crtc;628 struct drm_crtc *crtc;
629 struct drm_plane *plane;
630 u32 primary_with_crtc = 0, cursor_with_crtc = 0;
631 unsigned int num_primary = 0;
629 632
630 if (!drm_core_check_feature(dev, DRIVER_MODESET))633 if (!drm_core_check_feature(dev, DRIVER_MODESET))
631 return;634 return;
@@ -642,17 +645,44 @@ void drm_mode_config_validate(struct drm_device *dev) · 10 unmodified lines
642 WARN(!crtc->primary, "Missing primary plane on [CRTC:%d:%s]\n",645 WARN(!crtc->primary, "Missing primary plane on [CRTC:%d:%s]\n",
643 crtc->base.id, crtc->name);646 crtc->base.id, crtc->name);
644 647
648 WARN(crtc->cursor && crtc->funcs->cursor_set,
649 "[CRTC:%d:%s] must not have both a cursor plane and a cursor_set func",
650 crtc->base.id, crtc->name);
651 WARN(crtc->cursor && crtc->funcs->cursor_set2,
652 "[CRTC:%d:%s] must not have both a cursor plane and a cursor_set2 func",
653 crtc->base.id, crtc->name);
654 WARN(crtc->cursor && crtc->funcs->cursor_move,
655 "[CRTC:%d:%s] must not have both a cursor plane and a cursor_move func",
656 crtc->base.id, crtc->name);
657
645 if (crtc->primary) {658 if (crtc->primary) {
646 WARN(!(crtc->primary->possible_crtcs & drm_crtc_mask(crtc)),659 WARN(!(crtc->primary->possible_crtcs & drm_crtc_mask(crtc)),
647 "Bogus primary plane possible_crtcs: [PLANE:%d:%s] must be compatible with [CRTC:%d:%s]\n",660 "Bogus primary plane possible_crtcs: [PLANE:%d:%s] must be compatible with [CRTC:%d:%s]\n",
648 crtc->primary->base.id, crtc->primary->name,661 crtc->primary->base.id, crtc->primary->name,
649 crtc->base.id, crtc->name);662 crtc->base.id, crtc->name);
663 WARN(primary_with_crtc & drm_plane_mask(crtc->primary),
664 "Primary plane [PLANE:%d:%s] used for multiple CRTCs",
665 crtc->primary->base.id, crtc->primary->name);
666 primary_with_crtc |= drm_plane_mask(crtc->primary);
650 }667 }
651 if (crtc->cursor) {668 if (crtc->cursor) {
652 WARN(!(crtc->cursor->possible_crtcs & drm_crtc_mask(crtc)),669 WARN(!(crtc->cursor->possible_crtcs & drm_crtc_mask(crtc)),
653 "Bogus cursor plane possible_crtcs: [PLANE:%d:%s] must be compatible with [CRTC:%d:%s]\n",670 "Bogus cursor plane possible_crtcs: [PLANE:%d:%s] must be compatible with [CRTC:%d:%s]\n",
654 crtc->cursor->base.id, crtc->cursor->name,671 crtc->cursor->base.id, crtc->cursor->name,
655 crtc->base.id, crtc->name);672 crtc->base.id, crtc->name);
673 WARN(cursor_with_crtc & drm_plane_mask(crtc->cursor),
674 "Cursor plane [PLANE:%d:%s] used for multiple CRTCs",
675 crtc->cursor->base.id, crtc->cursor->name);
676 cursor_with_crtc |= drm_plane_mask(crtc->cursor);
656 }677 }
657 }678 }
679
680 drm_for_each_plane(plane, dev) {
681 if (plane->type == DRM_PLANE_TYPE_PRIMARY)
682 num_primary++;
683 }
684
685 WARN(num_primary != dev->mode_config.num_crtc,
686 "Must have as many primary planes as there are CRTCs, but have %u primary planes and %u CRTCs",
687 num_primary, dev->mode_config.num_crtc);
658}688}
drivers/gpu/drm/drm_plane.c+18−0
@@ -55,6 +55,12 @@ · 54 unmodified lines
55 * enum drm_plane_type). A plane can be compatible with multiple CRTCs, see55 * enum drm_plane_type). A plane can be compatible with multiple CRTCs, see
56 * &drm_plane.possible_crtcs.56 * &drm_plane.possible_crtcs.
57 *57 *
58 * Each CRTC must have a unique primary plane userspace can attach to enable
59 * the CRTC. In other words, userspace must be able to attach a different
60 * primary plane to each CRTC at the same time. Primary planes can still be
61 * compatible with multiple CRTCs. There must be exactly as many primary planes
62 * as there are CRTCs.
63 *
58 * Legacy uAPI doesn't expose the primary and cursor planes directly. DRM core64 * Legacy uAPI doesn't expose the primary and cursor planes directly. DRM core
59 * relies on the driver to set the primary and optionally the cursor plane used65 * relies on the driver to set the primary and optionally the cursor plane used
60 * for legacy IOCTLs. This is done by calling drm_crtc_init_with_planes(). All66 * for legacy IOCTLs. This is done by calling drm_crtc_init_with_planes(). All
@@ -62,6 +68,18 @@ · 1 unmodified line
62 * userspace too much.68 * userspace too much.
63 */69 */
64 70
71/**
72 * DOC: standard plane properties
73 *
74 * DRM planes have a few standardized properties:
75 *
76 * IN_FORMATS:
77 * Blob property which contains the set of buffer format and modifier
78 * pairs supported by this plane. The blob is a struct
79 * drm_format_modifier_blob. Without this property the plane doesn't
80 * support buffers with modifiers. Userspace cannot change this property.
81 */
82
65static unsigned int drm_num_planes(struct drm_device *dev)83static unsigned int drm_num_planes(struct drm_device *dev)
66{84{
67 unsigned int num = 0;85 unsigned int num = 0;
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c+4−8
@@ -329,16 +329,16 @@ static int hibmc_pci_probe(struct pci_dev *pdev, · 328 unmodified lines
329 dev->pdev = pdev;329 dev->pdev = pdev;
330 pci_set_drvdata(pdev, dev);330 pci_set_drvdata(pdev, dev);
331 331
332 ret = pci_enable_device(pdev);332 ret = pcim_enable_device(pdev);
333 if (ret) {333 if (ret) {
334 drm_err(dev, "failed to enable pci device: %d\n", ret);334 drm_err(dev, "failed to enable pci device: %d\n", ret);
335 goto err_free;335 goto err_return;
336 }336 }
337 337
338 ret = hibmc_load(dev);338 ret = hibmc_load(dev);
339 if (ret) {339 if (ret) {
340 drm_err(dev, "failed to load hibmc: %d\n", ret);340 drm_err(dev, "failed to load hibmc: %d\n", ret);
341 goto err_disable;341 goto err_return;
342 }342 }
343 343
344 ret = drm_dev_register(dev, 0);344 ret = drm_dev_register(dev, 0);
@@ -354,11 +354,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev, · 9 unmodified lines
354 354
355err_unload:355err_unload:
356 hibmc_unload(dev);356 hibmc_unload(dev);
357err_disable:357err_return:
358 pci_disable_device(pdev);
359err_free:
360 drm_dev_put(dev);
361
362 return ret;358 return ret;
363}359}
364 360
drivers/gpu/drm/panel/panel-samsung-s6e63m0.c+13−4
@@ -692,12 +692,12 @@ static const struct backlight_ops s6e63m0_backlight_ops = { · 691 unmodified lines
692 .update_status = s6e63m0_set_brightness,692 .update_status = s6e63m0_set_brightness,
693};693};
694 694
695static int s6e63m0_backlight_register(struct s6e63m0 *ctx)695static int s6e63m0_backlight_register(struct s6e63m0 *ctx, u32 max_brightness)
696{696{
697 struct backlight_properties props = {697 struct backlight_properties props = {
698 .type = BACKLIGHT_RAW,698 .type = BACKLIGHT_RAW,
699 .brightness = MAX_BRIGHTNESS,699 .brightness = max_brightness,
700 .max_brightness = MAX_BRIGHTNESS700 .max_brightness = max_brightness,
701 };701 };
702 struct device *dev = ctx->dev;702 struct device *dev = ctx->dev;
703 int ret = 0;703 int ret = 0;
@@ -719,6 +719,7 @@ int s6e63m0_probe(struct device *dev, · 15 unmodified lines
719 bool dsi_mode)719 bool dsi_mode)
720{720{
721 struct s6e63m0 *ctx;721 struct s6e63m0 *ctx;
722 u32 max_brightness;
722 int ret;723 int ret;
723 724
724 ctx = devm_kzalloc(dev, sizeof(struct s6e63m0), GFP_KERNEL);725 ctx = devm_kzalloc(dev, sizeof(struct s6e63m0), GFP_KERNEL);
@@ -734,6 +735,14 @@ int s6e63m0_probe(struct device *dev, · 9 unmodified lines
734 ctx->enabled = false;735 ctx->enabled = false;
735 ctx->prepared = false;736 ctx->prepared = false;
736 737
738 ret = device_property_read_u32(dev, "max-brightness", &max_brightness);
739 if (ret)
740 max_brightness = MAX_BRIGHTNESS;
741 if (max_brightness > MAX_BRIGHTNESS) {
742 dev_err(dev, "illegal max brightness specified\n");
743 max_brightness = MAX_BRIGHTNESS;
744 }
745
737 ctx->supplies[0].supply = "vdd3";746 ctx->supplies[0].supply = "vdd3";
738 ctx->supplies[1].supply = "vci";747 ctx->supplies[1].supply = "vci";
739 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),748 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
@@ -753,7 +762,7 @@ int s6e63m0_probe(struct device *dev, · 13 unmodified lines
753 dsi_mode ? DRM_MODE_CONNECTOR_DSI :762 dsi_mode ? DRM_MODE_CONNECTOR_DSI :
754 DRM_MODE_CONNECTOR_DPI);763 DRM_MODE_CONNECTOR_DPI);
755 764
756 ret = s6e63m0_backlight_register(ctx);765 ret = s6e63m0_backlight_register(ctx, max_brightness);
757 if (ret < 0)766 if (ret < 0)
758 return ret;767 return ret;
759 768
drivers/gpu/drm/qxl/qxl_dev.h+8−8
@@ -271,7 +271,7 @@ struct qxl_mode { · 270 unmodified lines
271/* qxl-1 compat: fixed */271/* qxl-1 compat: fixed */
272struct qxl_modes {272struct qxl_modes {
273 uint32_t n_modes;273 uint32_t n_modes;
274 struct qxl_mode modes[0];274 struct qxl_mode modes[];
275};275};
276 276
277/* qxl-1 compat: append only */277/* qxl-1 compat: append only */
@@ -382,12 +382,12 @@ struct qxl_data_chunk { · 104 unmodified lines
382 uint32_t data_size;382 uint32_t data_size;
383 QXLPHYSICAL prev_chunk;383 QXLPHYSICAL prev_chunk;
384 QXLPHYSICAL next_chunk;384 QXLPHYSICAL next_chunk;
385 uint8_t data[0];385 uint8_t data[];
386};386};
387 387
388struct qxl_message {388struct qxl_message {
389 union qxl_release_info release_info;389 union qxl_release_info release_info;
390 uint8_t data[0];390 uint8_t data[];
391};391};
392 392
393struct qxl_compat_update_cmd {393struct qxl_compat_update_cmd {
@@ -469,7 +469,7 @@ struct qxl_raster_glyph { · 75 unmodified lines
469 struct qxl_point glyph_origin;469 struct qxl_point glyph_origin;
470 uint16_t width;470 uint16_t width;
471 uint16_t height;471 uint16_t height;
472 uint8_t data[0];472 uint8_t data[];
473};473};
474 474
475struct qxl_string {475struct qxl_string {
@@ -768,7 +768,7 @@ enum { · 292 unmodified lines
768struct qxl_path_seg {768struct qxl_path_seg {
769 uint32_t flags;769 uint32_t flags;
770 uint32_t count;770 uint32_t count;
771 struct qxl_point_fix points[0];771 struct qxl_point_fix points[];
772};772};
773 773
774struct qxl_path {774struct qxl_path {
@@ -819,7 +819,7 @@ struct qxl_image_descriptor { · 44 unmodified lines
819struct qxl_palette {819struct qxl_palette {
820 uint64_t unique;820 uint64_t unique;
821 uint16_t num_ents;821 uint16_t num_ents;
822 uint32_t ents[0];822 uint32_t ents[];
823};823};
824 824
825struct qxl_bitmap {825struct qxl_bitmap {
@@ -838,7 +838,7 @@ struct qxl_surface_id { · 12 unmodified lines
838 838
839struct qxl_encoder_data {839struct qxl_encoder_data {
840 uint32_t data_size;840 uint32_t data_size;
841 uint8_t data[0];841 uint8_t data[];
842};842};
843 843
844struct qxl_image {844struct qxl_image {
@@ -868,7 +868,7 @@ struct qxl_monitors_config { · 23 unmodified lines
868 uint16_t count;868 uint16_t count;
869 uint16_t max_allowed; /* If it is 0 no fixed limit is given by the869 uint16_t max_allowed; /* If it is 0 no fixed limit is given by the
870 driver */870 driver */
871 struct qxl_head heads[0];871 struct qxl_head heads[];
872};872};
873 873
874#pragma pack(pop)874#pragma pack(pop)
drivers/gpu/drm/tve200/tve200_display.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
11 */11 */
12 12
13#include <linux/clk.h>13#include <linux/clk.h>
14#include <linux/version.h>
15#include <linux/dma-buf.h>14#include <linux/dma-buf.h>
16#include <linux/of_graph.h>15#include <linux/of_graph.h>
17#include <linux/delay.h>16#include <linux/delay.h>
drivers/gpu/drm/tve200/tve200_drv.c+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
35#include <linux/platform_device.h>35#include <linux/platform_device.h>
36#include <linux/shmem_fs.h>36#include <linux/shmem_fs.h>
37#include <linux/slab.h>37#include <linux/slab.h>
38#include <linux/version.h>
39 38
40#include <drm/drm_atomic_helper.h>39#include <drm/drm_atomic_helper.h>
41#include <drm/drm_bridge.h>40#include <drm/drm_bridge.h>
drivers/gpu/drm/virtio/Kconfig+2−1
@@ -1,7 +1,8 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2config DRM_VIRTIO_GPU2config DRM_VIRTIO_GPU
3 tristate "Virtio GPU driver"3 tristate "Virtio GPU driver"
4 depends on DRM && VIRTIO && VIRTIO_MENU && MMU4 depends on DRM && VIRTIO_MENU && MMU
5 select VIRTIO
5 select DRM_KMS_HELPER6 select DRM_KMS_HELPER
6 select DRM_GEM_SHMEM_HELPER7 select DRM_GEM_SHMEM_HELPER
7 select VIRTIO_DMA_SHARED_BUFFER8 select VIRTIO_DMA_SHARED_BUFFER
drivers/gpu/drm/virtio/virtgpu_vram.c+2−0
@@ -134,6 +134,8 @@ int virtio_gpu_vram_create(struct virtio_gpu_device *vgdev, · 133 unmodified lines
134 134
135 obj = &vram->base.base.base;135 obj = &vram->base.base.base;
136 obj->funcs = &virtio_gpu_vram_funcs;136 obj->funcs = &virtio_gpu_vram_funcs;
137
138 params->size = PAGE_ALIGN(params->size);
137 drm_gem_private_object_init(vgdev->ddev, obj, params->size);139 drm_gem_private_object_init(vgdev->ddev, obj, params->size);
138 140
139 /* Create fake offset */141 /* Create fake offset */
include/uapi/drm/drm.h+49−48
@@ -1,11 +1,10 @@
1/**1/*
2 * \file drm.h
3 * Header for the Direct Rendering Manager2 * Header for the Direct Rendering Manager
4 *3 *
5 * \author Rickard E. (Rik) Faith <faith@valinux.com>4 * Author: Rickard E. (Rik) Faith <faith@valinux.com>
6 *5 *
7 * \par Acknowledgments:6 * Acknowledgments:
8 * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.7 * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
9 */8 */
10 9
11/*10/*
@@ -85,7 +84,7 @@ typedef unsigned int drm_context_t; · 73 unmodified lines
85typedef unsigned int drm_drawable_t;84typedef unsigned int drm_drawable_t;
86typedef unsigned int drm_magic_t;85typedef unsigned int drm_magic_t;
87 86
88/**87/*
89 * Cliprect.88 * Cliprect.
90 *89 *
91 * \warning: If you change this structure, make sure you change90 * \warning: If you change this structure, make sure you change
@@ -101,7 +100,7 @@ struct drm_clip_rect { · 9 unmodified lines
101 unsigned short y2;100 unsigned short y2;
102};101};
103 102
104/**103/*
105 * Drawable information.104 * Drawable information.
106 */105 */
107struct drm_drawable_info {106struct drm_drawable_info {
@@ -109,7 +108,7 @@ struct drm_drawable_info { · 1 unmodified line
109 struct drm_clip_rect *rects;108 struct drm_clip_rect *rects;
110};109};
111 110
112/**111/*
113 * Texture region,112 * Texture region,
114 */113 */
115struct drm_tex_region {114struct drm_tex_region {
@@ -120,7 +119,7 @@ struct drm_tex_region { · 4 unmodified lines
120 unsigned int age;119 unsigned int age;
121};120};
122 121
123/**122/*
124 * Hardware lock.123 * Hardware lock.
125 *124 *
126 * The lock structure is a simple cache-line aligned integer. To avoid125 * The lock structure is a simple cache-line aligned integer. To avoid
@@ -132,7 +131,7 @@ struct drm_hw_lock { · 5 unmodified lines
132 char padding[60]; /**< Pad to cache line */131 char padding[60]; /**< Pad to cache line */
133};132};
134 133
135/**134/*
136 * DRM_IOCTL_VERSION ioctl argument type.135 * DRM_IOCTL_VERSION ioctl argument type.
137 *136 *
138 * \sa drmGetVersion().137 * \sa drmGetVersion().
@@ -149,7 +148,7 @@ struct drm_version { · 10 unmodified lines
149 char __user *desc; /**< User-space buffer to hold desc */148 char __user *desc; /**< User-space buffer to hold desc */
150};149};
151 150
152/**151/*
153 * DRM_IOCTL_GET_UNIQUE ioctl argument type.152 * DRM_IOCTL_GET_UNIQUE ioctl argument type.
154 *153 *
155 * \sa drmGetBusid() and drmSetBusId().154 * \sa drmGetBusid() and drmSetBusId().
@@ -168,7 +167,7 @@ struct drm_block { · 12 unmodified lines
168 int unused;167 int unused;
169};168};
170 169
171/**170/*
172 * DRM_IOCTL_CONTROL ioctl argument type.171 * DRM_IOCTL_CONTROL ioctl argument type.
173 *172 *
174 * \sa drmCtlInstHandler() and drmCtlUninstHandler().173 * \sa drmCtlInstHandler() and drmCtlUninstHandler().
@@ -183,7 +182,7 @@ struct drm_control { · 8 unmodified lines
183 int irq;182 int irq;
184};183};
185 184
186/**185/*
187 * Type of memory to map.186 * Type of memory to map.
188 */187 */
189enum drm_map_type {188enum drm_map_type {
@@ -195,7 +194,7 @@ enum drm_map_type { · 5 unmodified lines
195 _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */194 _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
196};195};
197 196
198/**197/*
199 * Memory mapping flags.198 * Memory mapping flags.
200 */199 */
201enum drm_map_flags {200enum drm_map_flags {
@@ -214,7 +213,7 @@ struct drm_ctx_priv_map { · 12 unmodified lines
214 void *handle; /**< Handle of map */213 void *handle; /**< Handle of map */
215};214};
216 215
217/**216/*
218 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls217 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
219 * argument type.218 * argument type.
220 *219 *
@@ -231,7 +230,7 @@ struct drm_map { · 10 unmodified lines
231 /* Private data */230 /* Private data */
232};231};
233 232
234/**233/*
235 * DRM_IOCTL_GET_CLIENT ioctl argument type.234 * DRM_IOCTL_GET_CLIENT ioctl argument type.
236 */235 */
237struct drm_client {236struct drm_client {
@@ -263,7 +262,7 @@ enum drm_stat_type { · 25 unmodified lines
263 /* Add to the *END* of the list */262 /* Add to the *END* of the list */
264};263};
265 264
266/**265/*
267 * DRM_IOCTL_GET_STATS ioctl argument type.266 * DRM_IOCTL_GET_STATS ioctl argument type.
268 */267 */
269struct drm_stats {268struct drm_stats {
@@ -274,7 +273,7 @@ struct drm_stats { · 4 unmodified lines
274 } data[15];273 } data[15];
275};274};
276 275
277/**276/*
278 * Hardware locking flags.277 * Hardware locking flags.
279 */278 */
280enum drm_lock_flags {279enum drm_lock_flags {
@@ -289,7 +288,7 @@ enum drm_lock_flags { · 8 unmodified lines
289 _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */288 _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
290};289};
291 290
292/**291/*
293 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.292 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
294 *293 *
295 * \sa drmGetLock() and drmUnlock().294 * \sa drmGetLock() and drmUnlock().
@@ -299,7 +298,7 @@ struct drm_lock { · 3 unmodified lines
299 enum drm_lock_flags flags;298 enum drm_lock_flags flags;
300};299};
301 300
302/**301/*
303 * DMA flags302 * DMA flags
304 *303 *
305 * \warning304 * \warning
@@ -328,7 +327,7 @@ enum drm_dma_flags { · 22 unmodified lines
328 _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */327 _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
329};328};
330 329
331/**330/*
332 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.331 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
333 *332 *
334 * \sa drmAddBufs().333 * \sa drmAddBufs().
@@ -351,7 +350,7 @@ struct drm_buf_desc { · 16 unmodified lines
351 */350 */
352};351};
353 352
354/**353/*
355 * DRM_IOCTL_INFO_BUFS ioctl argument type.354 * DRM_IOCTL_INFO_BUFS ioctl argument type.
356 */355 */
357struct drm_buf_info {356struct drm_buf_info {
@@ -359,7 +358,7 @@ struct drm_buf_info { · 1 unmodified line
359 struct drm_buf_desc __user *list;358 struct drm_buf_desc __user *list;
360};359};
361 360
362/**361/*
363 * DRM_IOCTL_FREE_BUFS ioctl argument type.362 * DRM_IOCTL_FREE_BUFS ioctl argument type.
364 */363 */
365struct drm_buf_free {364struct drm_buf_free {
@@ -367,7 +366,7 @@ struct drm_buf_free { · 1 unmodified line
367 int __user *list;366 int __user *list;
368};367};
369 368
370/**369/*
371 * Buffer information370 * Buffer information
372 *371 *
373 * \sa drm_buf_map.372 * \sa drm_buf_map.
@@ -379,7 +378,7 @@ struct drm_buf_pub { · 5 unmodified lines
379 void __user *address; /**< Address of buffer */378 void __user *address; /**< Address of buffer */
380};379};
381 380
382/**381/*
383 * DRM_IOCTL_MAP_BUFS ioctl argument type.382 * DRM_IOCTL_MAP_BUFS ioctl argument type.
384 */383 */
385struct drm_buf_map {384struct drm_buf_map {
@@ -392,7 +391,7 @@ struct drm_buf_map { · 6 unmodified lines
392 struct drm_buf_pub __user *list; /**< Buffer information */391 struct drm_buf_pub __user *list; /**< Buffer information */
393};392};
394 393
395/**394/*
396 * DRM_IOCTL_DMA ioctl argument type.395 * DRM_IOCTL_DMA ioctl argument type.
397 *396 *
398 * Indices here refer to the offset into the buffer list in drm_buf_get.397 * Indices here refer to the offset into the buffer list in drm_buf_get.
@@ -417,7 +416,7 @@ enum drm_ctx_flags { · 18 unmodified lines
417 _DRM_CONTEXT_2DONLY = 0x02416 _DRM_CONTEXT_2DONLY = 0x02
418};417};
419 418
420/**419/*
421 * DRM_IOCTL_ADD_CTX ioctl argument type.420 * DRM_IOCTL_ADD_CTX ioctl argument type.
422 *421 *
423 * \sa drmCreateContext() and drmDestroyContext().422 * \sa drmCreateContext() and drmDestroyContext().
@@ -427,7 +426,7 @@ struct drm_ctx { · 3 unmodified lines
427 enum drm_ctx_flags flags;426 enum drm_ctx_flags flags;
428};427};
429 428
430/**429/*
431 * DRM_IOCTL_RES_CTX ioctl argument type.430 * DRM_IOCTL_RES_CTX ioctl argument type.
432 */431 */
433struct drm_ctx_res {432struct drm_ctx_res {
@@ -435,14 +434,14 @@ struct drm_ctx_res { · 1 unmodified line
435 struct drm_ctx __user *contexts;434 struct drm_ctx __user *contexts;
436};435};
437 436
438/**437/*
439 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.438 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
440 */439 */
441struct drm_draw {440struct drm_draw {
442 drm_drawable_t handle;441 drm_drawable_t handle;
443};442};
444 443
445/**444/*
446 * DRM_IOCTL_UPDATE_DRAW ioctl argument type.445 * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
447 */446 */
448typedef enum {447typedef enum {
@@ -456,14 +455,14 @@ struct drm_update_draw { · 7 unmodified lines
456 unsigned long long data;455 unsigned long long data;
457};456};
458 457
459/**458/*
460 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.459 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
461 */460 */
462struct drm_auth {461struct drm_auth {
463 drm_magic_t magic;462 drm_magic_t magic;
464};463};
465 464
466/**465/*
467 * DRM_IOCTL_IRQ_BUSID ioctl argument type.466 * DRM_IOCTL_IRQ_BUSID ioctl argument type.
468 *467 *
469 * \sa drmGetInterruptFromBusID().468 * \sa drmGetInterruptFromBusID().
@@ -505,7 +504,7 @@ struct drm_wait_vblank_reply { · 35 unmodified lines
505 long tval_usec;504 long tval_usec;
506};505};
507 506
508/**507/*
509 * DRM_IOCTL_WAIT_VBLANK ioctl argument type.508 * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
510 *509 *
511 * \sa drmWaitVBlank().510 * \sa drmWaitVBlank().
@@ -518,7 +517,7 @@ union drm_wait_vblank { · 6 unmodified lines
518#define _DRM_PRE_MODESET 1517#define _DRM_PRE_MODESET 1
519#define _DRM_POST_MODESET 2518#define _DRM_POST_MODESET 2
520 519
521/**520/*
522 * DRM_IOCTL_MODESET_CTL ioctl argument type521 * DRM_IOCTL_MODESET_CTL ioctl argument type
523 *522 *
524 * \sa drmModesetCtl().523 * \sa drmModesetCtl().
@@ -528,7 +527,7 @@ struct drm_modeset_ctl { · 3 unmodified lines
528 __u32 cmd;527 __u32 cmd;
529};528};
530 529
531/**530/*
532 * DRM_IOCTL_AGP_ENABLE ioctl argument type.531 * DRM_IOCTL_AGP_ENABLE ioctl argument type.
533 *532 *
534 * \sa drmAgpEnable().533 * \sa drmAgpEnable().
@@ -537,7 +536,7 @@ struct drm_agp_mode { · 2 unmodified lines
537 unsigned long mode; /**< AGP mode */536 unsigned long mode; /**< AGP mode */
538};537};
539 538
540/**539/*
541 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.540 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
542 *541 *
543 * \sa drmAgpAlloc() and drmAgpFree().542 * \sa drmAgpAlloc() and drmAgpFree().
@@ -549,7 +548,7 @@ struct drm_agp_buffer { · 5 unmodified lines
549 unsigned long physical; /**< Physical used by i810 */548 unsigned long physical; /**< Physical used by i810 */
550};549};
551 550
552/**551/*
553 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.552 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
554 *553 *
555 * \sa drmAgpBind() and drmAgpUnbind().554 * \sa drmAgpBind() and drmAgpUnbind().
@@ -559,7 +558,7 @@ struct drm_agp_binding { · 3 unmodified lines
559 unsigned long offset; /**< In bytes -- will round to page boundary */558 unsigned long offset; /**< In bytes -- will round to page boundary */
560};559};
561 560
562/**561/*
563 * DRM_IOCTL_AGP_INFO ioctl argument type.562 * DRM_IOCTL_AGP_INFO ioctl argument type.
564 *563 *
565 * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),564 * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
@@ -580,7 +579,7 @@ struct drm_agp_info { · 14 unmodified lines
580 unsigned short id_device;579 unsigned short id_device;
581};580};
582 581
583/**582/*
584 * DRM_IOCTL_SG_ALLOC ioctl argument type.583 * DRM_IOCTL_SG_ALLOC ioctl argument type.
585 */584 */
586struct drm_scatter_gather {585struct drm_scatter_gather {
@@ -588,7 +587,7 @@ struct drm_scatter_gather { · 1 unmodified line
588 unsigned long handle; /**< Used for mapping / unmapping */587 unsigned long handle; /**< Used for mapping / unmapping */
589};588};
590 589
591/**590/*
592 * DRM_IOCTL_SET_VERSION ioctl argument type.591 * DRM_IOCTL_SET_VERSION ioctl argument type.
593 */592 */
594struct drm_set_version {593struct drm_set_version {
@@ -598,14 +597,14 @@ struct drm_set_version { · 3 unmodified lines
598 int drm_dd_minor;597 int drm_dd_minor;
599};598};
600 599
601/** DRM_IOCTL_GEM_CLOSE ioctl argument type */600/* DRM_IOCTL_GEM_CLOSE ioctl argument type */
602struct drm_gem_close {601struct drm_gem_close {
603 /** Handle of the object to be closed. */602 /** Handle of the object to be closed. */
604 __u32 handle;603 __u32 handle;
605 __u32 pad;604 __u32 pad;
606};605};
607 606
608/** DRM_IOCTL_GEM_FLINK ioctl argument type */607/* DRM_IOCTL_GEM_FLINK ioctl argument type */
609struct drm_gem_flink {608struct drm_gem_flink {
610 /** Handle for the object being named */609 /** Handle for the object being named */
611 __u32 handle;610 __u32 handle;
@@ -614,7 +613,7 @@ struct drm_gem_flink { · 2 unmodified lines
614 __u32 name;613 __u32 name;
615};614};
616 615
617/** DRM_IOCTL_GEM_OPEN ioctl argument type */616/* DRM_IOCTL_GEM_OPEN ioctl argument type */
618struct drm_gem_open {617struct drm_gem_open {
619 /** Name of object being opened */618 /** Name of object being opened */
620 __u32 name;619 __u32 name;
@@ -652,7 +651,7 @@ struct drm_gem_open { · 31 unmodified lines
652#define DRM_CAP_SYNCOBJ 0x13651#define DRM_CAP_SYNCOBJ 0x13
653#define DRM_CAP_SYNCOBJ_TIMELINE 0x14652#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
654 653
655/** DRM_IOCTL_GET_CAP ioctl argument type */654/* DRM_IOCTL_GET_CAP ioctl argument type */
656struct drm_get_cap {655struct drm_get_cap {
657 __u64 capability;656 __u64 capability;
658 __u64 value;657 __u64 value;
@@ -678,7 +677,9 @@ struct drm_get_cap { · 19 unmodified lines
678/**677/**
679 * DRM_CLIENT_CAP_ATOMIC678 * DRM_CLIENT_CAP_ATOMIC
680 *679 *
681 * If set to 1, the DRM core will expose atomic properties to userspace680 * If set to 1, the DRM core will expose atomic properties to userspace. This
681 * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and
682 * &DRM_CLIENT_CAP_ASPECT_RATIO.
682 */683 */
683#define DRM_CLIENT_CAP_ATOMIC 3684#define DRM_CLIENT_CAP_ATOMIC 3
684 685
@@ -698,7 +699,7 @@ struct drm_get_cap { · 13 unmodified lines
698 */699 */
699#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5700#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
700 701
701/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */702/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
702struct drm_set_client_cap {703struct drm_set_client_cap {
703 __u64 capability;704 __u64 capability;
704 __u64 value;705 __u64 value;
@@ -950,7 +951,7 @@ extern "C" { · 245 unmodified lines
950 951
951#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)952#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
952 953
953/**954/*
954 * Device specific ioctls should only be in their respective headers955 * Device specific ioctls should only be in their respective headers
955 * The device specific ioctl range is from 0x40 to 0x9f.956 * The device specific ioctl range is from 0x40 to 0x9f.
956 * Generic IOCTLS restart at 0xA0.957 * Generic IOCTLS restart at 0xA0.
@@ -961,7 +962,7 @@ extern "C" { · 4 unmodified lines
961#define DRM_COMMAND_BASE 0x40962#define DRM_COMMAND_BASE 0x40
962#define DRM_COMMAND_END 0xA0963#define DRM_COMMAND_END 0xA0
963 964
964/**965/*
965 * Header for events written back to userspace on the drm fd. The966 * Header for events written back to userspace on the drm fd. The
966 * type defines the type of event, the length specifies the total967 * type defines the type of event, the length specifies the total
967 * length of the event (including the header), and user_data is968 * length of the event (including the header), and user_data is