drm-misc-next for v5.3, try #2:
Cross-subsystem Changes: - Fix device tree bindings in drm-misc-next after a botched merge. Core Changes: - Docbook fix for drm_hdmi_infoframe_set_hdr_metadata. Driver Changes: - mediatek: Fix compiler warning after merging the HDR series. - vc4: Rework binner bo handling. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAlznr6oACgkQ/lWMcqZw E8Mjbw//Rf2KeOyNYOpaUjzUIXjdGNKCSLG+MYbBzJLbdj6hywAi8tS6aS89d1qW CCBzPTUWFktuUVuHqIpZwNTPLndXzPvyC9v1BafKkF6Tkod1usBMaXD1266giAbC pKkJrejqeeQtYNfAQIGDzD/ndxXptw+mwK7DgRvMIQSGYuMCm+p5cG0RBtLV7Ijv fXIromzIQ+YUuOIyGRgmXW9zDUaieztovrLtIzpYALzTPZb5dqrJiuv3SKIiB4EK mlTprRqHbHpYLHHNhFrO2blfi/50+SThEHvUBP8rkMf3nu3nhQSMQrPtxJSfL71e 1nAWvIYkLY7lKid7ugFvsZL+1L0zgG6XnsqHs5/x5x/LGDK1jVCEGG/DdsXVjGFj XH8zdLBi3PrmwbKy/HHCh6QD5Iwtg4qm8Dfjjfil4XNQDI8pK8q8TaVMZETn3YRC 63JtZq8nBnrWgT57N/28apkymsHdz2QK99Yyc+GflFhhHsoNy6LhP+OqzW11rIas ANxZrF5CR8rudtoo2QeMkHcvkbIvDTQOPPuW6LXdXuqkhi91NFmgkxCCecFfpO74 QvTiBQHrlb8zqTMZJ/j6uSBTFNOXI2NxXTKUBMJ2O3FcyVqvpL+HutVPcBuIw3mM FNvCI1M9rVH1qFOZ+t1y9ceebuHPy6xYwuak6fKDwzOwJOmOMFI= =2K7c -----END PGP SIGNATURE----- Merge tag 'drm-misc-next-2019-05-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.3, try #2: UAPI Changes: - Add HDR source metadata property. - Make drm.h compile on GNU/kFreeBSD by including stdint.h - Clarify how the userspace reviewer has to review new kernel UAPI. - Clarify that for using new UAPI, merging to drm-next or drm-misc-next should be enough. Cross-subsystem Changes: - video/hdmi: Add unpack function for DRM infoframes. - Device tree bindings: * Updating a property for Mali Midgard GPUs * Updating a property for STM32 DSI panel * Adding support for FriendlyELEC HD702E 800x1280 panel * Adding support for Evervision VGG804821 800x480 5.0" WVGA TFT panel * Adding support for the EDT ET035012DM6 3.5" 320x240 QVGA 24-bit RGB TFT. * Adding support for Three Five displays TFC S9700RTWV43TR-01B 800x480 panel with resistive touch found on TI's AM335X-EVM. * Adding support for EDT ETM0430G0DH6 480x272 panel. - Add OSD101T2587-53TS driver with DT bindings. - Add Samsung S6E63M0 panel driver with DT bindings. - Add VXT VL050-8048NT-C01 800x480 panel with DT bindings. - Dma-buf: - Make mmap callback actually optional. - Documentation updates. - Fix debugfs refcount inbalance. - Remove unused sync_dump function. - Fix device tree bindings in drm-misc-next after a botched merge. Core Changes: - Add support for HDR infoframes and related EDID parsing. - Remove prime sg_table caching, now done inside dma-buf. - Add shiny new drm_gem_vram helpers for simple VRAM drivers; with some fixes to the new API on top. - Small fix to job cleanup without timeout handler. - Documentation fixes to drm_fourcc. - Replace lookups of drm_format with struct drm_format_info; remove functions that become obsolete by this conversion. - Remove double include in bridge/panel.c and some drivers. - Remove drmP.h include from drm/edid and drm/dp. - Fix null pointer deref in drm_fb_helper_hotplug_event(). - Remove most members from drm_fb_helper_crtc, only mode_set is kept. - Remove race of fb helpers with userspace; only restore mode when userspace is not master. - Move legacy setup from drm_file.c to drm_legacy_misc.c - Rework scheduler job destruction. - drm/bus was removed, remove from TODO. - Add __drm_atomic_helper_crtc_reset() to subclass crtc_state, and convert some drivers to use it (conversion is not complete yet). - Bump vblank timeout wait to 100 ms for atomic. - Docbook fix for drm_hdmi_infoframe_set_hdr_metadata. Driver Changes: - sun4i: Use DRM_GEM_CMA_VMAP_DRIVER_OPS instead of definining manually. - v3d: Small cleanups, adding support for compute shaders, reservation/synchronization fixes and job management refactoring, fixes MMU and debugfs. - lima: Fix null pointer in irq handler on startup, set default timeout for scheduled jobs. - stm/ltdc: Assorted fixes and adding FB modifier support. - amdgpu: Avoid hw reset if guilty job was already signaled. - virtio: Add seqno to fences, add trace events, use correct flags for fence allocation. - Convert AST, bochs, mgag200, vboxvideo, hisilicon to the new drm_gem_vram API. - sun6i_mipi_dsi: Support DSI GENERIC_SHORT_WRITE_2 transfers. - bochs: Small fix to use PTR_RET_OR_ZERO and driver unload. - gma500: header fixes - cirrus: Remove unused files. - mediatek: Fix compiler warning after merging the HDR series. - vc4: Rework binner bo handling. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/052875a5-27ba-3832-60c2-193d950afdff@linux.intel.com
This commit is contained in:
commit
88cd7a2c1b
220 changed files with 5980 additions and 4630 deletions
|
|
@ -37,6 +37,8 @@ struct drm_private_state;
|
|||
struct drm_modeset_acquire_ctx;
|
||||
struct drm_device;
|
||||
|
||||
void __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc,
|
||||
struct drm_crtc_state *state);
|
||||
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
|
||||
void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
|
||||
struct drm_crtc_state *state);
|
||||
|
|
|
|||
|
|
@ -517,6 +517,10 @@ struct drm_connector_state {
|
|||
* Used by the atomic helpers to select the encoder, through the
|
||||
* &drm_connector_helper_funcs.atomic_best_encoder or
|
||||
* &drm_connector_helper_funcs.best_encoder callbacks.
|
||||
*
|
||||
* NOTE: Atomic drivers must fill this out (either themselves or through
|
||||
* helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
|
||||
* not return correct data to userspace.
|
||||
*/
|
||||
struct drm_encoder *best_encoder;
|
||||
|
||||
|
|
@ -599,6 +603,12 @@ struct drm_connector_state {
|
|||
* and the connector bpc limitations obtained from edid.
|
||||
*/
|
||||
u8 max_bpc;
|
||||
|
||||
/**
|
||||
* @hdr_output_metadata:
|
||||
* DRM blob property for HDR output metadata
|
||||
*/
|
||||
struct drm_property_blob *hdr_output_metadata;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1239,6 +1249,10 @@ struct drm_connector {
|
|||
* &drm_mode_config.connector_free_work.
|
||||
*/
|
||||
struct llist_node free_node;
|
||||
|
||||
/* HDR metdata */
|
||||
struct hdr_output_metadata hdr_output_metadata;
|
||||
struct hdr_sink_metadata hdr_sink_metadata;
|
||||
};
|
||||
|
||||
#define obj_to_connector(x) container_of(x, struct drm_connector, base)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ struct drm_vblank_crtc;
|
|||
struct drm_sg_mem;
|
||||
struct drm_local_map;
|
||||
struct drm_vma_offset_manager;
|
||||
struct drm_vram_mm;
|
||||
struct drm_fb_helper;
|
||||
|
||||
struct inode;
|
||||
|
|
@ -286,6 +287,9 @@ struct drm_device {
|
|||
/** @vma_offset_manager: GEM information */
|
||||
struct drm_vma_offset_manager *vma_offset_manager;
|
||||
|
||||
/** @vram_mm: VRAM MM memory manager */
|
||||
struct drm_vram_mm *vram_mm;
|
||||
|
||||
/**
|
||||
* @switch_power_state:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/hdmi.h>
|
||||
#include <drm/drm_mode.h>
|
||||
|
||||
struct drm_device;
|
||||
struct i2c_adapter;
|
||||
|
|
@ -370,6 +371,10 @@ drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
|
|||
const struct drm_display_mode *mode,
|
||||
enum hdmi_quantization_range rgb_quant_range);
|
||||
|
||||
int
|
||||
drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
|
||||
const struct drm_connector_state *conn_state);
|
||||
|
||||
/**
|
||||
* drm_eld_mnl - Get ELD monitor name length in bytes.
|
||||
* @eld: pointer to an eld memory structure with mnl set
|
||||
|
|
|
|||
|
|
@ -49,9 +49,6 @@ struct drm_fb_offset {
|
|||
|
||||
struct drm_fb_helper_crtc {
|
||||
struct drm_mode_set mode_set;
|
||||
struct drm_display_mode *desired_mode;
|
||||
int x, y;
|
||||
int rotation;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -151,13 +148,6 @@ struct drm_fb_helper {
|
|||
struct drm_fb_helper_crtc *crtc_info;
|
||||
int connector_count;
|
||||
int connector_info_alloc_count;
|
||||
/**
|
||||
* @sw_rotations:
|
||||
* Bitmask of all rotations requested for panel-orientation which
|
||||
* could not be handled in hardware. If only one bit is set
|
||||
* fbdev->fbcon_rotate_hint gets set to the requested rotation.
|
||||
*/
|
||||
int sw_rotations;
|
||||
/**
|
||||
* @connector_info:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -260,6 +260,50 @@ drm_format_info_is_yuv_sampling_444(const struct drm_format_info *info)
|
|||
return info->is_yuv && info->hsub == 1 && info->vsub == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_format_info_plane_width - width of the plane given the first plane
|
||||
* @info: pixel format info
|
||||
* @width: width of the first plane
|
||||
* @plane: plane index
|
||||
*
|
||||
* Returns:
|
||||
* The width of @plane, given that the width of the first plane is @width.
|
||||
*/
|
||||
static inline
|
||||
int drm_format_info_plane_width(const struct drm_format_info *info, int width,
|
||||
int plane)
|
||||
{
|
||||
if (!info || plane >= info->num_planes)
|
||||
return 0;
|
||||
|
||||
if (plane == 0)
|
||||
return width;
|
||||
|
||||
return width / info->hsub;
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_format_info_plane_height - height of the plane given the first plane
|
||||
* @info: pixel format info
|
||||
* @height: height of the first plane
|
||||
* @plane: plane index
|
||||
*
|
||||
* Returns:
|
||||
* The height of @plane, given that the height of the first plane is @height.
|
||||
*/
|
||||
static inline
|
||||
int drm_format_info_plane_height(const struct drm_format_info *info, int height,
|
||||
int plane)
|
||||
{
|
||||
if (!info || plane >= info->num_planes)
|
||||
return 0;
|
||||
|
||||
if (plane == 0)
|
||||
return height;
|
||||
|
||||
return height / info->vsub;
|
||||
}
|
||||
|
||||
const struct drm_format_info *__drm_format_info(u32 format);
|
||||
const struct drm_format_info *drm_format_info(u32 format);
|
||||
const struct drm_format_info *
|
||||
|
|
@ -268,12 +312,6 @@ drm_get_format_info(struct drm_device *dev,
|
|||
uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth);
|
||||
uint32_t drm_driver_legacy_fb_format(struct drm_device *dev,
|
||||
uint32_t bpp, uint32_t depth);
|
||||
int drm_format_num_planes(uint32_t format);
|
||||
int drm_format_plane_cpp(uint32_t format, int plane);
|
||||
int drm_format_horz_chroma_subsampling(uint32_t format);
|
||||
int drm_format_vert_chroma_subsampling(uint32_t format);
|
||||
int drm_format_plane_width(int width, uint32_t format, int plane);
|
||||
int drm_format_plane_height(int height, uint32_t format, int plane);
|
||||
unsigned int drm_format_info_block_width(const struct drm_format_info *info,
|
||||
int plane);
|
||||
unsigned int drm_format_info_block_height(const struct drm_format_info *info,
|
||||
|
|
|
|||
162
include/drm/drm_gem_vram_helper.h
Normal file
162
include/drm/drm_gem_vram_helper.h
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#ifndef DRM_GEM_VRAM_HELPER_H
|
||||
#define DRM_GEM_VRAM_HELPER_H
|
||||
|
||||
#include <drm/drm_gem.h>
|
||||
#include <drm/ttm/ttm_bo_api.h>
|
||||
#include <drm/ttm/ttm_placement.h>
|
||||
#include <linux/kernel.h> /* for container_of() */
|
||||
|
||||
struct drm_mode_create_dumb;
|
||||
struct drm_vram_mm_funcs;
|
||||
struct filp;
|
||||
struct vm_area_struct;
|
||||
|
||||
#define DRM_GEM_VRAM_PL_FLAG_VRAM TTM_PL_FLAG_VRAM
|
||||
#define DRM_GEM_VRAM_PL_FLAG_SYSTEM TTM_PL_FLAG_SYSTEM
|
||||
|
||||
/*
|
||||
* Buffer-object helpers
|
||||
*/
|
||||
|
||||
/**
|
||||
* struct drm_gem_vram_object - GEM object backed by VRAM
|
||||
* @gem: GEM object
|
||||
* @bo: TTM buffer object
|
||||
* @kmap: Mapping information for @bo
|
||||
* @placement: TTM placement information. Supported placements are \
|
||||
%TTM_PL_VRAM and %TTM_PL_SYSTEM
|
||||
* @placements: TTM placement information.
|
||||
* @pin_count: Pin counter
|
||||
*
|
||||
* The type struct drm_gem_vram_object represents a GEM object that is
|
||||
* backed by VRAM. It can be used for simple framebuffer devices with
|
||||
* dedicated memory. The buffer object can be evicted to system memory if
|
||||
* video memory becomes scarce.
|
||||
*/
|
||||
struct drm_gem_vram_object {
|
||||
struct drm_gem_object gem;
|
||||
struct ttm_buffer_object bo;
|
||||
struct ttm_bo_kmap_obj kmap;
|
||||
|
||||
/* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */
|
||||
struct ttm_placement placement;
|
||||
struct ttm_place placements[2];
|
||||
|
||||
int pin_count;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the container of type &struct drm_gem_vram_object
|
||||
* for field bo.
|
||||
* @bo: the VRAM buffer object
|
||||
* Returns: The containing GEM VRAM object
|
||||
*/
|
||||
static inline struct drm_gem_vram_object *drm_gem_vram_of_bo(
|
||||
struct ttm_buffer_object *bo)
|
||||
{
|
||||
return container_of(bo, struct drm_gem_vram_object, bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the container of type &struct drm_gem_vram_object
|
||||
* for field gem.
|
||||
* @gem: the GEM object
|
||||
* Returns: The containing GEM VRAM object
|
||||
*/
|
||||
static inline struct drm_gem_vram_object *drm_gem_vram_of_gem(
|
||||
struct drm_gem_object *gem)
|
||||
{
|
||||
return container_of(gem, struct drm_gem_vram_object, gem);
|
||||
}
|
||||
|
||||
struct drm_gem_vram_object *drm_gem_vram_create(struct drm_device *dev,
|
||||
struct ttm_bo_device *bdev,
|
||||
size_t size,
|
||||
unsigned long pg_align,
|
||||
bool interruptible);
|
||||
void drm_gem_vram_put(struct drm_gem_vram_object *gbo);
|
||||
int drm_gem_vram_lock(struct drm_gem_vram_object *gbo, bool no_wait);
|
||||
void drm_gem_vram_unlock(struct drm_gem_vram_object *gbo);
|
||||
u64 drm_gem_vram_mmap_offset(struct drm_gem_vram_object *gbo);
|
||||
s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo);
|
||||
int drm_gem_vram_pin(struct drm_gem_vram_object *gbo, unsigned long pl_flag);
|
||||
int drm_gem_vram_pin_locked(struct drm_gem_vram_object *gbo,
|
||||
unsigned long pl_flag);
|
||||
int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo);
|
||||
int drm_gem_vram_unpin_locked(struct drm_gem_vram_object *gbo);
|
||||
void *drm_gem_vram_kmap_at(struct drm_gem_vram_object *gbo, bool map,
|
||||
bool *is_iomem, struct ttm_bo_kmap_obj *kmap);
|
||||
void *drm_gem_vram_kmap(struct drm_gem_vram_object *gbo, bool map,
|
||||
bool *is_iomem);
|
||||
void drm_gem_vram_kunmap_at(struct drm_gem_vram_object *gbo,
|
||||
struct ttm_bo_kmap_obj *kmap);
|
||||
void drm_gem_vram_kunmap(struct drm_gem_vram_object *gbo);
|
||||
|
||||
int drm_gem_vram_fill_create_dumb(struct drm_file *file,
|
||||
struct drm_device *dev,
|
||||
struct ttm_bo_device *bdev,
|
||||
unsigned long pg_align,
|
||||
bool interruptible,
|
||||
struct drm_mode_create_dumb *args);
|
||||
|
||||
/*
|
||||
* Helpers for struct ttm_bo_driver
|
||||
*/
|
||||
|
||||
void drm_gem_vram_bo_driver_evict_flags(struct ttm_buffer_object *bo,
|
||||
struct ttm_placement *pl);
|
||||
|
||||
int drm_gem_vram_bo_driver_verify_access(struct ttm_buffer_object *bo,
|
||||
struct file *filp);
|
||||
|
||||
extern const struct drm_vram_mm_funcs drm_gem_vram_mm_funcs;
|
||||
|
||||
/*
|
||||
* Helpers for struct drm_driver
|
||||
*/
|
||||
|
||||
void drm_gem_vram_driver_gem_free_object_unlocked(struct drm_gem_object *gem);
|
||||
int drm_gem_vram_driver_dumb_create(struct drm_file *file,
|
||||
struct drm_device *dev,
|
||||
struct drm_mode_create_dumb *args);
|
||||
int drm_gem_vram_driver_dumb_mmap_offset(struct drm_file *file,
|
||||
struct drm_device *dev,
|
||||
uint32_t handle, uint64_t *offset);
|
||||
|
||||
/**
|
||||
* define DRM_GEM_VRAM_DRIVER - default callback functions for \
|
||||
&struct drm_driver
|
||||
*
|
||||
* Drivers that use VRAM MM and GEM VRAM can use this macro to initialize
|
||||
* &struct drm_driver with default functions.
|
||||
*/
|
||||
#define DRM_GEM_VRAM_DRIVER \
|
||||
.gem_free_object_unlocked = \
|
||||
drm_gem_vram_driver_gem_free_object_unlocked, \
|
||||
.dumb_create = drm_gem_vram_driver_dumb_create, \
|
||||
.dumb_map_offset = drm_gem_vram_driver_dumb_mmap_offset
|
||||
|
||||
/*
|
||||
* PRIME helpers for struct drm_driver
|
||||
*/
|
||||
|
||||
int drm_gem_vram_driver_gem_prime_pin(struct drm_gem_object *obj);
|
||||
void drm_gem_vram_driver_gem_prime_unpin(struct drm_gem_object *obj);
|
||||
void *drm_gem_vram_driver_gem_prime_vmap(struct drm_gem_object *obj);
|
||||
void drm_gem_vram_driver_gem_prime_vunmap(struct drm_gem_object *obj,
|
||||
void *vaddr);
|
||||
int drm_gem_vram_driver_gem_prime_mmap(struct drm_gem_object *obj,
|
||||
struct vm_area_struct *vma);
|
||||
|
||||
#define DRM_GEM_VRAM_DRIVER_PRIME \
|
||||
.gem_prime_export = drm_gem_prime_export, \
|
||||
.gem_prime_import = drm_gem_prime_import, \
|
||||
.gem_prime_pin = drm_gem_vram_driver_gem_prime_pin, \
|
||||
.gem_prime_unpin = drm_gem_vram_driver_gem_prime_unpin, \
|
||||
.gem_prime_vmap = drm_gem_vram_driver_gem_prime_vmap, \
|
||||
.gem_prime_vunmap = drm_gem_vram_driver_gem_prime_vunmap, \
|
||||
.gem_prime_mmap = drm_gem_vram_driver_gem_prime_mmap
|
||||
|
||||
#endif
|
||||
|
|
@ -836,6 +836,13 @@ struct drm_mode_config {
|
|||
*/
|
||||
struct drm_property *writeback_out_fence_ptr_property;
|
||||
|
||||
/**
|
||||
* hdr_output_metadata_property: Connector property containing hdr
|
||||
* metatda. This will be provided by userspace compositors based
|
||||
* on HDR content
|
||||
*/
|
||||
struct drm_property *hdr_output_metadata_property;
|
||||
|
||||
/* dumb ioctl parameters */
|
||||
uint32_t preferred_depth, prefer_shadow;
|
||||
|
||||
|
|
|
|||
102
include/drm/drm_vram_mm_helper.h
Normal file
102
include/drm/drm_vram_mm_helper.h
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#ifndef DRM_VRAM_MM_HELPER_H
|
||||
#define DRM_VRAM_MM_HELPER_H
|
||||
|
||||
#include <drm/ttm/ttm_bo_driver.h>
|
||||
|
||||
struct drm_device;
|
||||
|
||||
/**
|
||||
* struct drm_vram_mm_funcs - Callback functions for &struct drm_vram_mm
|
||||
* @evict_flags: Provides an implementation for struct \
|
||||
&ttm_bo_driver.evict_flags
|
||||
* @verify_access: Provides an implementation for \
|
||||
struct &ttm_bo_driver.verify_access
|
||||
*
|
||||
* These callback function integrate VRAM MM with TTM buffer objects. New
|
||||
* functions can be added if necessary.
|
||||
*/
|
||||
struct drm_vram_mm_funcs {
|
||||
void (*evict_flags)(struct ttm_buffer_object *bo,
|
||||
struct ttm_placement *placement);
|
||||
int (*verify_access)(struct ttm_buffer_object *bo, struct file *filp);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_vram_mm - An instance of VRAM MM
|
||||
* @vram_base: Base address of the managed video memory
|
||||
* @vram_size: Size of the managed video memory in bytes
|
||||
* @bdev: The TTM BO device.
|
||||
* @funcs: TTM BO functions
|
||||
*
|
||||
* The fields &struct drm_vram_mm.vram_base and
|
||||
* &struct drm_vram_mm.vrm_size are managed by VRAM MM, but are
|
||||
* available for public read access. Use the field
|
||||
* &struct drm_vram_mm.bdev to access the TTM BO device.
|
||||
*/
|
||||
struct drm_vram_mm {
|
||||
uint64_t vram_base;
|
||||
size_t vram_size;
|
||||
|
||||
struct ttm_bo_device bdev;
|
||||
|
||||
const struct drm_vram_mm_funcs *funcs;
|
||||
};
|
||||
|
||||
/**
|
||||
* drm_vram_mm_of_bdev() - \
|
||||
Returns the container of type &struct ttm_bo_device for field bdev.
|
||||
* @bdev: the TTM BO device
|
||||
*
|
||||
* Returns:
|
||||
* The containing instance of &struct drm_vram_mm
|
||||
*/
|
||||
static inline struct drm_vram_mm *drm_vram_mm_of_bdev(
|
||||
struct ttm_bo_device *bdev)
|
||||
{
|
||||
return container_of(bdev, struct drm_vram_mm, bdev);
|
||||
}
|
||||
|
||||
int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev,
|
||||
uint64_t vram_base, size_t vram_size,
|
||||
const struct drm_vram_mm_funcs *funcs);
|
||||
void drm_vram_mm_cleanup(struct drm_vram_mm *vmm);
|
||||
|
||||
int drm_vram_mm_mmap(struct file *filp, struct vm_area_struct *vma,
|
||||
struct drm_vram_mm *vmm);
|
||||
|
||||
/*
|
||||
* Helpers for integration with struct drm_device
|
||||
*/
|
||||
|
||||
struct drm_vram_mm *drm_vram_helper_alloc_mm(
|
||||
struct drm_device *dev, uint64_t vram_base, size_t vram_size,
|
||||
const struct drm_vram_mm_funcs *funcs);
|
||||
void drm_vram_helper_release_mm(struct drm_device *dev);
|
||||
|
||||
/*
|
||||
* Helpers for &struct file_operations
|
||||
*/
|
||||
|
||||
int drm_vram_mm_file_operations_mmap(
|
||||
struct file *filp, struct vm_area_struct *vma);
|
||||
|
||||
/**
|
||||
* define DRM_VRAM_MM_FILE_OPERATIONS - default callback functions for \
|
||||
&struct file_operations
|
||||
*
|
||||
* Drivers that use VRAM MM can use this macro to initialize
|
||||
* &struct file_operations with default functions.
|
||||
*/
|
||||
#define DRM_VRAM_MM_FILE_OPERATIONS \
|
||||
.llseek = no_llseek, \
|
||||
.read = drm_read, \
|
||||
.poll = drm_poll, \
|
||||
.unlocked_ioctl = drm_ioctl, \
|
||||
.compat_ioctl = drm_compat_ioctl, \
|
||||
.mmap = drm_vram_mm_file_operations_mmap, \
|
||||
.open = drm_open, \
|
||||
.release = drm_release \
|
||||
|
||||
#endif
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
/**************************************************************************
|
||||
* Copyright (c) 2007-2011, Intel Corporation.
|
||||
* All Rights Reserved.
|
||||
* Copyright (c) 2008, Tungsten Graphics Inc. Cedar Park, TX., USA.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _GMA_DRM_H_
|
||||
#define _GMA_DRM_H_
|
||||
|
||||
#endif
|
||||
|
|
@ -167,9 +167,6 @@ struct drm_sched_fence *to_drm_sched_fence(struct dma_fence *f);
|
|||
* @sched: the scheduler instance on which this job is scheduled.
|
||||
* @s_fence: contains the fences for the scheduling of job.
|
||||
* @finish_cb: the callback for the finished fence.
|
||||
* @finish_work: schedules the function @drm_sched_job_finish once the job has
|
||||
* finished to remove the job from the
|
||||
* @drm_gpu_scheduler.ring_mirror_list.
|
||||
* @node: used to append this struct to the @drm_gpu_scheduler.ring_mirror_list.
|
||||
* @id: a unique id assigned to each job scheduled on the scheduler.
|
||||
* @karma: increment on every hang caused by this job. If this exceeds the hang
|
||||
|
|
@ -188,7 +185,6 @@ struct drm_sched_job {
|
|||
struct drm_gpu_scheduler *sched;
|
||||
struct drm_sched_fence *s_fence;
|
||||
struct dma_fence_cb finish_cb;
|
||||
struct work_struct finish_work;
|
||||
struct list_head node;
|
||||
uint64_t id;
|
||||
atomic_t karma;
|
||||
|
|
@ -263,6 +259,7 @@ struct drm_sched_backend_ops {
|
|||
* guilty and it will be considered for scheduling further.
|
||||
* @num_jobs: the number of jobs in queue in the scheduler
|
||||
* @ready: marks if the underlying HW is ready to work
|
||||
* @free_guilty: A hit to time out handler to free the guilty job.
|
||||
*
|
||||
* One scheduler is implemented for each hardware ring.
|
||||
*/
|
||||
|
|
@ -283,6 +280,7 @@ struct drm_gpu_scheduler {
|
|||
int hang_limit;
|
||||
atomic_t num_jobs;
|
||||
bool ready;
|
||||
bool free_guilty;
|
||||
};
|
||||
|
||||
int drm_sched_init(struct drm_gpu_scheduler *sched,
|
||||
|
|
@ -296,7 +294,7 @@ int drm_sched_job_init(struct drm_sched_job *job,
|
|||
void *owner);
|
||||
void drm_sched_job_cleanup(struct drm_sched_job *job);
|
||||
void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
|
||||
void drm_sched_stop(struct drm_gpu_scheduler *sched);
|
||||
void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad);
|
||||
void drm_sched_start(struct drm_gpu_scheduler *sched, bool full_recovery);
|
||||
void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched);
|
||||
void drm_sched_increase_karma(struct drm_sched_job *bad);
|
||||
|
|
|
|||
|
|
@ -39,18 +39,20 @@ struct dma_buf_attachment;
|
|||
|
||||
/**
|
||||
* struct dma_buf_ops - operations possible on struct dma_buf
|
||||
* @map_atomic: [optional] maps a page from the buffer into kernel address
|
||||
* space, users may not block until the subsequent unmap call.
|
||||
* This callback must not sleep.
|
||||
* @unmap_atomic: [optional] unmaps a atomically mapped page from the buffer.
|
||||
* This Callback must not sleep.
|
||||
* @map: [optional] maps a page from the buffer into kernel address space.
|
||||
* @unmap: [optional] unmaps a page from the buffer.
|
||||
* @vmap: [optional] creates a virtual mapping for the buffer into kernel
|
||||
* address space. Same restrictions as for vmap and friends apply.
|
||||
* @vunmap: [optional] unmaps a vmap from the buffer
|
||||
*/
|
||||
struct dma_buf_ops {
|
||||
/**
|
||||
* @cache_sgt_mapping:
|
||||
*
|
||||
* If true the framework will cache the first mapping made for each
|
||||
* attachment. This avoids creating mappings for attachments multiple
|
||||
* times.
|
||||
*/
|
||||
bool cache_sgt_mapping;
|
||||
|
||||
/**
|
||||
* @attach:
|
||||
*
|
||||
|
|
@ -205,8 +207,6 @@ struct dma_buf_ops {
|
|||
* to be restarted.
|
||||
*/
|
||||
int (*end_cpu_access)(struct dma_buf *, enum dma_data_direction);
|
||||
void *(*map)(struct dma_buf *, unsigned long);
|
||||
void (*unmap)(struct dma_buf *, unsigned long, void *);
|
||||
|
||||
/**
|
||||
* @mmap:
|
||||
|
|
@ -245,6 +245,31 @@ struct dma_buf_ops {
|
|||
*/
|
||||
int (*mmap)(struct dma_buf *, struct vm_area_struct *vma);
|
||||
|
||||
/**
|
||||
* @map:
|
||||
*
|
||||
* Maps a page from the buffer into kernel address space. The page is
|
||||
* specified by offset into the buffer in PAGE_SIZE units.
|
||||
*
|
||||
* This callback is optional.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* Virtual address pointer where requested page can be accessed. NULL
|
||||
* on error or when this function is unimplemented by the exporter.
|
||||
*/
|
||||
void *(*map)(struct dma_buf *, unsigned long);
|
||||
|
||||
/**
|
||||
* @unmap:
|
||||
*
|
||||
* Unmaps a page from the buffer. Page offset and address pointer should
|
||||
* be the same as the one passed to and returned by matching call to map.
|
||||
*
|
||||
* This callback is optional.
|
||||
*/
|
||||
void (*unmap)(struct dma_buf *, unsigned long, void *);
|
||||
|
||||
void *(*vmap)(struct dma_buf *);
|
||||
void (*vunmap)(struct dma_buf *, void *vaddr);
|
||||
};
|
||||
|
|
@ -307,6 +332,8 @@ struct dma_buf {
|
|||
* @dmabuf: buffer for this attachment.
|
||||
* @dev: device attached to the buffer.
|
||||
* @node: list of dma_buf_attachment.
|
||||
* @sgt: cached mapping.
|
||||
* @dir: direction of cached mapping.
|
||||
* @priv: exporter specific attachment data.
|
||||
*
|
||||
* This structure holds the attachment information between the dma_buf buffer
|
||||
|
|
@ -322,6 +349,8 @@ struct dma_buf_attachment {
|
|||
struct dma_buf *dmabuf;
|
||||
struct device *dev;
|
||||
struct list_head node;
|
||||
struct sg_table *sgt;
|
||||
enum dma_data_direction dir;
|
||||
void *priv;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ enum hdmi_infoframe_type {
|
|||
HDMI_INFOFRAME_TYPE_AVI = 0x82,
|
||||
HDMI_INFOFRAME_TYPE_SPD = 0x83,
|
||||
HDMI_INFOFRAME_TYPE_AUDIO = 0x84,
|
||||
HDMI_INFOFRAME_TYPE_DRM = 0x87,
|
||||
};
|
||||
|
||||
#define HDMI_IEEE_OUI 0x000c03
|
||||
|
|
@ -55,6 +56,7 @@ enum hdmi_infoframe_type {
|
|||
#define HDMI_AVI_INFOFRAME_SIZE 13
|
||||
#define HDMI_SPD_INFOFRAME_SIZE 25
|
||||
#define HDMI_AUDIO_INFOFRAME_SIZE 10
|
||||
#define HDMI_DRM_INFOFRAME_SIZE 26
|
||||
|
||||
#define HDMI_INFOFRAME_SIZE(type) \
|
||||
(HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
|
||||
|
|
@ -152,6 +154,17 @@ enum hdmi_content_type {
|
|||
HDMI_CONTENT_TYPE_GAME,
|
||||
};
|
||||
|
||||
enum hdmi_metadata_type {
|
||||
HDMI_STATIC_METADATA_TYPE1 = 1,
|
||||
};
|
||||
|
||||
enum hdmi_eotf {
|
||||
HDMI_EOTF_TRADITIONAL_GAMMA_SDR,
|
||||
HDMI_EOTF_TRADITIONAL_GAMMA_HDR,
|
||||
HDMI_EOTF_SMPTE_ST2084,
|
||||
HDMI_EOTF_BT_2100_HLG,
|
||||
};
|
||||
|
||||
struct hdmi_avi_infoframe {
|
||||
enum hdmi_infoframe_type type;
|
||||
unsigned char version;
|
||||
|
|
@ -175,12 +188,37 @@ struct hdmi_avi_infoframe {
|
|||
unsigned short right_bar;
|
||||
};
|
||||
|
||||
/* DRM Infoframe as per CTA 861.G spec */
|
||||
struct hdmi_drm_infoframe {
|
||||
enum hdmi_infoframe_type type;
|
||||
unsigned char version;
|
||||
unsigned char length;
|
||||
enum hdmi_eotf eotf;
|
||||
enum hdmi_metadata_type metadata_type;
|
||||
struct {
|
||||
u16 x, y;
|
||||
} display_primaries[3];
|
||||
struct {
|
||||
u16 x, y;
|
||||
} white_point;
|
||||
u16 max_display_mastering_luminance;
|
||||
u16 min_display_mastering_luminance;
|
||||
u16 max_cll;
|
||||
u16 max_fall;
|
||||
};
|
||||
|
||||
int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
|
||||
ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
|
||||
size_t size);
|
||||
ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,
|
||||
void *buffer, size_t size);
|
||||
int hdmi_avi_infoframe_check(struct hdmi_avi_infoframe *frame);
|
||||
int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe *frame);
|
||||
ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe *frame, void *buffer,
|
||||
size_t size);
|
||||
ssize_t hdmi_drm_infoframe_pack_only(const struct hdmi_drm_infoframe *frame,
|
||||
void *buffer, size_t size);
|
||||
int hdmi_drm_infoframe_check(struct hdmi_drm_infoframe *frame);
|
||||
|
||||
enum hdmi_spd_sdi {
|
||||
HDMI_SPD_SDI_UNKNOWN,
|
||||
|
|
@ -320,6 +358,22 @@ struct hdmi_vendor_infoframe {
|
|||
unsigned int s3d_ext_data;
|
||||
};
|
||||
|
||||
/* HDR Metadata as per 861.G spec */
|
||||
struct hdr_static_metadata {
|
||||
__u8 eotf;
|
||||
__u8 metadata_type;
|
||||
__u16 max_cll;
|
||||
__u16 max_fall;
|
||||
__u16 min_cll;
|
||||
};
|
||||
|
||||
struct hdr_sink_metadata {
|
||||
__u32 metadata_type;
|
||||
union {
|
||||
struct hdr_static_metadata hdmi_type1;
|
||||
};
|
||||
};
|
||||
|
||||
int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
|
||||
ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
|
||||
void *buffer, size_t size);
|
||||
|
|
@ -355,6 +409,7 @@ union hdmi_infoframe {
|
|||
struct hdmi_spd_infoframe spd;
|
||||
union hdmi_vendor_any_infoframe vendor;
|
||||
struct hdmi_audio_infoframe audio;
|
||||
struct hdmi_drm_infoframe drm;
|
||||
};
|
||||
|
||||
ssize_t hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer,
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ typedef unsigned int drm_handle_t;
|
|||
|
||||
#else /* One of the BSDs */
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/ioccom.h>
|
||||
#include <sys/types.h>
|
||||
typedef int8_t __s8;
|
||||
|
|
|
|||
|
|
@ -630,6 +630,29 @@ struct drm_color_lut {
|
|||
__u16 reserved;
|
||||
};
|
||||
|
||||
/* HDR Metadata Infoframe as per 861.G spec */
|
||||
struct hdr_metadata_infoframe {
|
||||
__u8 eotf;
|
||||
__u8 metadata_type;
|
||||
struct {
|
||||
__u16 x, y;
|
||||
} display_primaries[3];
|
||||
struct {
|
||||
__u16 x, y;
|
||||
} white_point;
|
||||
__u16 max_display_mastering_luminance;
|
||||
__u16 min_display_mastering_luminance;
|
||||
__u16 max_cll;
|
||||
__u16 max_fall;
|
||||
};
|
||||
|
||||
struct hdr_output_metadata {
|
||||
__u32 metadata_type;
|
||||
union {
|
||||
struct hdr_metadata_infoframe hdmi_metadata_type1;
|
||||
};
|
||||
};
|
||||
|
||||
#define DRM_MODE_PAGE_FLIP_EVENT 0x01
|
||||
#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
|
||||
#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ extern "C" {
|
|||
#define DRM_V3D_GET_PARAM 0x04
|
||||
#define DRM_V3D_GET_BO_OFFSET 0x05
|
||||
#define DRM_V3D_SUBMIT_TFU 0x06
|
||||
#define DRM_V3D_SUBMIT_CSD 0x07
|
||||
|
||||
#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
|
||||
#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
|
||||
|
|
@ -45,6 +46,7 @@ extern "C" {
|
|||
#define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
|
||||
#define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
|
||||
#define DRM_IOCTL_V3D_SUBMIT_TFU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu)
|
||||
#define DRM_IOCTL_V3D_SUBMIT_CSD DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CSD, struct drm_v3d_submit_csd)
|
||||
|
||||
/**
|
||||
* struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
|
||||
|
|
@ -190,6 +192,7 @@ enum drm_v3d_param {
|
|||
DRM_V3D_PARAM_V3D_CORE0_IDENT1,
|
||||
DRM_V3D_PARAM_V3D_CORE0_IDENT2,
|
||||
DRM_V3D_PARAM_SUPPORTS_TFU,
|
||||
DRM_V3D_PARAM_SUPPORTS_CSD,
|
||||
};
|
||||
|
||||
struct drm_v3d_get_param {
|
||||
|
|
@ -230,6 +233,31 @@ struct drm_v3d_submit_tfu {
|
|||
__u32 out_sync;
|
||||
};
|
||||
|
||||
/* Submits a compute shader for dispatch. This job will block on any
|
||||
* previous compute shaders submitted on this fd, and any other
|
||||
* synchronization must be performed with in_sync/out_sync.
|
||||
*/
|
||||
struct drm_v3d_submit_csd {
|
||||
__u32 cfg[7];
|
||||
__u32 coef[4];
|
||||
|
||||
/* Pointer to a u32 array of the BOs that are referenced by the job.
|
||||
*/
|
||||
__u64 bo_handles;
|
||||
|
||||
/* Number of BO handles passed in (size is that times 4). */
|
||||
__u32 bo_handle_count;
|
||||
|
||||
/* sync object to block on before running the CSD job. Each
|
||||
* CSD job will execute in the order submitted to its FD.
|
||||
* Synchronization against rendering/TFU jobs or CSD from
|
||||
* other fds requires using sync objects.
|
||||
*/
|
||||
__u32 in_sync;
|
||||
/* Sync object to signal when the CSD job is done. */
|
||||
__u32 out_sync;
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue