Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next
Another round of -misc stuff: - Noralf debugfs cleanup cleanup (not yet everything, some more driver patches awaiting acks). - More doc work. - edid/infoframe fixes from Ville. - misc 1-patch fixes all over, as usual Noralf needs this for his tinydrm pull request. * tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc: (48 commits) drm/vc4: Remove vc4_debugfs_cleanup() dma/fence: Export enable-signaling tracepoint for emission by drivers drm/tilcdc: Remove tilcdc_debugfs_cleanup() drm/tegra: Remove tegra_debugfs_cleanup() drm/sti: Remove drm_debugfs_remove_files() calls drm/radeon: Remove drm_debugfs_remove_files() call drm/omap: Remove omap_debugfs_cleanup() drm/hdlcd: Remove hdlcd_debugfs_cleanup() drm/etnaviv: Remove etnaviv_debugfs_cleanup() drm/etnaviv: allow build with COMPILE_TEST drm/amd/amdgpu: Remove drm_debugfs_remove_files() call drm/prime: Clarify DMA-BUF/GEM Object lifetime drm/ttm: Make sure BOs being swapped out are cacheable drm/atomic: Remove drm_atomic_debugfs_cleanup() drm: drm_minor_register(): Clean up debugfs on failure drm: debugfs: Remove all files automatically on cleanup drm/fourcc: add vivante tiled layout format modifiers drm/edid: Set YQ bits in the AVI infoframe according to CEA-861-F drm/edid: Set AVI infoframe Q even when QS=0 drm/edid: Introduce drm_hdmi_avi_infoframe_quant_range() ...
This commit is contained in:
@@ -48,11 +48,17 @@ CRTC Abstraction
|
|||||||
================
|
================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
|
.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
|
||||||
:export:
|
:doc: overview
|
||||||
|
|
||||||
|
CRTC Functions Reference
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
.. kernel-doc:: include/drm/drm_crtc.h
|
.. kernel-doc:: include/drm/drm_crtc.h
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
|
||||||
|
:export:
|
||||||
|
|
||||||
Frame Buffer Abstraction
|
Frame Buffer Abstraction
|
||||||
========================
|
========================
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(dma_fence_annotate_wait_on);
|
EXPORT_TRACEPOINT_SYMBOL(dma_fence_annotate_wait_on);
|
||||||
EXPORT_TRACEPOINT_SYMBOL(dma_fence_emit);
|
EXPORT_TRACEPOINT_SYMBOL(dma_fence_emit);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL(dma_fence_enable_signal);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fence context counter: each execution context should have its own
|
* fence context counter: each execution context should have its own
|
||||||
|
|||||||
@@ -1133,7 +1133,6 @@ int amdgpu_debugfs_fence_init(struct amdgpu_device *adev);
|
|||||||
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
int amdgpu_debugfs_init(struct drm_minor *minor);
|
int amdgpu_debugfs_init(struct drm_minor *minor);
|
||||||
void amdgpu_debugfs_cleanup(struct drm_minor *minor);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int amdgpu_debugfs_firmware_init(struct amdgpu_device *adev);
|
int amdgpu_debugfs_firmware_init(struct amdgpu_device *adev);
|
||||||
|
|||||||
@@ -1852,8 +1852,6 @@ failed:
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* amdgpu_device_fini - tear down the driver
|
* amdgpu_device_fini - tear down the driver
|
||||||
*
|
*
|
||||||
@@ -1893,7 +1891,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
|
|||||||
if (adev->asic_type >= CHIP_BONAIRE)
|
if (adev->asic_type >= CHIP_BONAIRE)
|
||||||
amdgpu_doorbell_fini(adev);
|
amdgpu_doorbell_fini(adev);
|
||||||
amdgpu_debugfs_regs_cleanup(adev);
|
amdgpu_debugfs_regs_cleanup(adev);
|
||||||
amdgpu_debugfs_remove_files(adev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2507,19 +2504,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev)
|
|
||||||
{
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
for (i = 0; i < adev->debugfs_count; i++) {
|
|
||||||
drm_debugfs_remove_files(adev->debugfs[i].files,
|
|
||||||
adev->debugfs[i].num_files,
|
|
||||||
adev->ddev->primary);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
|
|
||||||
static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf,
|
static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf,
|
||||||
@@ -3153,10 +3137,6 @@ int amdgpu_debugfs_init(struct drm_minor *minor)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void amdgpu_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
|
static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -686,7 +686,6 @@ static struct drm_driver kms_driver = {
|
|||||||
DRIVER_USE_AGP |
|
DRIVER_USE_AGP |
|
||||||
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
|
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
|
||||||
DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET,
|
DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET,
|
||||||
.dev_priv_size = 0,
|
|
||||||
.load = amdgpu_driver_load_kms,
|
.load = amdgpu_driver_load_kms,
|
||||||
.open = amdgpu_driver_open_kms,
|
.open = amdgpu_driver_open_kms,
|
||||||
.preclose = amdgpu_driver_preclose_kms,
|
.preclose = amdgpu_driver_preclose_kms,
|
||||||
@@ -701,7 +700,6 @@ static struct drm_driver kms_driver = {
|
|||||||
.get_scanout_position = amdgpu_get_crtc_scanoutpos,
|
.get_scanout_position = amdgpu_get_crtc_scanoutpos,
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
.debugfs_init = amdgpu_debugfs_init,
|
.debugfs_init = amdgpu_debugfs_init,
|
||||||
.debugfs_cleanup = amdgpu_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
.irq_preinstall = amdgpu_irq_preinstall,
|
.irq_preinstall = amdgpu_irq_preinstall,
|
||||||
.irq_postinstall = amdgpu_irq_postinstall,
|
.irq_postinstall = amdgpu_irq_postinstall,
|
||||||
|
|||||||
@@ -255,12 +255,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
|
|||||||
return drm_debugfs_create_files(hdlcd_debugfs_list,
|
return drm_debugfs_create_files(hdlcd_debugfs_list,
|
||||||
ARRAY_SIZE(hdlcd_debugfs_list), minor->debugfs_root, minor);
|
ARRAY_SIZE(hdlcd_debugfs_list), minor->debugfs_root, minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hdlcd_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(hdlcd_debugfs_list,
|
|
||||||
ARRAY_SIZE(hdlcd_debugfs_list), minor);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct file_operations fops = {
|
static const struct file_operations fops = {
|
||||||
@@ -303,7 +297,6 @@ static struct drm_driver hdlcd_driver = {
|
|||||||
.gem_prime_mmap = drm_gem_cma_prime_mmap,
|
.gem_prime_mmap = drm_gem_cma_prime_mmap,
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
.debugfs_init = hdlcd_debugfs_init,
|
.debugfs_init = hdlcd_debugfs_init,
|
||||||
.debugfs_cleanup = hdlcd_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
.fops = &fops,
|
.fops = &fops,
|
||||||
.name = "hdlcd",
|
.name = "hdlcd",
|
||||||
|
|||||||
@@ -2060,7 +2060,9 @@ __dw_hdmi_probe(struct platform_device *pdev,
|
|||||||
|
|
||||||
hdmi->bridge.driver_private = hdmi;
|
hdmi->bridge.driver_private = hdmi;
|
||||||
hdmi->bridge.funcs = &dw_hdmi_bridge_funcs;
|
hdmi->bridge.funcs = &dw_hdmi_bridge_funcs;
|
||||||
|
#ifdef CONFIG_OF
|
||||||
hdmi->bridge.of_node = pdev->dev.of_node;
|
hdmi->bridge.of_node = pdev->dev.of_node;
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = dw_hdmi_fb_registered(hdmi);
|
ret = dw_hdmi_fb_registered(hdmi);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|||||||
@@ -421,6 +421,8 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
|
|||||||
head->base = head->agp_info.aper_base;
|
head->base = head->agp_info.aper_base;
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
/* Only exported for i810.ko */
|
||||||
|
EXPORT_SYMBOL(drm_agp_init);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_legacy_agp_clear - Clear AGP resource list
|
* drm_legacy_agp_clear - Clear AGP resource list
|
||||||
|
|||||||
@@ -195,8 +195,8 @@ EXPORT_SYMBOL(drm_atomic_state_default_clear);
|
|||||||
* all locks. So someone else could sneak in and change the current modeset
|
* all locks. So someone else could sneak in and change the current modeset
|
||||||
* configuration. Which means that all the state assembled in @state is no
|
* configuration. Which means that all the state assembled in @state is no
|
||||||
* longer an atomic update to the current state, but to some arbitrary earlier
|
* longer an atomic update to the current state, but to some arbitrary earlier
|
||||||
* state. Which could break assumptions the driver's ->atomic_check likely
|
* state. Which could break assumptions the driver's
|
||||||
* relies on.
|
* &drm_mode_config_funcs.atomic_check likely relies on.
|
||||||
*
|
*
|
||||||
* Hence we must clear all cached state and completely start over, using this
|
* Hence we must clear all cached state and completely start over, using this
|
||||||
* function.
|
* function.
|
||||||
@@ -456,11 +456,10 @@ drm_atomic_replace_property_blob_from_id(struct drm_crtc *crtc,
|
|||||||
* @property: the property to set
|
* @property: the property to set
|
||||||
* @val: the new property value
|
* @val: the new property value
|
||||||
*
|
*
|
||||||
* Use this instead of calling crtc->atomic_set_property directly.
|
* This function handles generic/core properties and calls out to driver's
|
||||||
* This function handles generic/core properties and calls out to
|
* &drm_crtc_funcs.atomic_set_property for driver properties. To ensure
|
||||||
* driver's ->atomic_set_property() for driver properties. To ensure
|
* consistent behavior you must call this function rather than the driver hook
|
||||||
* consistent behavior you must call this function rather than the
|
* directly.
|
||||||
* driver hook directly.
|
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero on success, error code on failure
|
* Zero on success, error code on failure
|
||||||
@@ -532,10 +531,10 @@ EXPORT_SYMBOL(drm_atomic_crtc_set_property);
|
|||||||
* @property: the property to set
|
* @property: the property to set
|
||||||
* @val: return location for the property value
|
* @val: return location for the property value
|
||||||
*
|
*
|
||||||
* This function handles generic/core properties and calls out to
|
* This function handles generic/core properties and calls out to driver's
|
||||||
* driver's ->atomic_get_property() for driver properties. To ensure
|
* &drm_crtc_funcs.atomic_get_property for driver properties. To ensure
|
||||||
* consistent behavior you must call this function rather than the
|
* consistent behavior you must call this function rather than the driver hook
|
||||||
* driver hook directly.
|
* directly.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero on success, error code on failure
|
* Zero on success, error code on failure
|
||||||
@@ -716,11 +715,10 @@ EXPORT_SYMBOL(drm_atomic_get_plane_state);
|
|||||||
* @property: the property to set
|
* @property: the property to set
|
||||||
* @val: the new property value
|
* @val: the new property value
|
||||||
*
|
*
|
||||||
* Use this instead of calling plane->atomic_set_property directly.
|
* This function handles generic/core properties and calls out to driver's
|
||||||
* This function handles generic/core properties and calls out to
|
* &drm_plane_funcs.atomic_set_property for driver properties. To ensure
|
||||||
* driver's ->atomic_set_property() for driver properties. To ensure
|
* consistent behavior you must call this function rather than the driver hook
|
||||||
* consistent behavior you must call this function rather than the
|
* directly.
|
||||||
* driver hook directly.
|
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero on success, error code on failure
|
* Zero on success, error code on failure
|
||||||
@@ -791,10 +789,10 @@ EXPORT_SYMBOL(drm_atomic_plane_set_property);
|
|||||||
* @property: the property to set
|
* @property: the property to set
|
||||||
* @val: return location for the property value
|
* @val: return location for the property value
|
||||||
*
|
*
|
||||||
* This function handles generic/core properties and calls out to
|
* This function handles generic/core properties and calls out to driver's
|
||||||
* driver's ->atomic_get_property() for driver properties. To ensure
|
* &drm_plane_funcs.atomic_get_property for driver properties. To ensure
|
||||||
* consistent behavior you must call this function rather than the
|
* consistent behavior you must call this function rather than the driver hook
|
||||||
* driver hook directly.
|
* directly.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero on success, error code on failure
|
* Zero on success, error code on failure
|
||||||
@@ -1057,11 +1055,10 @@ EXPORT_SYMBOL(drm_atomic_get_connector_state);
|
|||||||
* @property: the property to set
|
* @property: the property to set
|
||||||
* @val: the new property value
|
* @val: the new property value
|
||||||
*
|
*
|
||||||
* Use this instead of calling connector->atomic_set_property directly.
|
* This function handles generic/core properties and calls out to driver's
|
||||||
* This function handles generic/core properties and calls out to
|
* &drm_connector_funcs.atomic_set_property for driver properties. To ensure
|
||||||
* driver's ->atomic_set_property() for driver properties. To ensure
|
* consistent behavior you must call this function rather than the driver hook
|
||||||
* consistent behavior you must call this function rather than the
|
* directly.
|
||||||
* driver hook directly.
|
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero on success, error code on failure
|
* Zero on success, error code on failure
|
||||||
@@ -1136,10 +1133,10 @@ static void drm_atomic_connector_print_state(struct drm_printer *p,
|
|||||||
* @property: the property to set
|
* @property: the property to set
|
||||||
* @val: return location for the property value
|
* @val: return location for the property value
|
||||||
*
|
*
|
||||||
* This function handles generic/core properties and calls out to
|
* This function handles generic/core properties and calls out to driver's
|
||||||
* driver's ->atomic_get_property() for driver properties. To ensure
|
* &drm_connector_funcs.atomic_get_property for driver properties. To ensure
|
||||||
* consistent behavior you must call this function rather than the
|
* consistent behavior you must call this function rather than the driver hook
|
||||||
* driver hook directly.
|
* directly.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero on success, error code on failure
|
* Zero on success, error code on failure
|
||||||
@@ -1312,12 +1309,11 @@ EXPORT_SYMBOL(drm_atomic_set_fb_for_plane);
|
|||||||
* implicit or explicit fencing.
|
* implicit or explicit fencing.
|
||||||
*
|
*
|
||||||
* This function will not set the fence to the state if it was set
|
* This function will not set the fence to the state if it was set
|
||||||
* via explicit fencing interfaces on the atomic ioctl. It will
|
* via explicit fencing interfaces on the atomic ioctl. In that case it will
|
||||||
* all drope the reference to the fence as we not storing it
|
* drop the reference to the fence as we are not storing it anywhere.
|
||||||
* anywhere.
|
* Otherwise, if &drm_plane_state.fence is not set this function we just set it
|
||||||
*
|
* with the received implicit fence. In both cases this function consumes a
|
||||||
* Otherwise, if plane_state->fence is not set this function we
|
* reference for @fence.
|
||||||
* just set it with the received implict fence.
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
drm_atomic_set_fence_for_plane(struct drm_plane_state *plane_state,
|
drm_atomic_set_fence_for_plane(struct drm_plane_state *plane_state,
|
||||||
@@ -1616,7 +1612,7 @@ int drm_atomic_commit(struct drm_atomic_state *state)
|
|||||||
EXPORT_SYMBOL(drm_atomic_commit);
|
EXPORT_SYMBOL(drm_atomic_commit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_atomic_nonblocking_commit - atomic&nonblocking configuration commit
|
* drm_atomic_nonblocking_commit - atomic nonblocking commit
|
||||||
* @state: atomic configuration to check
|
* @state: atomic configuration to check
|
||||||
*
|
*
|
||||||
* Note that this function can return -EDEADLK if the driver needed to acquire
|
* Note that this function can return -EDEADLK if the driver needed to acquire
|
||||||
@@ -1731,13 +1727,6 @@ int drm_atomic_debugfs_init(struct drm_minor *minor)
|
|||||||
ARRAY_SIZE(drm_atomic_debugfs_list),
|
ARRAY_SIZE(drm_atomic_debugfs_list),
|
||||||
minor->debugfs_root, minor);
|
minor->debugfs_root, minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
int drm_atomic_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
return drm_debugfs_remove_files(drm_atomic_debugfs_list,
|
|
||||||
ARRAY_SIZE(drm_atomic_debugfs_list),
|
|
||||||
minor);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1829,10 +1818,10 @@ static int atomic_set_prop(struct drm_atomic_state *state,
|
|||||||
* @plane_mask: plane mask for planes that were updated.
|
* @plane_mask: plane mask for planes that were updated.
|
||||||
* @ret: return value, can be -EDEADLK for a retry.
|
* @ret: return value, can be -EDEADLK for a retry.
|
||||||
*
|
*
|
||||||
* Before doing an update plane->old_fb is set to plane->fb,
|
* Before doing an update &drm_plane.old_fb is set to &drm_plane.fb, but before
|
||||||
* but before dropping the locks old_fb needs to be set to NULL
|
* dropping the locks old_fb needs to be set to NULL and plane->fb updated. This
|
||||||
* and plane->fb updated. This is a common operation for each
|
* is a common operation for each atomic update, so this call is split off as a
|
||||||
* atomic update, so this call is split off as a helper.
|
* helper.
|
||||||
*/
|
*/
|
||||||
void drm_atomic_clean_old_fb(struct drm_device *dev,
|
void drm_atomic_clean_old_fb(struct drm_device *dev,
|
||||||
unsigned plane_mask,
|
unsigned plane_mask,
|
||||||
@@ -1873,7 +1862,7 @@ EXPORT_SYMBOL(drm_atomic_clean_old_fb);
|
|||||||
* As a contrast, with implicit fencing the kernel keeps track of any
|
* As a contrast, with implicit fencing the kernel keeps track of any
|
||||||
* ongoing rendering, and automatically ensures that the atomic update waits
|
* ongoing rendering, and automatically ensures that the atomic update waits
|
||||||
* for any pending rendering to complete. For shared buffers represented with
|
* for any pending rendering to complete. For shared buffers represented with
|
||||||
* a &struct dma_buf this is tracked in &reservation_object structures.
|
* a &struct dma_buf this is tracked in &struct reservation_object.
|
||||||
* Implicit syncing is how Linux traditionally worked (e.g. DRI2/3 on X.org),
|
* Implicit syncing is how Linux traditionally worked (e.g. DRI2/3 on X.org),
|
||||||
* whereas explicit fencing is what Android wants.
|
* whereas explicit fencing is what Android wants.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -458,22 +458,25 @@ mode_fixup(struct drm_atomic_state *state)
|
|||||||
* Check the state object to see if the requested state is physically possible.
|
* Check the state object to see if the requested state is physically possible.
|
||||||
* This does all the crtc and connector related computations for an atomic
|
* This does all the crtc and connector related computations for an atomic
|
||||||
* update and adds any additional connectors needed for full modesets and calls
|
* update and adds any additional connectors needed for full modesets and calls
|
||||||
* down into ->mode_fixup functions of the driver backend.
|
* down into &drm_crtc_helper_funcs.mode_fixup and
|
||||||
|
* &drm_encoder_helper_funcs.mode_fixup or
|
||||||
|
* &drm_encoder_helper_funcs.atomic_check functions of the driver backend.
|
||||||
*
|
*
|
||||||
* crtc_state->mode_changed is set when the input mode is changed.
|
* &drm_crtc_state.mode_changed is set when the input mode is changed.
|
||||||
* crtc_state->connectors_changed is set when a connector is added or
|
* &drm_crtc_state.connectors_changed is set when a connector is added or
|
||||||
* removed from the crtc.
|
* removed from the crtc. &drm_crtc_state.active_changed is set when
|
||||||
* crtc_state->active_changed is set when crtc_state->active changes,
|
* &drm_crtc_state.active changes, which is used for DPMS.
|
||||||
* which is used for dpms.
|
|
||||||
* See also: drm_atomic_crtc_needs_modeset()
|
* See also: drm_atomic_crtc_needs_modeset()
|
||||||
*
|
*
|
||||||
* IMPORTANT:
|
* IMPORTANT:
|
||||||
*
|
*
|
||||||
* Drivers which set ->mode_changed (e.g. in their ->atomic_check hooks if a
|
* Drivers which set &drm_crtc_state.mode_changed (e.g. in their
|
||||||
* plane update can't be done without a full modeset) _must_ call this function
|
* &drm_plane_helper_funcs.atomic_check hooks if a plane update can't be done
|
||||||
* afterwards after that change. It is permitted to call this function multiple
|
* without a full modeset) _must_ call this function afterwards after that
|
||||||
* times for the same update, e.g. when the ->atomic_check functions depend upon
|
* change. It is permitted to call this function multiple times for the same
|
||||||
* the adjusted dotclock for fifo space allocation and watermark computation.
|
* update, e.g. when the &drm_crtc_helper_funcs.atomic_check functions depend
|
||||||
|
* upon the adjusted dotclock for fifo space allocation and watermark
|
||||||
|
* computation.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero for success or -errno
|
* Zero for success or -errno
|
||||||
@@ -584,9 +587,10 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
|
|||||||
*
|
*
|
||||||
* Check the state object to see if the requested state is physically possible.
|
* Check the state object to see if the requested state is physically possible.
|
||||||
* This does all the plane update related checks using by calling into the
|
* This does all the plane update related checks using by calling into the
|
||||||
* ->atomic_check hooks provided by the driver.
|
* &drm_crtc_helper_funcs.atomic_check and &drm_plane_helper_funcs.atomic_check
|
||||||
|
* hooks provided by the driver.
|
||||||
*
|
*
|
||||||
* It also sets crtc_state->planes_changed to indicate that a crtc has
|
* It also sets &drm_crtc_state.planes_changed to indicate that a crtc has
|
||||||
* updated planes.
|
* updated planes.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
@@ -648,14 +652,15 @@ EXPORT_SYMBOL(drm_atomic_helper_check_planes);
|
|||||||
* Check the state object to see if the requested state is physically possible.
|
* Check the state object to see if the requested state is physically possible.
|
||||||
* Only crtcs and planes have check callbacks, so for any additional (global)
|
* Only crtcs and planes have check callbacks, so for any additional (global)
|
||||||
* checking that a driver needs it can simply wrap that around this function.
|
* checking that a driver needs it can simply wrap that around this function.
|
||||||
* Drivers without such needs can directly use this as their ->atomic_check()
|
* Drivers without such needs can directly use this as their
|
||||||
* callback.
|
* &drm_mode_config_funcs.atomic_check callback.
|
||||||
*
|
*
|
||||||
* This just wraps the two parts of the state checking for planes and modeset
|
* This just wraps the two parts of the state checking for planes and modeset
|
||||||
* state in the default order: First it calls drm_atomic_helper_check_modeset()
|
* state in the default order: First it calls drm_atomic_helper_check_modeset()
|
||||||
* and then drm_atomic_helper_check_planes(). The assumption is that the
|
* and then drm_atomic_helper_check_planes(). The assumption is that the
|
||||||
* ->atomic_check functions depend upon an updated adjusted_mode.clock to
|
* @drm_plane_helper_funcs.atomic_check and @drm_crtc_helper_funcs.atomic_check
|
||||||
* e.g. properly compute watermarks.
|
* functions depend upon an updated adjusted_mode.clock to e.g. properly compute
|
||||||
|
* watermarks.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero for success or -errno
|
* Zero for success or -errno
|
||||||
@@ -1125,8 +1130,8 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks);
|
|||||||
* drm_atomic_helper_commit_tail - commit atomic update to hardware
|
* drm_atomic_helper_commit_tail - commit atomic update to hardware
|
||||||
* @old_state: atomic state object with old state structures
|
* @old_state: atomic state object with old state structures
|
||||||
*
|
*
|
||||||
* This is the default implemenation for the ->atomic_commit_tail() hook of the
|
* This is the default implementation for the
|
||||||
* &drm_mode_config_helper_funcs vtable.
|
* &drm_mode_config_helper_funcs.atomic_commit_tail hook.
|
||||||
*
|
*
|
||||||
* Note that the default ordering of how the various stages are called is to
|
* Note that the default ordering of how the various stages are called is to
|
||||||
* match the legacy modeset helper library closest. One peculiarity of that is
|
* match the legacy modeset helper library closest. One peculiarity of that is
|
||||||
@@ -1203,8 +1208,8 @@ static void commit_work(struct work_struct *work)
|
|||||||
* drm_atomic_helper_setup_commit() and related functions.
|
* drm_atomic_helper_setup_commit() and related functions.
|
||||||
*
|
*
|
||||||
* Committing the actual hardware state is done through the
|
* Committing the actual hardware state is done through the
|
||||||
* ->atomic_commit_tail() callback of the &drm_mode_config_helper_funcs vtable,
|
* &drm_mode_config_helper_funcs.atomic_commit_tail callback, or it's default
|
||||||
* or it's default implementation drm_atomic_helper_commit_tail().
|
* implementation drm_atomic_helper_commit_tail().
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Zero for success or -errno.
|
* Zero for success or -errno.
|
||||||
@@ -1357,7 +1362,7 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock)
|
|||||||
return ret < 0 ? ret : 0;
|
return ret < 0 ? ret : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void release_crtc_commit(struct completion *completion)
|
static void release_crtc_commit(struct completion *completion)
|
||||||
{
|
{
|
||||||
struct drm_crtc_commit *commit = container_of(completion,
|
struct drm_crtc_commit *commit = container_of(completion,
|
||||||
typeof(*commit),
|
typeof(*commit),
|
||||||
@@ -1373,14 +1378,15 @@ void release_crtc_commit(struct completion *completion)
|
|||||||
*
|
*
|
||||||
* This function prepares @state to be used by the atomic helper's support for
|
* This function prepares @state to be used by the atomic helper's support for
|
||||||
* nonblocking commits. Drivers using the nonblocking commit infrastructure
|
* nonblocking commits. Drivers using the nonblocking commit infrastructure
|
||||||
* should always call this function from their ->atomic_commit hook.
|
* should always call this function from their
|
||||||
|
* &drm_mode_config_funcs.atomic_commit hook.
|
||||||
*
|
*
|
||||||
* To be able to use this support drivers need to use a few more helper
|
* To be able to use this support drivers need to use a few more helper
|
||||||
* functions. drm_atomic_helper_wait_for_dependencies() must be called before
|
* functions. drm_atomic_helper_wait_for_dependencies() must be called before
|
||||||
* actually committing the hardware state, and for nonblocking commits this call
|
* actually committing the hardware state, and for nonblocking commits this call
|
||||||
* must be placed in the async worker. See also drm_atomic_helper_swap_state()
|
* must be placed in the async worker. See also drm_atomic_helper_swap_state()
|
||||||
* and it's stall parameter, for when a driver's commit hooks look at the
|
* and it's stall parameter, for when a driver's commit hooks look at the
|
||||||
* ->state pointers of &struct drm_crtc, &drm_plane or &drm_connector directly.
|
* &drm_crtc.state, &drm_plane.state or &drm_connector.state pointer directly.
|
||||||
*
|
*
|
||||||
* Completion of the hardware commit step must be signalled using
|
* Completion of the hardware commit step must be signalled using
|
||||||
* drm_atomic_helper_commit_hw_done(). After this step the driver is not allowed
|
* drm_atomic_helper_commit_hw_done(). After this step the driver is not allowed
|
||||||
@@ -1489,8 +1495,7 @@ static struct drm_crtc_commit *preceeding_commit(struct drm_crtc *crtc)
|
|||||||
* This function waits for all preceeding commits that touch the same CRTC as
|
* This function waits for all preceeding commits that touch the same CRTC as
|
||||||
* @old_state to both be committed to the hardware (as signalled by
|
* @old_state to both be committed to the hardware (as signalled by
|
||||||
* drm_atomic_helper_commit_hw_done) and executed by the hardware (as signalled
|
* drm_atomic_helper_commit_hw_done) and executed by the hardware (as signalled
|
||||||
* by calling drm_crtc_vblank_send_event on the event member of
|
* by calling drm_crtc_vblank_send_event() on the &drm_crtc_state.event).
|
||||||
* &drm_crtc_state).
|
|
||||||
*
|
*
|
||||||
* This is part of the atomic helper support for nonblocking commits, see
|
* This is part of the atomic helper support for nonblocking commits, see
|
||||||
* drm_atomic_helper_setup_commit() for an overview.
|
* drm_atomic_helper_setup_commit() for an overview.
|
||||||
@@ -1627,8 +1632,9 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_cleanup_done);
|
|||||||
* @state: atomic state object with new state structures
|
* @state: atomic state object with new state structures
|
||||||
*
|
*
|
||||||
* This function prepares plane state, specifically framebuffers, for the new
|
* This function prepares plane state, specifically framebuffers, for the new
|
||||||
* configuration. If any failure is encountered this function will call
|
* configuration, by calling &drm_plane_helper_funcs.prepare_fb. If any failure
|
||||||
* ->cleanup_fb on any already successfully prepared framebuffer.
|
* is encountered this function will call &drm_plane_helper_funcs.cleanup_fb on
|
||||||
|
* any already successfully prepared framebuffer.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 on success, negative error code on failure.
|
* 0 on success, negative error code on failure.
|
||||||
@@ -1708,10 +1714,10 @@ static bool plane_crtc_active(const struct drm_plane_state *state)
|
|||||||
*
|
*
|
||||||
* Drivers may set the NO_DISABLE_AFTER_MODESET flag in @flags if the relevant
|
* Drivers may set the NO_DISABLE_AFTER_MODESET flag in @flags if the relevant
|
||||||
* display controllers require to disable a CRTC's planes when the CRTC is
|
* display controllers require to disable a CRTC's planes when the CRTC is
|
||||||
* disabled. This function would skip the ->atomic_disable call for a plane if
|
* disabled. This function would skip the &drm_plane_helper_funcs.atomic_disable
|
||||||
* the CRTC of the old plane state needs a modesetting operation. Of course,
|
* call for a plane if the CRTC of the old plane state needs a modesetting
|
||||||
* the drivers need to disable the planes in their CRTC disable callbacks
|
* operation. Of course, the drivers need to disable the planes in their CRTC
|
||||||
* since no one else would do that.
|
* disable callbacks since no one else would do that.
|
||||||
*
|
*
|
||||||
* The drm_atomic_helper_commit() default implementation doesn't set the
|
* The drm_atomic_helper_commit() default implementation doesn't set the
|
||||||
* ACTIVE_ONLY flag to most closely match the behaviour of the legacy helpers.
|
* ACTIVE_ONLY flag to most closely match the behaviour of the legacy helpers.
|
||||||
@@ -1874,7 +1880,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
|
|||||||
* planes.
|
* planes.
|
||||||
*
|
*
|
||||||
* It is a bug to call this function without having implemented the
|
* It is a bug to call this function without having implemented the
|
||||||
* ->atomic_disable() plane hook.
|
* &drm_plane_helper_funcs.atomic_disable plane hook.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state,
|
drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state,
|
||||||
@@ -1961,8 +1967,8 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
|
|||||||
* contains the old state. Also do any other cleanup required with that state.
|
* contains the old state. Also do any other cleanup required with that state.
|
||||||
*
|
*
|
||||||
* @stall must be set when nonblocking commits for this driver directly access
|
* @stall must be set when nonblocking commits for this driver directly access
|
||||||
* the ->state pointer of &drm_plane, &drm_crtc or &drm_connector. With the
|
* the &drm_plane.state, &drm_crtc.state or &drm_connector.state pointer. With
|
||||||
* current atomic helpers this is almost always the case, since the helpers
|
* the current atomic helpers this is almost always the case, since the helpers
|
||||||
* don't pass the right state structures to the callbacks.
|
* don't pass the right state structures to the callbacks.
|
||||||
*/
|
*/
|
||||||
void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
|
void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
|
||||||
@@ -2363,7 +2369,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
|
drm_mode_get_hv_timing(set->mode, &hdisplay, &vdisplay);
|
||||||
|
|
||||||
drm_atomic_set_fb_for_plane(primary_state, set->fb);
|
drm_atomic_set_fb_for_plane(primary_state, set->fb);
|
||||||
primary_state->crtc_x = 0;
|
primary_state->crtc_x = 0;
|
||||||
@@ -2892,8 +2898,8 @@ EXPORT_SYMBOL(drm_atomic_helper_page_flip_target);
|
|||||||
*
|
*
|
||||||
* This is the main helper function provided by the atomic helper framework for
|
* This is the main helper function provided by the atomic helper framework for
|
||||||
* implementing the legacy DPMS connector interface. It computes the new desired
|
* implementing the legacy DPMS connector interface. It computes the new desired
|
||||||
* ->active state for the corresponding CRTC (if the connector is enabled) and
|
* &drm_crtc_state.active state for the corresponding CRTC (if the connector is
|
||||||
* updates it.
|
* enabled) and updates it.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* Returns 0 on success, negative errno numbers on failure.
|
* Returns 0 on success, negative errno numbers on failure.
|
||||||
@@ -2965,11 +2971,11 @@ backoff:
|
|||||||
EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
|
EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_atomic_helper_best_encoder - Helper for &drm_connector_helper_funcs
|
* drm_atomic_helper_best_encoder - Helper for
|
||||||
* ->best_encoder callback
|
* &drm_connector_helper_funcs.best_encoder callback
|
||||||
* @connector: Connector control structure
|
* @connector: Connector control structure
|
||||||
*
|
*
|
||||||
* This is a &drm_connector_helper_funcs ->best_encoder callback helper for
|
* This is a &drm_connector_helper_funcs.best_encoder callback helper for
|
||||||
* connectors that support exactly 1 encoder, statically determined at driver
|
* connectors that support exactly 1 encoder, statically determined at driver
|
||||||
* init time.
|
* init time.
|
||||||
*/
|
*/
|
||||||
@@ -3003,7 +3009,7 @@ EXPORT_SYMBOL(drm_atomic_helper_best_encoder);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_atomic_helper_crtc_reset - default ->reset hook for CRTCs
|
* drm_atomic_helper_crtc_reset - default &drm_crtc_funcs.reset hook for CRTCs
|
||||||
* @crtc: drm CRTC
|
* @crtc: drm CRTC
|
||||||
*
|
*
|
||||||
* Resets the atomic state for @crtc by freeing the state pointer (which might
|
* Resets the atomic state for @crtc by freeing the state pointer (which might
|
||||||
@@ -3110,7 +3116,7 @@ void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
|
|||||||
EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
|
EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_atomic_helper_plane_reset - default ->reset hook for planes
|
* drm_atomic_helper_plane_reset - default &drm_plane_funcs.reset hook for planes
|
||||||
* @plane: drm plane
|
* @plane: drm plane
|
||||||
*
|
*
|
||||||
* Resets the atomic state for @plane by freeing the state pointer (which might
|
* Resets the atomic state for @plane by freeing the state pointer (which might
|
||||||
@@ -3214,8 +3220,9 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state);
|
|||||||
* @conn_state: connector state to assign
|
* @conn_state: connector state to assign
|
||||||
*
|
*
|
||||||
* Initializes the newly allocated @conn_state and assigns it to
|
* Initializes the newly allocated @conn_state and assigns it to
|
||||||
* #connector ->state, usually required when initializing the drivers
|
* the &drm_conector->state pointer of @connector, usually required when
|
||||||
* or when called from the ->reset hook.
|
* initializing the drivers or when called from the &drm_connector_funcs.reset
|
||||||
|
* hook.
|
||||||
*
|
*
|
||||||
* This is useful for drivers that subclass the connector state.
|
* This is useful for drivers that subclass the connector state.
|
||||||
*/
|
*/
|
||||||
@@ -3231,7 +3238,7 @@ __drm_atomic_helper_connector_reset(struct drm_connector *connector,
|
|||||||
EXPORT_SYMBOL(__drm_atomic_helper_connector_reset);
|
EXPORT_SYMBOL(__drm_atomic_helper_connector_reset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_atomic_helper_connector_reset - default ->reset hook for connectors
|
* drm_atomic_helper_connector_reset - default &drm_connector_funcs.reset hook for connectors
|
||||||
* @connector: drm connector
|
* @connector: drm connector
|
||||||
*
|
*
|
||||||
* Resets the atomic state for @connector by freeing the state pointer (which
|
* Resets the atomic state for @connector by freeing the state pointer (which
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
* least once successfully became the device master (either through the
|
* least once successfully became the device master (either through the
|
||||||
* SET_MASTER IOCTL, or implicitly through opening the primary device node when
|
* SET_MASTER IOCTL, or implicitly through opening the primary device node when
|
||||||
* no one else is the current master that time) there exists one &drm_master.
|
* no one else is the current master that time) there exists one &drm_master.
|
||||||
* This is noted in the is_master member of &drm_file. All other clients have
|
* This is noted in &drm_file.is_master. All other clients have just a pointer
|
||||||
* just a pointer to the &drm_master they are associated with.
|
* to the &drm_master they are associated with.
|
||||||
*
|
*
|
||||||
* In addition only one &drm_master can be the current master for a &drm_device.
|
* In addition only one &drm_master can be the current master for a &drm_device.
|
||||||
* It can be switched through the DROP_MASTER and SET_MASTER IOCTL, or
|
* It can be switched through the DROP_MASTER and SET_MASTER IOCTL, or
|
||||||
|
|||||||
@@ -40,9 +40,8 @@
|
|||||||
* sub-pixel accuracy, which is scaled up to a pixel-aligned destination
|
* sub-pixel accuracy, which is scaled up to a pixel-aligned destination
|
||||||
* rectangle in the visible area of a &drm_crtc. The visible area of a CRTC is
|
* rectangle in the visible area of a &drm_crtc. The visible area of a CRTC is
|
||||||
* defined by the horizontal and vertical visible pixels (stored in @hdisplay
|
* defined by the horizontal and vertical visible pixels (stored in @hdisplay
|
||||||
* and @vdisplay) of the requested mode (stored in @mode in the
|
* and @vdisplay) of the requested mode (stored in &drm_crtc_state.mode). These
|
||||||
* &drm_crtc_state). These two rectangles are both stored in the
|
* two rectangles are both stored in the &drm_plane_state.
|
||||||
* &drm_plane_state.
|
|
||||||
*
|
*
|
||||||
* For the atomic ioctl the following standard (atomic) properties on the plane object
|
* For the atomic ioctl the following standard (atomic) properties on the plane object
|
||||||
* encode the basic plane composition model:
|
* encode the basic plane composition model:
|
||||||
@@ -215,7 +214,7 @@ EXPORT_SYMBOL(drm_rotation_simplify);
|
|||||||
* for it in drm core. Drivers can then attach this property to planes to enable
|
* for it in drm core. Drivers can then attach this property to planes to enable
|
||||||
* support for configurable planes arrangement during blending operation.
|
* support for configurable planes arrangement during blending operation.
|
||||||
* Once mutable zpos property has been enabled, the DRM core will automatically
|
* Once mutable zpos property has been enabled, the DRM core will automatically
|
||||||
* calculate drm_plane_state->normalized_zpos values. Usually min should be set
|
* calculate &drm_plane_state.normalized_zpos values. Usually min should be set
|
||||||
* to 0 and max to maximal number of planes for given crtc - 1.
|
* to 0 and max to maximal number of planes for given crtc - 1.
|
||||||
*
|
*
|
||||||
* If zpos of some planes cannot be changed (like fixed background or
|
* If zpos of some planes cannot be changed (like fixed background or
|
||||||
@@ -367,8 +366,8 @@ done:
|
|||||||
* For every CRTC this function checks new states of all planes assigned to
|
* For every CRTC this function checks new states of all planes assigned to
|
||||||
* it and calculates normalized zpos value for these planes. Planes are compared
|
* it and calculates normalized zpos value for these planes. Planes are compared
|
||||||
* first by their zpos values, then by plane id (if zpos is equal). The plane
|
* first by their zpos values, then by plane id (if zpos is equal). The plane
|
||||||
* with lowest zpos value is at the bottom. The plane_state->normalized_zpos is
|
* with lowest zpos value is at the bottom. The &drm_plane_state.normalized_zpos
|
||||||
* then filled with unique values from 0 to number of active planes in crtc
|
* is then filled with unique values from 0 to number of active planes in crtc
|
||||||
* minus one.
|
* minus one.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
|
|||||||
@@ -29,7 +29,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/export.h>
|
#include <linux/export.h>
|
||||||
#include <drm/drmP.h>
|
#include <linux/highmem.h>
|
||||||
|
|
||||||
|
#include <drm/drm_cache.h>
|
||||||
|
|
||||||
#if defined(CONFIG_X86)
|
#if defined(CONFIG_X86)
|
||||||
#include <asm/smp.h>
|
#include <asm/smp.h>
|
||||||
|
|||||||
@@ -38,18 +38,17 @@
|
|||||||
* Hence they are reference-counted using drm_connector_reference() and
|
* Hence they are reference-counted using drm_connector_reference() and
|
||||||
* drm_connector_unreference().
|
* drm_connector_unreference().
|
||||||
*
|
*
|
||||||
* KMS driver must create, initialize, register and attach at a struct
|
* KMS driver must create, initialize, register and attach at a &struct
|
||||||
* &drm_connector for each such sink. The instance is created as other KMS
|
* drm_connector for each such sink. The instance is created as other KMS
|
||||||
* objects and initialized by setting the following fields.
|
* objects and initialized by setting the following fields. The connector is
|
||||||
*
|
* initialized with a call to drm_connector_init() with a pointer to the
|
||||||
* The connector is then registered with a call to drm_connector_init() with a
|
* &struct drm_connector_funcs and a connector type, and then exposed to
|
||||||
* pointer to the connector functions and a connector type, and exposed through
|
* userspace with a call to drm_connector_register().
|
||||||
* sysfs with a call to drm_connector_register().
|
|
||||||
*
|
*
|
||||||
* Connectors must be attached to an encoder to be used. For devices that map
|
* Connectors must be attached to an encoder to be used. For devices that map
|
||||||
* connectors to encoders 1:1, the connector should be attached at
|
* connectors to encoders 1:1, the connector should be attached at
|
||||||
* initialization time with a call to drm_mode_connector_attach_encoder(). The
|
* initialization time with a call to drm_mode_connector_attach_encoder(). The
|
||||||
* driver must also set the &struct drm_connector encoder field to point to the
|
* driver must also set the &drm_connector.encoder field to point to the
|
||||||
* attached encoder.
|
* attached encoder.
|
||||||
*
|
*
|
||||||
* For connectors which are not fixed (like built-in panels) the driver needs to
|
* For connectors which are not fixed (like built-in panels) the driver needs to
|
||||||
@@ -497,7 +496,7 @@ static struct lockdep_map connector_list_iter_dep_map = {
|
|||||||
* @dev: DRM device
|
* @dev: DRM device
|
||||||
* @iter: connector_list iterator
|
* @iter: connector_list iterator
|
||||||
*
|
*
|
||||||
* Sets @iter up to walk the connector list in &drm_mode_config of @dev. @iter
|
* Sets @iter up to walk the &drm_mode_config.connector_list of @dev. @iter
|
||||||
* must always be cleaned up again by calling drm_connector_list_iter_put().
|
* must always be cleaned up again by calling drm_connector_list_iter_put().
|
||||||
* Iteration itself happens using drm_connector_list_iter_next() or
|
* Iteration itself happens using drm_connector_list_iter_next() or
|
||||||
* drm_for_each_connector_iter().
|
* drm_for_each_connector_iter().
|
||||||
@@ -696,8 +695,8 @@ DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
|
|||||||
* drivers this is only provided for backwards compatibility with existing
|
* drivers this is only provided for backwards compatibility with existing
|
||||||
* drivers, it remaps to controlling the "ACTIVE" property on the CRTC the
|
* drivers, it remaps to controlling the "ACTIVE" property on the CRTC the
|
||||||
* connector is linked to. Drivers should never set this property directly,
|
* connector is linked to. Drivers should never set this property directly,
|
||||||
* it is handled by the DRM core by calling the ->dpms() callback in
|
* it is handled by the DRM core by calling the &drm_connector_funcs.dpms
|
||||||
* &drm_connector_funcs. Atomic drivers should implement this hook using
|
* callback. Atomic drivers should implement this hook using
|
||||||
* drm_atomic_helper_connector_dpms(). This is the only property standard
|
* drm_atomic_helper_connector_dpms(). This is the only property standard
|
||||||
* connector property that userspace can change.
|
* connector property that userspace can change.
|
||||||
* PATH:
|
* PATH:
|
||||||
|
|||||||
@@ -46,6 +46,27 @@
|
|||||||
#include "drm_crtc_internal.h"
|
#include "drm_crtc_internal.h"
|
||||||
#include "drm_internal.h"
|
#include "drm_internal.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOC: overview
|
||||||
|
*
|
||||||
|
* A CRTC represents the overall display pipeline. It receives pixel data from
|
||||||
|
* &drm_plane and blends them together. The &drm_display_mode is also attached
|
||||||
|
* to the CRTC, specifying display timings. On the output side the data is fed
|
||||||
|
* to one or more &drm_encoder, which are then each connected to one
|
||||||
|
* &drm_connector.
|
||||||
|
*
|
||||||
|
* To create a CRTC, a KMS drivers allocates and zeroes an instances of
|
||||||
|
* &struct drm_crtc (possibly as part of a larger structure) and registers it
|
||||||
|
* with a call to drm_crtc_init_with_planes().
|
||||||
|
*
|
||||||
|
* The CRTC is also the entry point for legacy modeset operations, see
|
||||||
|
* &drm_crtc_funcs.set_config, legacy plane operations, see
|
||||||
|
* &drm_crtc_funcs.page_flip and &drm_crtc_funcs.cursor_set2, and other legacy
|
||||||
|
* operations like &drm_crtc_funcs.gamma_set. For atomic drivers all these
|
||||||
|
* features are controlled through &drm_property and
|
||||||
|
* &drm_mode_config_funcs.atomic_check and &drm_mode_config_funcs.atomic_check.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_crtc_from_index - find the registered CRTC at an index
|
* drm_crtc_from_index - find the registered CRTC at an index
|
||||||
* @dev: DRM device
|
* @dev: DRM device
|
||||||
@@ -415,11 +436,12 @@ int drm_mode_getcrtc(struct drm_device *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_mode_set_config_internal - helper to call ->set_config
|
* drm_mode_set_config_internal - helper to call &drm_mode_config_funcs.set_config
|
||||||
* @set: modeset config to set
|
* @set: modeset config to set
|
||||||
*
|
*
|
||||||
* This is a little helper to wrap internal calls to the ->set_config driver
|
* This is a little helper to wrap internal calls to the
|
||||||
* interface. The only thing it adds is correct refcounting dance.
|
* &drm_mode_config_funcs.set_config driver interface. The only thing it adds is
|
||||||
|
* correct refcounting dance.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* Zero on success, negative errno on failure.
|
* Zero on success, negative errno on failure.
|
||||||
@@ -459,27 +481,6 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_mode_set_config_internal);
|
EXPORT_SYMBOL(drm_mode_set_config_internal);
|
||||||
|
|
||||||
/**
|
|
||||||
* drm_crtc_get_hv_timing - Fetches hdisplay/vdisplay for given mode
|
|
||||||
* @mode: mode to query
|
|
||||||
* @hdisplay: hdisplay value to fill in
|
|
||||||
* @vdisplay: vdisplay value to fill in
|
|
||||||
*
|
|
||||||
* The vdisplay value will be doubled if the specified mode is a stereo mode of
|
|
||||||
* the appropriate layout.
|
|
||||||
*/
|
|
||||||
void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
|
|
||||||
int *hdisplay, int *vdisplay)
|
|
||||||
{
|
|
||||||
struct drm_display_mode adjusted;
|
|
||||||
|
|
||||||
drm_mode_copy(&adjusted, mode);
|
|
||||||
drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
|
|
||||||
*hdisplay = adjusted.crtc_hdisplay;
|
|
||||||
*vdisplay = adjusted.crtc_vdisplay;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(drm_crtc_get_hv_timing);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_crtc_check_viewport - Checks that a framebuffer is big enough for the
|
* drm_crtc_check_viewport - Checks that a framebuffer is big enough for the
|
||||||
* CRTC viewport
|
* CRTC viewport
|
||||||
@@ -497,7 +498,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
|
|||||||
{
|
{
|
||||||
int hdisplay, vdisplay;
|
int hdisplay, vdisplay;
|
||||||
|
|
||||||
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
|
drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
|
||||||
|
|
||||||
if (crtc->state &&
|
if (crtc->state &&
|
||||||
drm_rotation_90_or_270(crtc->primary->state->rotation))
|
drm_rotation_90_or_270(crtc->primary->state->rotation))
|
||||||
|
|||||||
@@ -53,9 +53,9 @@
|
|||||||
* configuration on resume with drm_helper_resume_force_mode().
|
* configuration on resume with drm_helper_resume_force_mode().
|
||||||
*
|
*
|
||||||
* Note that this helper library doesn't track the current power state of CRTCs
|
* Note that this helper library doesn't track the current power state of CRTCs
|
||||||
* and encoders. It can call callbacks like ->dpms() even though the hardware is
|
* and encoders. It can call callbacks like &drm_encoder_helper_funcs.dpms even
|
||||||
* already in the desired state. This deficiency has been fixed in the atomic
|
* though the hardware is already in the desired state. This deficiency has been
|
||||||
* helpers.
|
* fixed in the atomic helpers.
|
||||||
*
|
*
|
||||||
* The driver callbacks are mostly compatible with the atomic modeset helpers,
|
* The driver callbacks are mostly compatible with the atomic modeset helpers,
|
||||||
* except for the handling of the primary plane: Atomic helpers require that the
|
* except for the handling of the primary plane: Atomic helpers require that the
|
||||||
@@ -477,12 +477,12 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
|
|||||||
* drm_crtc_helper_set_config - set a new config from userspace
|
* drm_crtc_helper_set_config - set a new config from userspace
|
||||||
* @set: mode set configuration
|
* @set: mode set configuration
|
||||||
*
|
*
|
||||||
* The drm_crtc_helper_set_config() helper function implements the set_config
|
* The drm_crtc_helper_set_config() helper function implements the of
|
||||||
* callback of &struct drm_crtc_funcs for drivers using the legacy CRTC helpers.
|
* &drm_crtc_funcs.set_config callback for drivers using the legacy CRTC
|
||||||
|
* helpers.
|
||||||
*
|
*
|
||||||
* It first tries to locate the best encoder for each connector by calling the
|
* It first tries to locate the best encoder for each connector by calling the
|
||||||
* connector ->best_encoder() (&struct drm_connector_helper_funcs) helper
|
* connector @drm_connector_helper_funcs.best_encoder helper operation.
|
||||||
* operation.
|
|
||||||
*
|
*
|
||||||
* After locating the appropriate encoders, the helper function will call the
|
* After locating the appropriate encoders, the helper function will call the
|
||||||
* mode_fixup encoder and CRTC helper operations to adjust the requested mode,
|
* mode_fixup encoder and CRTC helper operations to adjust the requested mode,
|
||||||
@@ -493,8 +493,7 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
|
|||||||
*
|
*
|
||||||
* If the adjusted mode is identical to the current mode but changes to the
|
* If the adjusted mode is identical to the current mode but changes to the
|
||||||
* frame buffer need to be applied, the drm_crtc_helper_set_config() function
|
* frame buffer need to be applied, the drm_crtc_helper_set_config() function
|
||||||
* will call the CRTC ->mode_set_base() (&struct drm_crtc_helper_funcs) helper
|
* will call the CRTC &drm_crtc_helper_funcs.mode_set_base helper operation.
|
||||||
* operation.
|
|
||||||
*
|
*
|
||||||
* If the adjusted mode differs from the current mode, or if the
|
* If the adjusted mode differs from the current mode, or if the
|
||||||
* ->mode_set_base() helper operation is not provided, the helper function
|
* ->mode_set_base() helper operation is not provided, the helper function
|
||||||
@@ -851,14 +850,15 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
|
|||||||
* @connector: affected connector
|
* @connector: affected connector
|
||||||
* @mode: DPMS mode
|
* @mode: DPMS mode
|
||||||
*
|
*
|
||||||
* The drm_helper_connector_dpms() helper function implements the ->dpms()
|
* The drm_helper_connector_dpms() helper function implements the
|
||||||
* callback of &struct drm_connector_funcs for drivers using the legacy CRTC helpers.
|
* &drm_connector_funcs.dpms callback for drivers using the legacy CRTC
|
||||||
|
* helpers.
|
||||||
*
|
*
|
||||||
* This is the main helper function provided by the CRTC helper framework for
|
* This is the main helper function provided by the CRTC helper framework for
|
||||||
* implementing the DPMS connector attribute. It computes the new desired DPMS
|
* implementing the DPMS connector attribute. It computes the new desired DPMS
|
||||||
* state for all encoders and CRTCs in the output mesh and calls the ->dpms()
|
* state for all encoders and CRTCs in the output mesh and calls the
|
||||||
* callbacks provided by the driver in &struct drm_crtc_helper_funcs and struct
|
* &drm_crtc_helper_funcs.dpms and &drm_encoder_helper_funcs.dpms callbacks
|
||||||
* &drm_encoder_helper_funcs appropriately.
|
* provided by the driver.
|
||||||
*
|
*
|
||||||
* This function is deprecated. New drivers must implement atomic modeset
|
* This function is deprecated. New drivers must implement atomic modeset
|
||||||
* support, for which this function is unsuitable. Instead drivers should use
|
* support, for which this function is unsuitable. Instead drivers should use
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
|
|||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
struct drm_minor;
|
struct drm_minor;
|
||||||
int drm_atomic_debugfs_init(struct drm_minor *minor);
|
int drm_atomic_debugfs_init(struct drm_minor *minor);
|
||||||
int drm_atomic_debugfs_cleanup(struct drm_minor *minor);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int drm_atomic_get_property(struct drm_mode_object *obj,
|
int drm_atomic_get_property(struct drm_mode_object *obj,
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ static const struct file_operations drm_debugfs_fops = {
|
|||||||
* \return Zero on success, non-zero on failure
|
* \return Zero on success, non-zero on failure
|
||||||
*
|
*
|
||||||
* Create a given set of debugfs files represented by an array of
|
* Create a given set of debugfs files represented by an array of
|
||||||
* gdm_debugfs_lists in the given root directory.
|
* &drm_info_list in the given root directory. These files will be removed
|
||||||
|
* automatically on drm_debugfs_cleanup().
|
||||||
*/
|
*/
|
||||||
int drm_debugfs_create_files(const struct drm_info_list *files, int count,
|
int drm_debugfs_create_files(const struct drm_info_list *files, int count,
|
||||||
struct dentry *root, struct drm_minor *minor)
|
struct dentry *root, struct drm_minor *minor)
|
||||||
@@ -218,6 +219,19 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_debugfs_remove_files);
|
EXPORT_SYMBOL(drm_debugfs_remove_files);
|
||||||
|
|
||||||
|
static void drm_debugfs_remove_all_files(struct drm_minor *minor)
|
||||||
|
{
|
||||||
|
struct drm_info_node *node, *tmp;
|
||||||
|
|
||||||
|
mutex_lock(&minor->debugfs_lock);
|
||||||
|
list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
|
||||||
|
debugfs_remove(node->dent);
|
||||||
|
list_del(&node->list);
|
||||||
|
kfree(node);
|
||||||
|
}
|
||||||
|
mutex_unlock(&minor->debugfs_lock);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleanup the debugfs filesystem resources.
|
* Cleanup the debugfs filesystem resources.
|
||||||
*
|
*
|
||||||
@@ -229,7 +243,6 @@ EXPORT_SYMBOL(drm_debugfs_remove_files);
|
|||||||
int drm_debugfs_cleanup(struct drm_minor *minor)
|
int drm_debugfs_cleanup(struct drm_minor *minor)
|
||||||
{
|
{
|
||||||
struct drm_device *dev = minor->dev;
|
struct drm_device *dev = minor->dev;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!minor->debugfs_root)
|
if (!minor->debugfs_root)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -237,17 +250,9 @@ int drm_debugfs_cleanup(struct drm_minor *minor)
|
|||||||
if (dev->driver->debugfs_cleanup)
|
if (dev->driver->debugfs_cleanup)
|
||||||
dev->driver->debugfs_cleanup(minor);
|
dev->driver->debugfs_cleanup(minor);
|
||||||
|
|
||||||
if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
|
drm_debugfs_remove_all_files(minor);
|
||||||
ret = drm_atomic_debugfs_cleanup(minor);
|
|
||||||
if (ret) {
|
|
||||||
DRM_ERROR("DRM: Failed to remove atomic debugfs entries\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor);
|
debugfs_remove_recursive(minor->debugfs_root);
|
||||||
|
|
||||||
debugfs_remove(minor->debugfs_root);
|
|
||||||
minor->debugfs_root = NULL;
|
minor->debugfs_root = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -725,7 +725,7 @@ MODULE_PARM_DESC(dp_aux_i2c_speed_khz,
|
|||||||
/*
|
/*
|
||||||
* Transfer a single I2C-over-AUX message and handle various error conditions,
|
* Transfer a single I2C-over-AUX message and handle various error conditions,
|
||||||
* retrying the transaction as appropriate. It is assumed that the
|
* retrying the transaction as appropriate. It is assumed that the
|
||||||
* aux->transfer function does not modify anything in the msg other than the
|
* &drm_dp_aux.transfer function does not modify anything in the msg other than the
|
||||||
* reply field.
|
* reply field.
|
||||||
*
|
*
|
||||||
* Returns bytes transferred on success, or a negative error code on failure.
|
* Returns bytes transferred on success, or a negative error code on failure.
|
||||||
|
|||||||
@@ -1086,7 +1086,7 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
|
static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
|
||||||
struct device *dev,
|
struct drm_device *dev,
|
||||||
struct drm_dp_link_addr_reply_port *port_msg)
|
struct drm_dp_link_addr_reply_port *port_msg)
|
||||||
{
|
{
|
||||||
struct drm_dp_mst_port *port;
|
struct drm_dp_mst_port *port;
|
||||||
@@ -1104,7 +1104,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
|
|||||||
port->port_num = port_msg->port_number;
|
port->port_num = port_msg->port_number;
|
||||||
port->mgr = mstb->mgr;
|
port->mgr = mstb->mgr;
|
||||||
port->aux.name = "DPMST";
|
port->aux.name = "DPMST";
|
||||||
port->aux.dev = dev;
|
port->aux.dev = dev->dev;
|
||||||
created = true;
|
created = true;
|
||||||
} else {
|
} else {
|
||||||
old_pdt = port->pdt;
|
old_pdt = port->pdt;
|
||||||
@@ -2949,7 +2949,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work)
|
|||||||
* Return 0 for success, or negative error code on failure
|
* Return 0 for success, or negative error code on failure
|
||||||
*/
|
*/
|
||||||
int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
|
int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
|
||||||
struct device *dev, struct drm_dp_aux *aux,
|
struct drm_device *dev, struct drm_dp_aux *aux,
|
||||||
int max_dpcd_transaction_bytes,
|
int max_dpcd_transaction_bytes,
|
||||||
int max_payloads, int conn_base_id)
|
int max_payloads, int conn_base_id)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
|
|||||||
ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
|
ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
|
DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
|
||||||
return ret;
|
goto err_debugfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = device_add(minor->kdev);
|
ret = device_add(minor->kdev);
|
||||||
@@ -309,7 +309,7 @@ void drm_minor_release(struct drm_minor *minor)
|
|||||||
* userspace the device instance can be published using drm_dev_register().
|
* userspace the device instance can be published using drm_dev_register().
|
||||||
*
|
*
|
||||||
* There is also deprecated support for initalizing device instances using
|
* There is also deprecated support for initalizing device instances using
|
||||||
* bus-specific helpers and the ->load() callback. But due to
|
* bus-specific helpers and the &drm_driver.load callback. But due to
|
||||||
* backwards-compatibility needs the device instance have to be published too
|
* backwards-compatibility needs the device instance have to be published too
|
||||||
* early, which requires unpretty global locking to make safe and is therefore
|
* early, which requires unpretty global locking to make safe and is therefore
|
||||||
* only support for existing drivers not yet converted to the new scheme.
|
* only support for existing drivers not yet converted to the new scheme.
|
||||||
@@ -720,9 +720,9 @@ static void remove_compat_control_link(struct drm_device *dev)
|
|||||||
* Never call this twice on any device!
|
* Never call this twice on any device!
|
||||||
*
|
*
|
||||||
* NOTE: To ensure backward compatibility with existing drivers method this
|
* NOTE: To ensure backward compatibility with existing drivers method this
|
||||||
* function calls the ->load() method after registering the device nodes,
|
* function calls the &drm_driver.load method after registering the device
|
||||||
* creating race conditions. Usage of the ->load() methods is therefore
|
* nodes, creating race conditions. Usage of the &drm_driver.load methods is
|
||||||
* deprecated, drivers must perform all initialization before calling
|
* therefore deprecated, drivers must perform all initialization before calling
|
||||||
* drm_dev_register().
|
* drm_dev_register().
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
* create dumb buffers suitable for scanout, which can then be used to create
|
* create dumb buffers suitable for scanout, which can then be used to create
|
||||||
* KMS frame buffers.
|
* KMS frame buffers.
|
||||||
*
|
*
|
||||||
* To support dumb objects drivers must implement the dumb_create,
|
* To support dumb objects drivers must implement the &drm_driver.dumb_create,
|
||||||
* dumb_destroy and dumb_map_offset operations from &struct drm_driver. See
|
* &drm_driver.dumb_destroy and &drm_driver.dumb_map_offset operations. See
|
||||||
* there for further details.
|
* there for further details.
|
||||||
*
|
*
|
||||||
* Note that dumb objects may not be used for gpu acceleration, as has been
|
* Note that dumb objects may not be used for gpu acceleration, as has been
|
||||||
|
|||||||
@@ -3768,6 +3768,25 @@ bool drm_rgb_quant_range_selectable(struct edid *edid)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
|
EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_default_rgb_quant_range - default RGB quantization range
|
||||||
|
* @mode: display mode
|
||||||
|
*
|
||||||
|
* Determine the default RGB quantization range for the mode,
|
||||||
|
* as specified in CEA-861.
|
||||||
|
*
|
||||||
|
* Return: The default RGB quantization range for the mode
|
||||||
|
*/
|
||||||
|
enum hdmi_quantization_range
|
||||||
|
drm_default_rgb_quant_range(const struct drm_display_mode *mode)
|
||||||
|
{
|
||||||
|
/* All CEA modes other than VIC 1 use limited quantization range. */
|
||||||
|
return drm_match_cea_mode(mode) > 1 ?
|
||||||
|
HDMI_QUANTIZATION_RANGE_LIMITED :
|
||||||
|
HDMI_QUANTIZATION_RANGE_FULL;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_default_rgb_quant_range);
|
||||||
|
|
||||||
static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
|
static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
|
||||||
const u8 *hdmi)
|
const u8 *hdmi)
|
||||||
{
|
{
|
||||||
@@ -4273,6 +4292,52 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
|
||||||
|
* quantization range information
|
||||||
|
* @frame: HDMI AVI infoframe
|
||||||
|
* @mode: DRM display mode
|
||||||
|
* @rgb_quant_range: RGB quantization range (Q)
|
||||||
|
* @rgb_quant_range_selectable: Sink support selectable RGB quantization range (QS)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
|
||||||
|
const struct drm_display_mode *mode,
|
||||||
|
enum hdmi_quantization_range rgb_quant_range,
|
||||||
|
bool rgb_quant_range_selectable)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* CEA-861:
|
||||||
|
* "A Source shall not send a non-zero Q value that does not correspond
|
||||||
|
* to the default RGB Quantization Range for the transmitted Picture
|
||||||
|
* unless the Sink indicates support for the Q bit in a Video
|
||||||
|
* Capabilities Data Block."
|
||||||
|
*
|
||||||
|
* HDMI 2.0 recommends sending non-zero Q when it does match the
|
||||||
|
* default RGB quantization range for the mode, even when QS=0.
|
||||||
|
*/
|
||||||
|
if (rgb_quant_range_selectable ||
|
||||||
|
rgb_quant_range == drm_default_rgb_quant_range(mode))
|
||||||
|
frame->quantization_range = rgb_quant_range;
|
||||||
|
else
|
||||||
|
frame->quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CEA-861-F:
|
||||||
|
* "When transmitting any RGB colorimetry, the Source should set the
|
||||||
|
* YQ-field to match the RGB Quantization Range being transmitted
|
||||||
|
* (e.g., when Limited Range RGB, set YQ=0 or when Full Range RGB,
|
||||||
|
* set YQ=1) and the Sink shall ignore the YQ-field."
|
||||||
|
*/
|
||||||
|
if (rgb_quant_range == HDMI_QUANTIZATION_RANGE_LIMITED)
|
||||||
|
frame->ycc_quantization_range =
|
||||||
|
HDMI_YCC_QUANTIZATION_RANGE_LIMITED;
|
||||||
|
else
|
||||||
|
frame->ycc_quantization_range =
|
||||||
|
HDMI_YCC_QUANTIZATION_RANGE_FULL;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_quant_range);
|
||||||
|
|
||||||
static enum hdmi_3d_structure
|
static enum hdmi_3d_structure
|
||||||
s3d_structure_from_display_mode(const struct drm_display_mode *mode)
|
s3d_structure_from_display_mode(const struct drm_display_mode *mode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ void drm_encoder_unregister_all(struct drm_device *dev)
|
|||||||
*
|
*
|
||||||
* Initialises a preallocated encoder. Encoder should be subclassed as part of
|
* Initialises a preallocated encoder. Encoder should be subclassed as part of
|
||||||
* driver encoder objects. At driver unload time drm_encoder_cleanup() should be
|
* driver encoder objects. At driver unload time drm_encoder_cleanup() should be
|
||||||
* called from the driver's destroy hook in &drm_encoder_funcs.
|
* called from the driver's &drm_encoder_funcs.destroy hook.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* Zero on success, error code on failure.
|
* Zero on success, error code on failure.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
* &drm_encoder_slave. The @slave_funcs field will be initialized with
|
* &drm_encoder_slave. The @slave_funcs field will be initialized with
|
||||||
* the hooks provided by the slave driver.
|
* the hooks provided by the slave driver.
|
||||||
*
|
*
|
||||||
* If @info->platform_data is non-NULL it will be used as the initial
|
* If @info.platform_data is non-NULL it will be used as the initial
|
||||||
* slave config.
|
* slave config.
|
||||||
*
|
*
|
||||||
* Returns 0 on success or a negative errno on failure, in particular,
|
* Returns 0 on success or a negative errno on failure, in particular,
|
||||||
|
|||||||
@@ -622,3 +622,21 @@ void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state)
|
|||||||
drm_fb_helper_set_suspend(&fbdev_cma->fb_helper, state);
|
drm_fb_helper_set_suspend(&fbdev_cma->fb_helper, state);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_fbdev_cma_set_suspend);
|
EXPORT_SYMBOL(drm_fbdev_cma_set_suspend);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_fbdev_cma_set_suspend_unlocked - wrapper around
|
||||||
|
* drm_fb_helper_set_suspend_unlocked
|
||||||
|
* @fbdev_cma: The drm_fbdev_cma struct, may be NULL
|
||||||
|
* @state: desired state, zero to resume, non-zero to suspend
|
||||||
|
*
|
||||||
|
* Calls drm_fb_helper_set_suspend, which is a wrapper around
|
||||||
|
* fb_set_suspend implemented by fbdev core.
|
||||||
|
*/
|
||||||
|
void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
|
||||||
|
int state)
|
||||||
|
{
|
||||||
|
if (fbdev_cma)
|
||||||
|
drm_fb_helper_set_suspend_unlocked(&fbdev_cma->fb_helper,
|
||||||
|
state);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_fbdev_cma_set_suspend_unlocked);
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ static DEFINE_MUTEX(kernel_fb_helper_lock);
|
|||||||
* Teardown is done with drm_fb_helper_fini().
|
* Teardown is done with drm_fb_helper_fini().
|
||||||
*
|
*
|
||||||
* At runtime drivers should restore the fbdev console by calling
|
* At runtime drivers should restore the fbdev console by calling
|
||||||
* drm_fb_helper_restore_fbdev_mode_unlocked() from their ->lastclose callback.
|
* drm_fb_helper_restore_fbdev_mode_unlocked() from their &drm_driver.lastclose
|
||||||
* They should also notify the fb helper code from updates to the output
|
* callback. They should also notify the fb helper code from updates to the
|
||||||
* configuration by calling drm_fb_helper_hotplug_event(). For easier
|
* output configuration by calling drm_fb_helper_hotplug_event(). For easier
|
||||||
* integration with the output polling code in drm_crtc_helper.c the modeset
|
* integration with the output polling code in drm_crtc_helper.c the modeset
|
||||||
* code provides a ->output_poll_changed callback.
|
* code provides a &drm_mode_config_funcs.output_poll_changed callback.
|
||||||
*
|
*
|
||||||
* All other functions exported by the fb helper library can be used to
|
* All other functions exported by the fb helper library can be used to
|
||||||
* implement the fbdev driver interface by the driver.
|
* implement the fbdev driver interface by the driver.
|
||||||
@@ -79,7 +79,7 @@ static DEFINE_MUTEX(kernel_fb_helper_lock);
|
|||||||
* hotplug detection using the fbdev helpers. The drm_fb_helper_prepare()
|
* hotplug detection using the fbdev helpers. The drm_fb_helper_prepare()
|
||||||
* helper must be called first to initialize the minimum required to make
|
* helper must be called first to initialize the minimum required to make
|
||||||
* hotplug detection work. Drivers also need to make sure to properly set up
|
* hotplug detection work. Drivers also need to make sure to properly set up
|
||||||
* the dev->mode_config.funcs member. After calling drm_kms_helper_poll_init()
|
* the &drm_mode_config.funcs member. After calling drm_kms_helper_poll_init()
|
||||||
* it is safe to enable interrupts and start processing hotplug events. At the
|
* it is safe to enable interrupts and start processing hotplug events. At the
|
||||||
* same time, drivers should initialize all modeset objects such as CRTCs,
|
* same time, drivers should initialize all modeset objects such as CRTCs,
|
||||||
* encoders and connectors. To finish up the fbdev helper initialization, the
|
* encoders and connectors. To finish up the fbdev helper initialization, the
|
||||||
@@ -88,9 +88,9 @@ static DEFINE_MUTEX(kernel_fb_helper_lock);
|
|||||||
* should call drm_fb_helper_single_add_all_connectors() followed by
|
* should call drm_fb_helper_single_add_all_connectors() followed by
|
||||||
* drm_fb_helper_initial_config().
|
* drm_fb_helper_initial_config().
|
||||||
*
|
*
|
||||||
* If &drm_framebuffer_funcs ->dirty is set, the
|
* If &drm_framebuffer_funcs.dirty is set, the
|
||||||
* drm_fb_helper_{cfb,sys}_{write,fillrect,copyarea,imageblit} functions will
|
* drm_fb_helper_{cfb,sys}_{write,fillrect,copyarea,imageblit} functions will
|
||||||
* accumulate changes and schedule &drm_fb_helper ->dirty_work to run right
|
* accumulate changes and schedule &drm_fb_helper.dirty_work to run right
|
||||||
* away. This worker then calls the dirty() function ensuring that it will
|
* away. This worker then calls the dirty() function ensuring that it will
|
||||||
* always run in process context since the fb_*() function could be running in
|
* always run in process context since the fb_*() function could be running in
|
||||||
* atomic context. If drm_fb_helper_deferred_io() is used as the deferred_io
|
* atomic context. If drm_fb_helper_deferred_io() is used as the deferred_io
|
||||||
@@ -247,7 +247,7 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_debug_enter - implementation for ->fb_debug_enter
|
* drm_fb_helper_debug_enter - implementation for &fb_ops.fb_debug_enter
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*/
|
*/
|
||||||
int drm_fb_helper_debug_enter(struct fb_info *info)
|
int drm_fb_helper_debug_enter(struct fb_info *info)
|
||||||
@@ -296,7 +296,7 @@ static struct drm_framebuffer *drm_mode_config_fb(struct drm_crtc *crtc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_debug_leave - implementation for ->fb_debug_leave
|
* drm_fb_helper_debug_leave - implementation for &fb_ops.fb_debug_leave
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*/
|
*/
|
||||||
int drm_fb_helper_debug_leave(struct fb_info *info)
|
int drm_fb_helper_debug_leave(struct fb_info *info)
|
||||||
@@ -445,7 +445,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)
|
|||||||
* drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration
|
* drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration
|
||||||
* @fb_helper: fbcon to restore
|
* @fb_helper: fbcon to restore
|
||||||
*
|
*
|
||||||
* This should be called from driver's drm ->lastclose callback
|
* This should be called from driver's drm &drm_driver.lastclose callback
|
||||||
* when implementing an fbcon on top of kms using this helper. This ensures that
|
* when implementing an fbcon on top of kms using this helper. This ensures that
|
||||||
* the user isn't greeted with a black screen when e.g. X dies.
|
* the user isn't greeted with a black screen when e.g. X dies.
|
||||||
*
|
*
|
||||||
@@ -585,7 +585,7 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_blank - implementation for ->fb_blank
|
* drm_fb_helper_blank - implementation for &fb_ops.fb_blank
|
||||||
* @blank: desired blanking state
|
* @blank: desired blanking state
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*/
|
*/
|
||||||
@@ -912,7 +912,7 @@ static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y,
|
|||||||
* @info: fb_info struct pointer
|
* @info: fb_info struct pointer
|
||||||
* @pagelist: list of dirty mmap framebuffer pages
|
* @pagelist: list of dirty mmap framebuffer pages
|
||||||
*
|
*
|
||||||
* This function is used as the &fb_deferred_io ->deferred_io
|
* This function is used as the &fb_deferred_io.deferred_io
|
||||||
* callback function for flushing the fbdev mmap writes.
|
* callback function for flushing the fbdev mmap writes.
|
||||||
*/
|
*/
|
||||||
void drm_fb_helper_deferred_io(struct fb_info *info,
|
void drm_fb_helper_deferred_io(struct fb_info *info,
|
||||||
@@ -1103,7 +1103,7 @@ EXPORT_SYMBOL(drm_fb_helper_set_suspend);
|
|||||||
* due to all the printk activity.
|
* due to all the printk activity.
|
||||||
*
|
*
|
||||||
* This function can be called multiple times with the same state since
|
* This function can be called multiple times with the same state since
|
||||||
* &fb_info->state is checked to see if fbdev is running or not before locking.
|
* &fb_info.state is checked to see if fbdev is running or not before locking.
|
||||||
*
|
*
|
||||||
* Use drm_fb_helper_set_suspend() if you need to take the lock yourself.
|
* Use drm_fb_helper_set_suspend() if you need to take the lock yourself.
|
||||||
*/
|
*/
|
||||||
@@ -1181,7 +1181,7 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_setcmap - implementation for ->fb_setcmap
|
* drm_fb_helper_setcmap - implementation for &fb_ops.fb_setcmap
|
||||||
* @cmap: cmap to set
|
* @cmap: cmap to set
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*/
|
*/
|
||||||
@@ -1238,7 +1238,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
|
|||||||
EXPORT_SYMBOL(drm_fb_helper_setcmap);
|
EXPORT_SYMBOL(drm_fb_helper_setcmap);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_check_var - implementation for ->fb_check_var
|
* drm_fb_helper_check_var - implementation for &fb_ops.fb_check_var
|
||||||
* @var: screeninfo to check
|
* @var: screeninfo to check
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*/
|
*/
|
||||||
@@ -1338,7 +1338,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
|
|||||||
EXPORT_SYMBOL(drm_fb_helper_check_var);
|
EXPORT_SYMBOL(drm_fb_helper_check_var);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_set_par - implementation for ->fb_set_par
|
* drm_fb_helper_set_par - implementation for &fb_ops.fb_set_par
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*
|
*
|
||||||
* This will let fbcon do the mode init and is called at initialization time by
|
* This will let fbcon do the mode init and is called at initialization time by
|
||||||
@@ -1422,7 +1422,7 @@ backoff:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_pan_display - implementation for ->fb_pan_display
|
* drm_fb_helper_pan_display - implementation for &fb_ops.fb_pan_display
|
||||||
* @var: updated screen information
|
* @var: updated screen information
|
||||||
* @info: fbdev registered by the helper
|
* @info: fbdev registered by the helper
|
||||||
*/
|
*/
|
||||||
@@ -1607,7 +1607,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
|
|||||||
* additional constraints need to set up their own limits.
|
* additional constraints need to set up their own limits.
|
||||||
*
|
*
|
||||||
* Drivers should call this (or their equivalent setup code) from their
|
* Drivers should call this (or their equivalent setup code) from their
|
||||||
* ->fb_probe callback.
|
* &drm_fb_helper_funcs.fb_probe callback.
|
||||||
*/
|
*/
|
||||||
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
|
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
|
||||||
uint32_t depth)
|
uint32_t depth)
|
||||||
@@ -1636,11 +1636,11 @@ EXPORT_SYMBOL(drm_fb_helper_fill_fix);
|
|||||||
* @fb_height: desired fb height
|
* @fb_height: desired fb height
|
||||||
*
|
*
|
||||||
* Sets up the variable fbdev metainformation from the given fb helper instance
|
* Sets up the variable fbdev metainformation from the given fb helper instance
|
||||||
* and the drm framebuffer allocated in fb_helper->fb.
|
* and the drm framebuffer allocated in &drm_fb_helper.fb.
|
||||||
*
|
*
|
||||||
* Drivers should call this (or their equivalent setup code) from their
|
* Drivers should call this (or their equivalent setup code) from their
|
||||||
* ->fb_probe callback after having allocated the fbdev backing
|
* &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
|
||||||
* storage framebuffer.
|
* backing storage framebuffer.
|
||||||
*/
|
*/
|
||||||
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
|
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
|
||||||
uint32_t fb_width, uint32_t fb_height)
|
uint32_t fb_width, uint32_t fb_height)
|
||||||
@@ -2207,9 +2207,9 @@ out:
|
|||||||
* Note that this also registers the fbdev and so allows userspace to call into
|
* Note that this also registers the fbdev and so allows userspace to call into
|
||||||
* the driver through the fbdev interfaces.
|
* the driver through the fbdev interfaces.
|
||||||
*
|
*
|
||||||
* This function will call down into the ->fb_probe callback to let
|
* This function will call down into the &drm_fb_helper_funcs.fb_probe callback
|
||||||
* the driver allocate and initialize the fbdev info structure and the drm
|
* to let the driver allocate and initialize the fbdev info structure and the
|
||||||
* framebuffer used to back the fbdev. drm_fb_helper_fill_var() and
|
* drm framebuffer used to back the fbdev. drm_fb_helper_fill_var() and
|
||||||
* drm_fb_helper_fill_fix() are provided as helpers to setup simple default
|
* drm_fb_helper_fill_fix() are provided as helpers to setup simple default
|
||||||
* values for the fbdev info structure.
|
* values for the fbdev info structure.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ EXPORT_SYMBOL(drm_poll);
|
|||||||
* kmalloc and @p must be the first member element.
|
* kmalloc and @p must be the first member element.
|
||||||
*
|
*
|
||||||
* This is the locked version of drm_event_reserve_init() for callers which
|
* This is the locked version of drm_event_reserve_init() for callers which
|
||||||
* already hold dev->event_lock.
|
* already hold &drm_device.event_lock.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
*
|
*
|
||||||
@@ -621,7 +621,7 @@ EXPORT_SYMBOL(drm_event_reserve_init_locked);
|
|||||||
* If callers embedded @p into a larger structure it must be allocated with
|
* If callers embedded @p into a larger structure it must be allocated with
|
||||||
* kmalloc and @p must be the first member element.
|
* kmalloc and @p must be the first member element.
|
||||||
*
|
*
|
||||||
* Callers which already hold dev->event_lock should use
|
* Callers which already hold &drm_device.event_lock should use
|
||||||
* drm_event_reserve_init_locked() instead.
|
* drm_event_reserve_init_locked() instead.
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
@@ -677,7 +677,7 @@ EXPORT_SYMBOL(drm_event_cancel_free);
|
|||||||
*
|
*
|
||||||
* This function sends the event @e, initialized with drm_event_reserve_init(),
|
* This function sends the event @e, initialized with drm_event_reserve_init(),
|
||||||
* to its associated userspace DRM file. Callers must already hold
|
* to its associated userspace DRM file. Callers must already hold
|
||||||
* dev->event_lock, see drm_send_event() for the unlocked version.
|
* &drm_device.event_lock, see drm_send_event() for the unlocked version.
|
||||||
*
|
*
|
||||||
* Note that the core will take care of unlinking and disarming events when the
|
* Note that the core will take care of unlinking and disarming events when the
|
||||||
* corresponding DRM file is closed. Drivers need not worry about whether the
|
* corresponding DRM file is closed. Drivers need not worry about whether the
|
||||||
@@ -717,8 +717,9 @@ EXPORT_SYMBOL(drm_send_event_locked);
|
|||||||
* @e: DRM event to deliver
|
* @e: DRM event to deliver
|
||||||
*
|
*
|
||||||
* This function sends the event @e, initialized with drm_event_reserve_init(),
|
* This function sends the event @e, initialized with drm_event_reserve_init(),
|
||||||
* to its associated userspace DRM file. This function acquires dev->event_lock,
|
* to its associated userspace DRM file. This function acquires
|
||||||
* see drm_send_event_locked() for callers which already hold this lock.
|
* &drm_device.event_lock, see drm_send_event_locked() for callers which already
|
||||||
|
* hold this lock.
|
||||||
*
|
*
|
||||||
* Note that the core will take care of unlinking and disarming events when the
|
* Note that the core will take care of unlinking and disarming events when the
|
||||||
* corresponding DRM file is closed. Drivers need not worry about whether the
|
* corresponding DRM file is closed. Drivers need not worry about whether the
|
||||||
|
|||||||
@@ -58,8 +58,8 @@
|
|||||||
* fbdev framebuffer when the struct &struct drm_framebuffer is embedded into
|
* fbdev framebuffer when the struct &struct drm_framebuffer is embedded into
|
||||||
* the fbdev helper struct) drivers can manually clean up a framebuffer at
|
* the fbdev helper struct) drivers can manually clean up a framebuffer at
|
||||||
* module unload time with drm_framebuffer_unregister_private(). But doing this
|
* module unload time with drm_framebuffer_unregister_private(). But doing this
|
||||||
* is not recommended, and it's better to have a normal free-standing struct
|
* is not recommended, and it's better to have a normal free-standing &struct
|
||||||
* &drm_framebuffer.
|
* drm_framebuffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
|
int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
|
||||||
@@ -470,7 +470,7 @@ int drm_mode_getfb(struct drm_device *dev,
|
|||||||
* usb display-link, mipi manual update panels or edp panel self refresh modes.
|
* usb display-link, mipi manual update panels or edp panel self refresh modes.
|
||||||
*
|
*
|
||||||
* Modesetting drivers which always update the frontbuffer do not need to
|
* Modesetting drivers which always update the frontbuffer do not need to
|
||||||
* implement the corresponding ->dirty framebuffer callback.
|
* implement the corresponding &drm_framebuffer_funcs.dirty callback.
|
||||||
*
|
*
|
||||||
* Called by the user via ioctl.
|
* Called by the user via ioctl.
|
||||||
*
|
*
|
||||||
@@ -709,10 +709,10 @@ EXPORT_SYMBOL(drm_framebuffer_unregister_private);
|
|||||||
* @fb: framebuffer to remove
|
* @fb: framebuffer to remove
|
||||||
*
|
*
|
||||||
* Cleanup framebuffer. This function is intended to be used from the drivers
|
* Cleanup framebuffer. This function is intended to be used from the drivers
|
||||||
* ->destroy callback. It can also be used to clean up driver private
|
* &drm_framebuffer_funcs.destroy callback. It can also be used to clean up
|
||||||
* framebuffers embedded into a larger structure.
|
* driver private framebuffers embedded into a larger structure.
|
||||||
*
|
*
|
||||||
* Note that this function does not remove the fb from active usuage - if it is
|
* Note that this function does not remove the fb from active usage - if it is
|
||||||
* still used anywhere, hilarity can ensue since userspace could call getfb on
|
* still used anywhere, hilarity can ensue since userspace could call getfb on
|
||||||
* the id and get back -EINVAL. Obviously no concern at driver unload time.
|
* the id and get back -EINVAL. Obviously no concern at driver unload time.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -316,8 +316,8 @@ EXPORT_SYMBOL(drm_gem_handle_delete);
|
|||||||
* @dev: corresponding drm_device
|
* @dev: corresponding drm_device
|
||||||
* @handle: the dumb handle to remove
|
* @handle: the dumb handle to remove
|
||||||
*
|
*
|
||||||
* This implements the ->dumb_destroy kms driver callback for drivers which use
|
* This implements the &drm_driver.dumb_destroy kms driver callback for drivers
|
||||||
* gem to manage their backing storage.
|
* which use gem to manage their backing storage.
|
||||||
*/
|
*/
|
||||||
int drm_gem_dumb_destroy(struct drm_file *file,
|
int drm_gem_dumb_destroy(struct drm_file *file,
|
||||||
struct drm_device *dev,
|
struct drm_device *dev,
|
||||||
@@ -333,9 +333,9 @@ EXPORT_SYMBOL(drm_gem_dumb_destroy);
|
|||||||
* @obj: object to register
|
* @obj: object to register
|
||||||
* @handlep: pointer to return the created handle to the caller
|
* @handlep: pointer to return the created handle to the caller
|
||||||
*
|
*
|
||||||
* This expects the dev->object_name_lock to be held already and will drop it
|
* This expects the &drm_device.object_name_lock to be held already and will
|
||||||
* before returning. Used to avoid races in establishing new handles when
|
* drop it before returning. Used to avoid races in establishing new handles
|
||||||
* importing an object from either an flink name or a dma-buf.
|
* when importing an object from either an flink name or a dma-buf.
|
||||||
*
|
*
|
||||||
* Handles must be release again through drm_gem_handle_delete(). This is done
|
* Handles must be release again through drm_gem_handle_delete(). This is done
|
||||||
* when userspace closes @file_priv for all attached handles, or through the
|
* when userspace closes @file_priv for all attached handles, or through the
|
||||||
@@ -447,8 +447,8 @@ EXPORT_SYMBOL(drm_gem_free_mmap_offset);
|
|||||||
* structures.
|
* structures.
|
||||||
*
|
*
|
||||||
* This routine allocates and attaches a fake offset for @obj, in cases where
|
* This routine allocates and attaches a fake offset for @obj, in cases where
|
||||||
* the virtual size differs from the physical size (ie. obj->size). Otherwise
|
* the virtual size differs from the physical size (ie. &drm_gem_object.size).
|
||||||
* just use drm_gem_create_mmap_offset().
|
* Otherwise just use drm_gem_create_mmap_offset().
|
||||||
*
|
*
|
||||||
* This function is idempotent and handles an already allocated mmap offset
|
* This function is idempotent and handles an already allocated mmap offset
|
||||||
* transparently. Drivers do not need to check for this case.
|
* transparently. Drivers do not need to check for this case.
|
||||||
@@ -787,7 +787,7 @@ EXPORT_SYMBOL(drm_gem_object_release);
|
|||||||
* @kref: kref of the object to free
|
* @kref: kref of the object to free
|
||||||
*
|
*
|
||||||
* Called after the last reference to the object has been lost.
|
* Called after the last reference to the object has been lost.
|
||||||
* Must be called holding &drm_device->struct_mutex.
|
* Must be called holding &drm_device.struct_mutex.
|
||||||
*
|
*
|
||||||
* Frees the object
|
* Frees the object
|
||||||
*/
|
*/
|
||||||
@@ -813,7 +813,7 @@ EXPORT_SYMBOL(drm_gem_object_free);
|
|||||||
* @obj: GEM buffer object
|
* @obj: GEM buffer object
|
||||||
*
|
*
|
||||||
* This releases a reference to @obj. Callers must not hold the
|
* This releases a reference to @obj. Callers must not hold the
|
||||||
* dev->struct_mutex lock when calling this function.
|
* &drm_device.struct_mutex lock when calling this function.
|
||||||
*
|
*
|
||||||
* See also __drm_gem_object_unreference().
|
* See also __drm_gem_object_unreference().
|
||||||
*/
|
*/
|
||||||
@@ -840,9 +840,9 @@ EXPORT_SYMBOL(drm_gem_object_unreference_unlocked);
|
|||||||
* drm_gem_object_unreference - release a GEM BO reference
|
* drm_gem_object_unreference - release a GEM BO reference
|
||||||
* @obj: GEM buffer object
|
* @obj: GEM buffer object
|
||||||
*
|
*
|
||||||
* This releases a reference to @obj. Callers must hold the dev->struct_mutex
|
* This releases a reference to @obj. Callers must hold the
|
||||||
* lock when calling this function, even when the driver doesn't use
|
* &drm_device.struct_mutex lock when calling this function, even when the
|
||||||
* dev->struct_mutex for anything.
|
* driver doesn't use &drm_device.struct_mutex for anything.
|
||||||
*
|
*
|
||||||
* For drivers not encumbered with legacy locking use
|
* For drivers not encumbered with legacy locking use
|
||||||
* drm_gem_object_unreference_unlocked() instead.
|
* drm_gem_object_unreference_unlocked() instead.
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ void drm_lastclose(struct drm_device *dev);
|
|||||||
/* drm_pci.c */
|
/* drm_pci.c */
|
||||||
int drm_irq_by_busid(struct drm_device *dev, void *data,
|
int drm_irq_by_busid(struct drm_device *dev, void *data,
|
||||||
struct drm_file *file_priv);
|
struct drm_file *file_priv);
|
||||||
|
void drm_pci_agp_destroy(struct drm_device *dev);
|
||||||
|
|
||||||
/* drm_prime.c */
|
/* drm_prime.c */
|
||||||
int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
|
int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe,
|
|||||||
*
|
*
|
||||||
* Only to be called from drm_crtc_vblank_on().
|
* Only to be called from drm_crtc_vblank_on().
|
||||||
*
|
*
|
||||||
* Note: caller must hold dev->vbl_lock since this reads & writes
|
* Note: caller must hold &drm_device.vbl_lock since this reads & writes
|
||||||
* device vblank fields.
|
* device vblank fields.
|
||||||
*/
|
*/
|
||||||
static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe)
|
static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe)
|
||||||
@@ -142,7 +142,7 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe
|
|||||||
* Only necessary when going from off->on, to account for frames we
|
* Only necessary when going from off->on, to account for frames we
|
||||||
* didn't get an interrupt for.
|
* didn't get an interrupt for.
|
||||||
*
|
*
|
||||||
* Note: caller must hold dev->vbl_lock since this reads & writes
|
* Note: caller must hold &drm_device.vbl_lock since this reads & writes
|
||||||
* device vblank fields.
|
* device vblank fields.
|
||||||
*/
|
*/
|
||||||
static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
|
static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
|
||||||
@@ -415,29 +415,6 @@ err:
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_vblank_init);
|
EXPORT_SYMBOL(drm_vblank_init);
|
||||||
|
|
||||||
static void drm_irq_vgaarb_nokms(void *cookie, bool state)
|
|
||||||
{
|
|
||||||
struct drm_device *dev = cookie;
|
|
||||||
|
|
||||||
if (dev->driver->vgaarb_irq) {
|
|
||||||
dev->driver->vgaarb_irq(dev, state);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dev->irq_enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (state) {
|
|
||||||
if (dev->driver->irq_uninstall)
|
|
||||||
dev->driver->irq_uninstall(dev);
|
|
||||||
} else {
|
|
||||||
if (dev->driver->irq_preinstall)
|
|
||||||
dev->driver->irq_preinstall(dev);
|
|
||||||
if (dev->driver->irq_postinstall)
|
|
||||||
dev->driver->irq_postinstall(dev);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_irq_install - install IRQ handler
|
* drm_irq_install - install IRQ handler
|
||||||
* @dev: DRM device
|
* @dev: DRM device
|
||||||
@@ -449,7 +426,7 @@ static void drm_irq_vgaarb_nokms(void *cookie, bool state)
|
|||||||
*
|
*
|
||||||
* This is the simplified helper interface provided for drivers with no special
|
* This is the simplified helper interface provided for drivers with no special
|
||||||
* needs. Drivers which need to install interrupt handlers for multiple
|
* needs. Drivers which need to install interrupt handlers for multiple
|
||||||
* interrupts must instead set drm_device->irq_enabled to signal the DRM core
|
* interrupts must instead set &drm_device.irq_enabled to signal the DRM core
|
||||||
* that vblank interrupts are available.
|
* that vblank interrupts are available.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
@@ -492,9 +469,6 @@ int drm_irq_install(struct drm_device *dev, int irq)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drm_core_check_feature(dev, DRIVER_LEGACY))
|
|
||||||
vga_client_register(dev->pdev, (void *)dev, drm_irq_vgaarb_nokms, NULL);
|
|
||||||
|
|
||||||
/* After installing handler */
|
/* After installing handler */
|
||||||
if (dev->driver->irq_postinstall)
|
if (dev->driver->irq_postinstall)
|
||||||
ret = dev->driver->irq_postinstall(dev);
|
ret = dev->driver->irq_postinstall(dev);
|
||||||
@@ -519,7 +493,7 @@ EXPORT_SYMBOL(drm_irq_install);
|
|||||||
* Calls the driver's irq_uninstall() function and unregisters the IRQ handler.
|
* Calls the driver's irq_uninstall() function and unregisters the IRQ handler.
|
||||||
* This should only be called by drivers which used drm_irq_install() to set up
|
* This should only be called by drivers which used drm_irq_install() to set up
|
||||||
* their interrupt handler. Other drivers must only reset
|
* their interrupt handler. Other drivers must only reset
|
||||||
* drm_device->irq_enabled to false.
|
* &drm_device.irq_enabled to false.
|
||||||
*
|
*
|
||||||
* Note that for kernel modesetting drivers it is a bug if this function fails.
|
* Note that for kernel modesetting drivers it is a bug if this function fails.
|
||||||
* The sanity checks are only to catch buggy user modesetting drivers which call
|
* The sanity checks are only to catch buggy user modesetting drivers which call
|
||||||
@@ -982,12 +956,11 @@ static void send_vblank_event(struct drm_device *dev,
|
|||||||
* period. This helper function implements exactly the required vblank arming
|
* period. This helper function implements exactly the required vblank arming
|
||||||
* behaviour.
|
* behaviour.
|
||||||
*
|
*
|
||||||
* NOTE: Drivers using this to send out the event in &struct drm_crtc_state
|
* NOTE: Drivers using this to send out the &drm_crtc_state.event as part of an
|
||||||
* as part of an atomic commit must ensure that the next vblank happens at
|
* atomic commit must ensure that the next vblank happens at exactly the same
|
||||||
* exactly the same time as the atomic commit is committed to the hardware. This
|
* time as the atomic commit is committed to the hardware. This function itself
|
||||||
* function itself does **not** protect again the next vblank interrupt racing
|
* does **not** protect again the next vblank interrupt racing with either this
|
||||||
* with either this function call or the atomic commit operation. A possible
|
* function call or the atomic commit operation. A possible sequence could be:
|
||||||
* sequence could be:
|
|
||||||
*
|
*
|
||||||
* 1. Driver commits new hardware state into vblank-synchronized registers.
|
* 1. Driver commits new hardware state into vblank-synchronized registers.
|
||||||
* 2. A vblank happens, committing the hardware state. Also the corresponding
|
* 2. A vblank happens, committing the hardware state. Also the corresponding
|
||||||
|
|||||||
@@ -552,8 +552,8 @@ EXPORT_SYMBOL(drm_mm_replace_node);
|
|||||||
* objects to the roster, probably by walking an LRU list, but this can be
|
* objects to the roster, probably by walking an LRU list, but this can be
|
||||||
* freely implemented. Eviction candiates are added using
|
* freely implemented. Eviction candiates are added using
|
||||||
* drm_mm_scan_add_block() until a suitable hole is found or there are no
|
* drm_mm_scan_add_block() until a suitable hole is found or there are no
|
||||||
* further evictable objects. Eviction roster metadata is tracked in struct
|
* further evictable objects. Eviction roster metadata is tracked in &struct
|
||||||
* &drm_mm_scan.
|
* drm_mm_scan.
|
||||||
*
|
*
|
||||||
* The driver must walk through all objects again in exactly the reverse
|
* The driver must walk through all objects again in exactly the reverse
|
||||||
* order to restore the allocator state. Note that while the allocator is used
|
* order to restore the allocator state. Note that while the allocator is used
|
||||||
|
|||||||
@@ -421,7 +421,12 @@ void drm_mode_config_cleanup(struct drm_device *dev)
|
|||||||
drm_connector_unreference(connector);
|
drm_connector_unreference(connector);
|
||||||
}
|
}
|
||||||
drm_connector_list_iter_put(&conn_iter);
|
drm_connector_list_iter_put(&conn_iter);
|
||||||
WARN_ON(!list_empty(&dev->mode_config.connector_list));
|
if (WARN_ON(!list_empty(&dev->mode_config.connector_list))) {
|
||||||
|
drm_connector_list_iter_get(dev, &conn_iter);
|
||||||
|
drm_for_each_connector_iter(connector, &conn_iter)
|
||||||
|
DRM_ERROR("connector %s leaked!\n", connector->name);
|
||||||
|
drm_connector_list_iter_put(&conn_iter);
|
||||||
|
}
|
||||||
|
|
||||||
list_for_each_entry_safe(property, pt, &dev->mode_config.property_list,
|
list_for_each_entry_safe(property, pt, &dev->mode_config.property_list,
|
||||||
head) {
|
head) {
|
||||||
|
|||||||
@@ -796,6 +796,26 @@ int drm_mode_vrefresh(const struct drm_display_mode *mode)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_mode_vrefresh);
|
EXPORT_SYMBOL(drm_mode_vrefresh);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
|
||||||
|
* @mode: mode to query
|
||||||
|
* @hdisplay: hdisplay value to fill in
|
||||||
|
* @vdisplay: vdisplay value to fill in
|
||||||
|
*
|
||||||
|
* The vdisplay value will be doubled if the specified mode is a stereo mode of
|
||||||
|
* the appropriate layout.
|
||||||
|
*/
|
||||||
|
void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
|
||||||
|
int *hdisplay, int *vdisplay)
|
||||||
|
{
|
||||||
|
struct drm_display_mode adjusted = *mode;
|
||||||
|
|
||||||
|
drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
|
||||||
|
*hdisplay = adjusted.crtc_hdisplay;
|
||||||
|
*vdisplay = adjusted.crtc_vdisplay;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_mode_get_hv_timing);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_mode_set_crtcinfo - set CRTC modesetting timing parameters
|
* drm_mode_set_crtcinfo - set CRTC modesetting timing parameters
|
||||||
* @p: mode
|
* @p: mode
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
* to use &ww_mutex and acquire-contexts to avoid deadlocks. But because
|
* to use &ww_mutex and acquire-contexts to avoid deadlocks. But because
|
||||||
* the locking is more distributed around the driver code, we want a bit
|
* the locking is more distributed around the driver code, we want a bit
|
||||||
* of extra utility/tracking out of our acquire-ctx. This is provided
|
* of extra utility/tracking out of our acquire-ctx. This is provided
|
||||||
* by drm_modeset_lock / drm_modeset_acquire_ctx.
|
* by &struct drm_modeset_lock and &struct drm_modeset_acquire_ctx.
|
||||||
*
|
*
|
||||||
* For basic principles of &ww_mutex, see: Documentation/locking/ww-mutex-design.txt
|
* For basic principles of &ww_mutex, see: Documentation/locking/ww-mutex-design.txt
|
||||||
*
|
*
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
* drm_modeset_acquire_fini(&ctx);
|
* drm_modeset_acquire_fini(&ctx);
|
||||||
*
|
*
|
||||||
* On top of of these per-object locks using &ww_mutex there's also an overall
|
* On top of of these per-object locks using &ww_mutex there's also an overall
|
||||||
* dev->mode_config.lock, for protecting everything else. Mostly this means
|
* &drm_mode_config.mutex, for protecting everything else. Mostly this means
|
||||||
* probe state of connectors, and preventing hotplug add/removal of connectors.
|
* probe state of connectors, and preventing hotplug add/removal of connectors.
|
||||||
*
|
*
|
||||||
* Finally there's a bunch of dedicated locks to protect drm core internal
|
* Finally there's a bunch of dedicated locks to protect drm core internal
|
||||||
@@ -71,7 +71,7 @@ static DEFINE_WW_CLASS(crtc_ww_class);
|
|||||||
* drm_modeset_unlock_all() function.
|
* drm_modeset_unlock_all() function.
|
||||||
*
|
*
|
||||||
* This function is deprecated. It allocates a lock acquisition context and
|
* This function is deprecated. It allocates a lock acquisition context and
|
||||||
* stores it in the DRM device's ->mode_config. This facilitate conversion of
|
* stores it in &drm_device.mode_config. This facilitate conversion of
|
||||||
* existing code because it removes the need to manually deal with the
|
* existing code because it removes the need to manually deal with the
|
||||||
* acquisition context, but it is also brittle because the context is global
|
* acquisition context, but it is also brittle because the context is global
|
||||||
* and care must be taken not to nest calls. New code should use the
|
* and care must be taken not to nest calls. New code should use the
|
||||||
@@ -124,7 +124,7 @@ EXPORT_SYMBOL(drm_modeset_lock_all);
|
|||||||
* drm_modeset_lock_all() function.
|
* drm_modeset_lock_all() function.
|
||||||
*
|
*
|
||||||
* This function is deprecated. It uses the lock acquisition context stored
|
* This function is deprecated. It uses the lock acquisition context stored
|
||||||
* in the DRM device's ->mode_config. This facilitates conversion of existing
|
* in &drm_device.mode_config. This facilitates conversion of existing
|
||||||
* code because it removes the need to manually deal with the acquisition
|
* code because it removes the need to manually deal with the acquisition
|
||||||
* context, but it is also brittle because the context is global and care must
|
* context, but it is also brittle because the context is global and care must
|
||||||
* be taken not to nest calls. New code should pass the acquisition context
|
* be taken not to nest calls. New code should pass the acquisition context
|
||||||
@@ -468,7 +468,7 @@ EXPORT_SYMBOL(drm_modeset_unlock);
|
|||||||
* This function takes all modeset locks, suitable where a more fine-grained
|
* This function takes all modeset locks, suitable where a more fine-grained
|
||||||
* scheme isn't (yet) implemented.
|
* scheme isn't (yet) implemented.
|
||||||
*
|
*
|
||||||
* Unlike drm_modeset_lock_all(), it doesn't take the dev->mode_config.mutex
|
* Unlike drm_modeset_lock_all(), it doesn't take the &drm_mode_config.mutex
|
||||||
* since that lock isn't required for modeset state changes. Callers which
|
* since that lock isn't required for modeset state changes. Callers which
|
||||||
* need to grab that lock too need to do so outside of the acquire context
|
* need to grab that lock too need to do so outside of the acquire context
|
||||||
* @ctx.
|
* @ctx.
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
|
|||||||
static void drm_pci_agp_init(struct drm_device *dev)
|
static void drm_pci_agp_init(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
|
if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
|
||||||
if (drm_pci_device_is_agp(dev))
|
if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
|
||||||
dev->agp = drm_agp_init(dev);
|
dev->agp = drm_agp_init(dev);
|
||||||
if (dev->agp) {
|
if (dev->agp) {
|
||||||
dev->agp->agp_mtrr = arch_phys_wc_add(
|
dev->agp->agp_mtrr = arch_phys_wc_add(
|
||||||
@@ -223,7 +223,7 @@ void drm_pci_agp_destroy(struct drm_device *dev)
|
|||||||
* Try and register, if we fail to register, backout previous work.
|
* Try and register, if we fail to register, backout previous work.
|
||||||
*
|
*
|
||||||
* NOTE: This function is deprecated, please use drm_dev_alloc() and
|
* NOTE: This function is deprecated, please use drm_dev_alloc() and
|
||||||
* drm_dev_register() instead and remove your ->load() callback.
|
* drm_dev_register() instead and remove your &drm_driver.load callback.
|
||||||
*
|
*
|
||||||
* Return: 0 on success or a negative error code on failure.
|
* Return: 0 on success or a negative error code on failure.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
*
|
*
|
||||||
* Cursor and overlay planes are optional. All drivers should provide one
|
* Cursor and overlay planes are optional. All drivers should provide one
|
||||||
* primary plane per CRTC to avoid surprising userspace too much. See enum
|
* primary plane per CRTC to avoid surprising userspace too much. See enum
|
||||||
* &drm_plane_type for a more in-depth discussion of these special uapi-relevant
|
* drm_plane_type for a more in-depth discussion of these special uapi-relevant
|
||||||
* plane types. Special planes are associated with their CRTC by calling
|
* plane types. Special planes are associated with their CRTC by calling
|
||||||
* drm_crtc_init_with_planes().
|
* drm_crtc_init_with_planes().
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -39,9 +39,9 @@
|
|||||||
*
|
*
|
||||||
* This helper library has two parts. The first part has support to implement
|
* This helper library has two parts. The first part has support to implement
|
||||||
* primary plane support on top of the normal CRTC configuration interface.
|
* primary plane support on top of the normal CRTC configuration interface.
|
||||||
* Since the legacy ->set_config interface ties the primary plane together with
|
* Since the legacy &drm_mode_config_funcs.set_config interface ties the primary
|
||||||
* the CRTC state this does not allow userspace to disable the primary plane
|
* plane together with the CRTC state this does not allow userspace to disable
|
||||||
* itself. To avoid too much duplicated code use
|
* the primary plane itself. To avoid too much duplicated code use
|
||||||
* drm_plane_helper_check_update() which can be used to enforce the same
|
* drm_plane_helper_check_update() which can be used to enforce the same
|
||||||
* restrictions as primary planes had thus. The default primary plane only
|
* restrictions as primary planes had thus. The default primary plane only
|
||||||
* expose XRBG8888 and ARGB8888 as valid pixel formats for the attached
|
* expose XRBG8888 and ARGB8888 as valid pixel formats for the attached
|
||||||
@@ -384,7 +384,8 @@ EXPORT_SYMBOL(drm_primary_helper_update);
|
|||||||
* is called in response to a userspace SetPlane operation on the plane with a
|
* is called in response to a userspace SetPlane operation on the plane with a
|
||||||
* NULL framebuffer parameter. It unconditionally fails the disable call with
|
* NULL framebuffer parameter. It unconditionally fails the disable call with
|
||||||
* -EINVAL the only way to disable the primary plane without driver support is
|
* -EINVAL the only way to disable the primary plane without driver support is
|
||||||
* to disable the entier CRTC. Which does not match the plane ->disable hook.
|
* to disable the entire CRTC. Which does not match the plane
|
||||||
|
* &drm_plane_funcs.disable_plane hook.
|
||||||
*
|
*
|
||||||
* Note that some hardware may be able to disable the primary plane without
|
* Note that some hardware may be able to disable the primary plane without
|
||||||
* disabling the whole CRTC. Drivers for such hardware should provide their
|
* disabling the whole CRTC. Drivers for such hardware should provide their
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ err_free:
|
|||||||
* .load() function.
|
* .load() function.
|
||||||
*
|
*
|
||||||
* NOTE: This function is deprecated, please use drm_dev_alloc() and
|
* NOTE: This function is deprecated, please use drm_dev_alloc() and
|
||||||
* drm_dev_register() instead and remove your ->load() callback.
|
* drm_dev_register() instead and remove your &drm_driver.load callback.
|
||||||
*
|
*
|
||||||
* Return: 0 on success or a negative error code on failure.
|
* Return: 0 on success or a negative error code on failure.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -40,8 +40,11 @@
|
|||||||
* On the export the dma_buf holds a reference to the exporting GEM
|
* On the export the dma_buf holds a reference to the exporting GEM
|
||||||
* object. It takes this reference in handle_to_fd_ioctl, when it
|
* object. It takes this reference in handle_to_fd_ioctl, when it
|
||||||
* first calls .prime_export and stores the exporting GEM object in
|
* first calls .prime_export and stores the exporting GEM object in
|
||||||
* the dma_buf priv. This reference is released when the dma_buf
|
* the dma_buf priv. This reference needs to be released when the
|
||||||
* object goes away in the driver .release function.
|
* final reference to the &dma_buf itself is dropped and its
|
||||||
|
* &dma_buf_ops.release function is called. For GEM-based drivers,
|
||||||
|
* the dma_buf should be exported using drm_gem_dmabuf_export() and
|
||||||
|
* then released by drm_gem_dmabuf_release().
|
||||||
*
|
*
|
||||||
* On the import the importing GEM object holds a reference to the
|
* On the import the importing GEM object holds a reference to the
|
||||||
* dma_buf (which in turn holds a ref to the exporting GEM object).
|
* dma_buf (which in turn holds a ref to the exporting GEM object).
|
||||||
@@ -51,6 +54,16 @@
|
|||||||
* when the imported object is destroyed, we remove the attachment
|
* when the imported object is destroyed, we remove the attachment
|
||||||
* and drop the reference to the dma_buf.
|
* and drop the reference to the dma_buf.
|
||||||
*
|
*
|
||||||
|
* When all the references to the &dma_buf are dropped, i.e. when
|
||||||
|
* userspace has closed both handles to the imported GEM object (through the
|
||||||
|
* FD_TO_HANDLE IOCTL) and closed the file descriptor of the exported
|
||||||
|
* (through the HANDLE_TO_FD IOCTL) dma_buf, and all kernel-internal references
|
||||||
|
* are also gone, then the dma_buf gets destroyed. This can also happen as a
|
||||||
|
* part of the clean up procedure in the drm_release() function if userspace
|
||||||
|
* fails to properly clean up. Note that both the kernel and userspace (by
|
||||||
|
* keeeping the PRIME file descriptors open) can hold references onto a
|
||||||
|
* &dma_buf.
|
||||||
|
*
|
||||||
* Thus the chain of references always flows in one direction
|
* Thus the chain of references always flows in one direction
|
||||||
* (avoiding loops): importing_gem -> dmabuf -> exporting_gem
|
* (avoiding loops): importing_gem -> dmabuf -> exporting_gem
|
||||||
*
|
*
|
||||||
@@ -291,7 +304,7 @@ static void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach,
|
|||||||
* This wraps dma_buf_export() for use by generic GEM drivers that are using
|
* This wraps dma_buf_export() for use by generic GEM drivers that are using
|
||||||
* drm_gem_dmabuf_release(). In addition to calling dma_buf_export(), we take
|
* drm_gem_dmabuf_release(). In addition to calling dma_buf_export(), we take
|
||||||
* a reference to the &drm_device and the exported &drm_gem_object (stored in
|
* a reference to the &drm_device and the exported &drm_gem_object (stored in
|
||||||
* exp_info->priv) which is released by drm_gem_dmabuf_release().
|
* &dma_buf_export_info.priv) which is released by drm_gem_dmabuf_release().
|
||||||
*
|
*
|
||||||
* Returns the new dmabuf.
|
* Returns the new dmabuf.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
* DOC: output probing helper overview
|
* DOC: output probing helper overview
|
||||||
*
|
*
|
||||||
* This library provides some helper code for output probing. It provides an
|
* This library provides some helper code for output probing. It provides an
|
||||||
* implementation of the core connector->fill_modes interface with
|
* implementation of the core &drm_connector_funcs.fill_modes interface with
|
||||||
* drm_helper_probe_single_connector_modes.
|
* drm_helper_probe_single_connector_modes.
|
||||||
*
|
*
|
||||||
* It also provides support for polling connectors with a work item and for
|
* It also provides support for polling connectors with a work item and for
|
||||||
@@ -187,9 +187,9 @@ drm_connector_detect(struct drm_connector *connector, bool force)
|
|||||||
* be added to the connector's probed_modes list, then culled (based on validity
|
* be added to the connector's probed_modes list, then culled (based on validity
|
||||||
* and the @maxX, @maxY parameters) and put into the normal modes list.
|
* and the @maxX, @maxY parameters) and put into the normal modes list.
|
||||||
*
|
*
|
||||||
* Intended to be used as a generic implementation of the ->fill_modes()
|
* Intended to be used as a generic implementation of the
|
||||||
* @connector vfunc for drivers that use the CRTC helpers for output mode
|
* &drm_connector_funcs.fill_modes() vfunc for drivers that use the CRTC helpers
|
||||||
* filtering and detection.
|
* for output mode filtering and detection.
|
||||||
*
|
*
|
||||||
* The basic procedure is as follows
|
* The basic procedure is as follows
|
||||||
*
|
*
|
||||||
@@ -201,7 +201,7 @@ drm_connector_detect(struct drm_connector *connector, bool force)
|
|||||||
*
|
*
|
||||||
* - debugfs 'override_edid' (used for testing only)
|
* - debugfs 'override_edid' (used for testing only)
|
||||||
* - firmware EDID (drm_load_edid_firmware())
|
* - firmware EDID (drm_load_edid_firmware())
|
||||||
* - connector helper ->get_modes() vfunc
|
* - &drm_connector_helper_funcs.get_modes vfunc
|
||||||
* - if the connector status is connector_status_connected, standard
|
* - if the connector status is connector_status_connected, standard
|
||||||
* VESA DMT modes up to 1024x768 are automatically added
|
* VESA DMT modes up to 1024x768 are automatically added
|
||||||
* (drm_add_modes_noedid())
|
* (drm_add_modes_noedid())
|
||||||
@@ -222,8 +222,8 @@ drm_connector_detect(struct drm_connector *connector, bool force)
|
|||||||
* (if specified)
|
* (if specified)
|
||||||
* - drm_mode_validate_flag() checks the modes againt basic connector
|
* - drm_mode_validate_flag() checks the modes againt basic connector
|
||||||
* capabilites (interlace_allowed,doublescan_allowed,stereo_allowed)
|
* capabilites (interlace_allowed,doublescan_allowed,stereo_allowed)
|
||||||
* - the optional connector ->mode_valid() helper can perform driver and/or
|
* - the optional &drm_connector_helper_funcs.mode_valid helper can perform
|
||||||
* hardware specific checks
|
* driver and/or hardware specific checks
|
||||||
*
|
*
|
||||||
* 5. Any mode whose status is not OK is pruned from the connector's modes list,
|
* 5. Any mode whose status is not OK is pruned from the connector's modes list,
|
||||||
* accompanied by a debug message indicating the reason for the mode's
|
* accompanied by a debug message indicating the reason for the mode's
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
* drm_object_attach_property().
|
* drm_object_attach_property().
|
||||||
*
|
*
|
||||||
* Property values are only 64bit. To support bigger piles of data (like gamma
|
* Property values are only 64bit. To support bigger piles of data (like gamma
|
||||||
* tables, color correction matrizes or large structures) a property can instead
|
* tables, color correction matrices or large structures) a property can instead
|
||||||
* point at a &drm_property_blob with that additional data
|
* point at a &drm_property_blob with that additional data.
|
||||||
*
|
*
|
||||||
* Properties are defined by their symbolic name, userspace must keep a
|
* Properties are defined by their symbolic name, userspace must keep a
|
||||||
* per-object mapping from those names to the property ID used in the atomic
|
* per-object mapping from those names to the property ID used in the atomic
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ static const struct attribute_group *connector_dev_groups[] = {
|
|||||||
* @connector: connector to add
|
* @connector: connector to add
|
||||||
*
|
*
|
||||||
* Create a connector device in sysfs, along with its associated connector
|
* Create a connector device in sysfs, along with its associated connector
|
||||||
* properties (so far, connection status, dpms, mode list & edid) and
|
* properties (so far, connection status, dpms, mode list and edid) and
|
||||||
* generate a hotplug event so userspace knows there's a new connector
|
* generate a hotplug event so userspace knows there's a new connector
|
||||||
* available.
|
* available.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
config DRM_ETNAVIV
|
config DRM_ETNAVIV
|
||||||
tristate "ETNAVIV (DRM support for Vivante GPU IP cores)"
|
tristate "ETNAVIV (DRM support for Vivante GPU IP cores)"
|
||||||
depends on DRM
|
depends on DRM
|
||||||
depends on ARCH_MXC || ARCH_DOVE
|
depends on ARCH_MXC || ARCH_DOVE || (ARM && COMPILE_TEST)
|
||||||
depends on MMU
|
depends on MMU
|
||||||
select SHMEM
|
select SHMEM
|
||||||
select TMPFS
|
select TMPFS
|
||||||
|
|||||||
@@ -258,12 +258,6 @@ static int etnaviv_debugfs_init(struct drm_minor *minor)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void etnaviv_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(etnaviv_debugfs_list,
|
|
||||||
ARRAY_SIZE(etnaviv_debugfs_list), minor);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -509,7 +503,6 @@ static struct drm_driver etnaviv_drm_driver = {
|
|||||||
.gem_prime_mmap = etnaviv_gem_prime_mmap,
|
.gem_prime_mmap = etnaviv_gem_prime_mmap,
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
.debugfs_init = etnaviv_debugfs_init,
|
.debugfs_init = etnaviv_debugfs_init,
|
||||||
.debugfs_cleanup = etnaviv_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
.ioctls = etnaviv_ioctls,
|
.ioctls = etnaviv_ioctls,
|
||||||
.num_ioctls = DRM_ETNAVIV_NUM_IOCTLS,
|
.num_ioctls = DRM_ETNAVIV_NUM_IOCTLS,
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ comment "CRTCs"
|
|||||||
config DRM_EXYNOS_FIMD
|
config DRM_EXYNOS_FIMD
|
||||||
bool "FIMD"
|
bool "FIMD"
|
||||||
depends on !FB_S3C
|
depends on !FB_S3C
|
||||||
select FB_MODE_HELPERS
|
|
||||||
select MFD_SYSCON
|
select MFD_SYSCON
|
||||||
help
|
help
|
||||||
Choose this option if you want to use Exynos FIMD for DRM.
|
Choose this option if you want to use Exynos FIMD for DRM.
|
||||||
@@ -32,7 +31,6 @@ config DRM_EXYNOS5433_DECON
|
|||||||
config DRM_EXYNOS7_DECON
|
config DRM_EXYNOS7_DECON
|
||||||
bool "DECON on Exynos7"
|
bool "DECON on Exynos7"
|
||||||
depends on !FB_S3C
|
depends on !FB_S3C
|
||||||
select FB_MODE_HELPERS
|
|
||||||
help
|
help
|
||||||
Choose this option if you want to use Exynos DECON for DRM.
|
Choose this option if you want to use Exynos DECON for DRM.
|
||||||
|
|
||||||
|
|||||||
@@ -406,11 +406,6 @@ out_err:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int psb_driver_device_is_agp(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void get_brightness(struct backlight_device *bd)
|
static inline void get_brightness(struct backlight_device *bd)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
|
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
|
||||||
@@ -487,7 +482,6 @@ static struct drm_driver driver = {
|
|||||||
.set_busid = drm_pci_set_busid,
|
.set_busid = drm_pci_set_busid,
|
||||||
|
|
||||||
.num_ioctls = ARRAY_SIZE(psb_ioctls),
|
.num_ioctls = ARRAY_SIZE(psb_ioctls),
|
||||||
.device_is_agp = psb_driver_device_is_agp,
|
|
||||||
.irq_preinstall = psb_irq_preinstall,
|
.irq_preinstall = psb_irq_preinstall,
|
||||||
.irq_postinstall = psb_irq_postinstall,
|
.irq_postinstall = psb_irq_postinstall,
|
||||||
.irq_uninstall = psb_irq_uninstall,
|
.irq_uninstall = psb_irq_uninstall,
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper,
|
|||||||
|
|
||||||
hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj);
|
hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj);
|
||||||
if (IS_ERR(hi_fbdev->fb)) {
|
if (IS_ERR(hi_fbdev->fb)) {
|
||||||
ret = PTR_ERR(info);
|
ret = PTR_ERR(hi_fbdev->fb);
|
||||||
DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
|
DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
|
||||||
goto out_release_fbi;
|
goto out_release_fbi;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1190,6 +1190,14 @@ static int i810_flip_bufs(struct drm_device *dev, void *data,
|
|||||||
|
|
||||||
int i810_driver_load(struct drm_device *dev, unsigned long flags)
|
int i810_driver_load(struct drm_device *dev, unsigned long flags)
|
||||||
{
|
{
|
||||||
|
dev->agp = drm_agp_init(dev);
|
||||||
|
if (dev->agp) {
|
||||||
|
dev->agp->agp_mtrr = arch_phys_wc_add(
|
||||||
|
dev->agp->agp_info.aper_base,
|
||||||
|
dev->agp->agp_info.aper_size *
|
||||||
|
1024 * 1024);
|
||||||
|
}
|
||||||
|
|
||||||
/* Our userspace depends upon the agp mapping support. */
|
/* Our userspace depends upon the agp mapping support. */
|
||||||
if (!dev->agp)
|
if (!dev->agp)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -1249,19 +1257,3 @@ const struct drm_ioctl_desc i810_ioctls[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int i810_max_ioctl = ARRAY_SIZE(i810_ioctls);
|
int i810_max_ioctl = ARRAY_SIZE(i810_ioctls);
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the device really is AGP or not.
|
|
||||||
*
|
|
||||||
* All Intel graphics chipsets are treated as AGP, even if they are really
|
|
||||||
* PCI-e.
|
|
||||||
*
|
|
||||||
* \param dev The device to be tested.
|
|
||||||
*
|
|
||||||
* \returns
|
|
||||||
* A value of 1 is always retured to indictate every i810 is AGP.
|
|
||||||
*/
|
|
||||||
int i810_driver_device_is_agp(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ static struct drm_driver driver = {
|
|||||||
.lastclose = i810_driver_lastclose,
|
.lastclose = i810_driver_lastclose,
|
||||||
.preclose = i810_driver_preclose,
|
.preclose = i810_driver_preclose,
|
||||||
.set_busid = drm_pci_set_busid,
|
.set_busid = drm_pci_set_busid,
|
||||||
.device_is_agp = i810_driver_device_is_agp,
|
|
||||||
.dma_quiescent = i810_driver_dma_quiescent,
|
.dma_quiescent = i810_driver_dma_quiescent,
|
||||||
.ioctls = i810_ioctls,
|
.ioctls = i810_ioctls,
|
||||||
.fops = &i810_driver_fops,
|
.fops = &i810_driver_fops,
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ extern int i810_driver_load(struct drm_device *, unsigned long flags);
|
|||||||
extern void i810_driver_lastclose(struct drm_device *dev);
|
extern void i810_driver_lastclose(struct drm_device *dev);
|
||||||
extern void i810_driver_preclose(struct drm_device *dev,
|
extern void i810_driver_preclose(struct drm_device *dev,
|
||||||
struct drm_file *file_priv);
|
struct drm_file *file_priv);
|
||||||
extern int i810_driver_device_is_agp(struct drm_device *dev);
|
|
||||||
|
|
||||||
extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
|
extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
|
||||||
extern const struct drm_ioctl_desc i810_ioctls[];
|
extern const struct drm_ioctl_desc i810_ioctls[];
|
||||||
|
|||||||
@@ -11092,7 +11092,7 @@ static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
|
|||||||
return PTR_ERR(plane_state);
|
return PTR_ERR(plane_state);
|
||||||
|
|
||||||
if (mode)
|
if (mode)
|
||||||
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
|
drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
|
||||||
else
|
else
|
||||||
hdisplay = vdisplay = 0;
|
hdisplay = vdisplay = 0;
|
||||||
|
|
||||||
@@ -12981,7 +12981,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
|
|||||||
* computation to clearly distinguish it from the adjusted mode, which
|
* computation to clearly distinguish it from the adjusted mode, which
|
||||||
* can be changed by the connectors in the below retry loop.
|
* can be changed by the connectors in the below retry loop.
|
||||||
*/
|
*/
|
||||||
drm_crtc_get_hv_timing(&pipe_config->base.mode,
|
drm_mode_get_hv_timing(&pipe_config->base.mode,
|
||||||
&pipe_config->pipe_src_w,
|
&pipe_config->pipe_src_w,
|
||||||
&pipe_config->pipe_src_h);
|
&pipe_config->pipe_src_h);
|
||||||
|
|
||||||
|
|||||||
@@ -1713,7 +1713,9 @@ found:
|
|||||||
* VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
|
* VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
|
||||||
*/
|
*/
|
||||||
pipe_config->limited_color_range =
|
pipe_config->limited_color_range =
|
||||||
bpp != 18 && drm_match_cea_mode(adjusted_mode) > 1;
|
bpp != 18 &&
|
||||||
|
drm_default_rgb_quant_range(adjusted_mode) ==
|
||||||
|
HDMI_QUANTIZATION_RANGE_LIMITED;
|
||||||
} else {
|
} else {
|
||||||
pipe_config->limited_color_range =
|
pipe_config->limited_color_range =
|
||||||
intel_dp->limited_color_range;
|
intel_dp->limited_color_range;
|
||||||
|
|||||||
@@ -587,7 +587,8 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba
|
|||||||
|
|
||||||
/* create encoders */
|
/* create encoders */
|
||||||
intel_dp_create_fake_mst_encoders(intel_dig_port);
|
intel_dp_create_fake_mst_encoders(intel_dig_port);
|
||||||
ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev->dev, &intel_dp->aux, 16, 3, conn_base_id);
|
ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev,
|
||||||
|
&intel_dp->aux, 16, 3, conn_base_id);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
intel_dp->can_mst = false;
|
intel_dp->can_mst = false;
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -455,24 +455,23 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
|
|||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
|
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
|
||||||
|
const struct drm_display_mode *adjusted_mode =
|
||||||
|
&crtc_state->base.adjusted_mode;
|
||||||
union hdmi_infoframe frame;
|
union hdmi_infoframe frame;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
|
ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
|
||||||
&crtc_state->base.adjusted_mode);
|
adjusted_mode);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
DRM_ERROR("couldn't fill AVI infoframe\n");
|
DRM_ERROR("couldn't fill AVI infoframe\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intel_hdmi->rgb_quant_range_selectable) {
|
drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode,
|
||||||
if (crtc_state->limited_color_range)
|
crtc_state->limited_color_range ?
|
||||||
frame.avi.quantization_range =
|
HDMI_QUANTIZATION_RANGE_LIMITED :
|
||||||
HDMI_QUANTIZATION_RANGE_LIMITED;
|
HDMI_QUANTIZATION_RANGE_FULL,
|
||||||
else
|
intel_hdmi->rgb_quant_range_selectable);
|
||||||
frame.avi.quantization_range =
|
|
||||||
HDMI_QUANTIZATION_RANGE_FULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
intel_write_infoframe(encoder, crtc_state, &frame);
|
intel_write_infoframe(encoder, crtc_state, &frame);
|
||||||
}
|
}
|
||||||
@@ -1330,7 +1329,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
|
|||||||
/* See CEA-861-E - 5.1 Default Encoding Parameters */
|
/* See CEA-861-E - 5.1 Default Encoding Parameters */
|
||||||
pipe_config->limited_color_range =
|
pipe_config->limited_color_range =
|
||||||
pipe_config->has_hdmi_sink &&
|
pipe_config->has_hdmi_sink &&
|
||||||
drm_match_cea_mode(adjusted_mode) > 1;
|
drm_default_rgb_quant_range(adjusted_mode) ==
|
||||||
|
HDMI_QUANTIZATION_RANGE_LIMITED;
|
||||||
} else {
|
} else {
|
||||||
pipe_config->limited_color_range =
|
pipe_config->limited_color_range =
|
||||||
intel_hdmi->limited_color_range;
|
intel_hdmi->limited_color_range;
|
||||||
|
|||||||
@@ -392,6 +392,24 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags)
|
|||||||
drm_mga_private_t *dev_priv;
|
drm_mga_private_t *dev_priv;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* There are PCI versions of the G450. These cards have the
|
||||||
|
* same PCI ID as the AGP G450, but have an additional PCI-to-PCI
|
||||||
|
* bridge chip. We detect these cards, which are not currently
|
||||||
|
* supported by this driver, by looking at the device ID of the
|
||||||
|
* bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the
|
||||||
|
* device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
|
||||||
|
* device.
|
||||||
|
*/
|
||||||
|
if ((dev->pdev->device == 0x0525) && dev->pdev->bus->self
|
||||||
|
&& (dev->pdev->bus->self->vendor == 0x3388)
|
||||||
|
&& (dev->pdev->bus->self->device == 0x0021)
|
||||||
|
&& dev->agp) {
|
||||||
|
/* FIXME: This should be quirked in the pci core, but oh well
|
||||||
|
* the hw probably stopped existing. */
|
||||||
|
arch_phys_wc_del(dev->agp->agp_mtrr);
|
||||||
|
kfree(dev->agp);
|
||||||
|
dev->agp = NULL;
|
||||||
|
}
|
||||||
dev_priv = kzalloc(sizeof(drm_mga_private_t), GFP_KERNEL);
|
dev_priv = kzalloc(sizeof(drm_mga_private_t), GFP_KERNEL);
|
||||||
if (!dev_priv)
|
if (!dev_priv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -698,7 +716,7 @@ static int mga_do_pci_dma_bootstrap(struct drm_device *dev,
|
|||||||
static int mga_do_dma_bootstrap(struct drm_device *dev,
|
static int mga_do_dma_bootstrap(struct drm_device *dev,
|
||||||
drm_mga_dma_bootstrap_t *dma_bs)
|
drm_mga_dma_bootstrap_t *dma_bs)
|
||||||
{
|
{
|
||||||
const int is_agp = (dma_bs->agp_mode != 0) && drm_pci_device_is_agp(dev);
|
const int is_agp = (dma_bs->agp_mode != 0) && dev->agp;
|
||||||
int err;
|
int err;
|
||||||
drm_mga_private_t *const dev_priv =
|
drm_mga_private_t *const dev_priv =
|
||||||
(drm_mga_private_t *) dev->dev_private;
|
(drm_mga_private_t *) dev->dev_private;
|
||||||
|
|||||||
@@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
#include <drm/drm_pciids.h>
|
#include <drm/drm_pciids.h>
|
||||||
|
|
||||||
static int mga_driver_device_is_agp(struct drm_device *dev);
|
|
||||||
|
|
||||||
static struct pci_device_id pciidlist[] = {
|
static struct pci_device_id pciidlist[] = {
|
||||||
mga_PCI_IDS
|
mga_PCI_IDS
|
||||||
};
|
};
|
||||||
@@ -66,7 +64,6 @@ static struct drm_driver driver = {
|
|||||||
.lastclose = mga_driver_lastclose,
|
.lastclose = mga_driver_lastclose,
|
||||||
.set_busid = drm_pci_set_busid,
|
.set_busid = drm_pci_set_busid,
|
||||||
.dma_quiescent = mga_driver_dma_quiescent,
|
.dma_quiescent = mga_driver_dma_quiescent,
|
||||||
.device_is_agp = mga_driver_device_is_agp,
|
|
||||||
.get_vblank_counter = mga_get_vblank_counter,
|
.get_vblank_counter = mga_get_vblank_counter,
|
||||||
.enable_vblank = mga_enable_vblank,
|
.enable_vblank = mga_enable_vblank,
|
||||||
.disable_vblank = mga_disable_vblank,
|
.disable_vblank = mga_disable_vblank,
|
||||||
@@ -107,37 +104,3 @@ module_exit(mga_exit);
|
|||||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||||
MODULE_LICENSE("GPL and additional rights");
|
MODULE_LICENSE("GPL and additional rights");
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the device really is AGP or not.
|
|
||||||
*
|
|
||||||
* In addition to the usual tests performed by \c drm_device_is_agp, this
|
|
||||||
* function detects PCI G450 cards that appear to the system exactly like
|
|
||||||
* AGP G450 cards.
|
|
||||||
*
|
|
||||||
* \param dev The device to be tested.
|
|
||||||
*
|
|
||||||
* \returns
|
|
||||||
* If the device is a PCI G450, zero is returned. Otherwise 2 is returned.
|
|
||||||
*/
|
|
||||||
static int mga_driver_device_is_agp(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
const struct pci_dev *const pdev = dev->pdev;
|
|
||||||
|
|
||||||
/* There are PCI versions of the G450. These cards have the
|
|
||||||
* same PCI ID as the AGP G450, but have an additional PCI-to-PCI
|
|
||||||
* bridge chip. We detect these cards, which are not currently
|
|
||||||
* supported by this driver, by looking at the device ID of the
|
|
||||||
* bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the
|
|
||||||
* device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
|
|
||||||
* device.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((pdev->device == 0x0525) && pdev->bus->self
|
|
||||||
&& (pdev->bus->self->vendor == 0x3388)
|
|
||||||
&& (pdev->bus->self->device == 0x0021)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
|
|||||||
if (!nvxx_device(device)->func->pci)
|
if (!nvxx_device(device)->func->pci)
|
||||||
getparam->value = 3;
|
getparam->value = 3;
|
||||||
else
|
else
|
||||||
if (drm_pci_device_is_agp(dev))
|
if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
|
||||||
getparam->value = 0;
|
getparam->value = 0;
|
||||||
else
|
else
|
||||||
if (!pci_is_pcie(dev->pdev))
|
if (!pci_is_pcie(dev->pdev))
|
||||||
|
|||||||
@@ -3417,7 +3417,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max,
|
|||||||
mstm->outp = outp;
|
mstm->outp = outp;
|
||||||
mstm->mgr.cbs = &nv50_mstm;
|
mstm->mgr.cbs = &nv50_mstm;
|
||||||
|
|
||||||
ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev->dev, aux, aux_max,
|
ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev, aux, aux_max,
|
||||||
max_payloads, conn_base_id);
|
max_payloads, conn_base_id);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -123,13 +123,4 @@ int omap_debugfs_init(struct drm_minor *minor)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void omap_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(omap_debugfs_list,
|
|
||||||
ARRAY_SIZE(omap_debugfs_list), minor);
|
|
||||||
if (dmm_is_available())
|
|
||||||
drm_debugfs_remove_files(omap_dmm_debugfs_list,
|
|
||||||
ARRAY_SIZE(omap_dmm_debugfs_list), minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -719,7 +719,6 @@ static struct drm_driver omap_drm_driver = {
|
|||||||
.disable_vblank = omap_irq_disable_vblank,
|
.disable_vblank = omap_irq_disable_vblank,
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
.debugfs_init = omap_debugfs_init,
|
.debugfs_init = omap_debugfs_init,
|
||||||
.debugfs_cleanup = omap_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
|
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
|
||||||
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
|
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ struct omap_drm_private {
|
|||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
int omap_debugfs_init(struct drm_minor *minor);
|
int omap_debugfs_init(struct drm_minor *minor);
|
||||||
void omap_debugfs_cleanup(struct drm_minor *minor);
|
|
||||||
void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
|
void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
|
||||||
void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m);
|
void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m);
|
||||||
void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);
|
void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
|
|||||||
VRAM, also but everything into VRAM on AGP cards and older
|
VRAM, also but everything into VRAM on AGP cards and older
|
||||||
IGP chips to avoid image corruptions */
|
IGP chips to avoid image corruptions */
|
||||||
if (p->ring == R600_RING_TYPE_UVD_INDEX &&
|
if (p->ring == R600_RING_TYPE_UVD_INDEX &&
|
||||||
(i == 0 || drm_pci_device_is_agp(p->rdev->ddev) ||
|
(i == 0 || pci_find_capability(p->rdev->ddev->pdev,
|
||||||
|
PCI_CAP_ID_AGP) ||
|
||||||
p->rdev->family == CHIP_RS780 ||
|
p->rdev->family == CHIP_RS780 ||
|
||||||
p->rdev->family == CHIP_RS880)) {
|
p->rdev->family == CHIP_RS880)) {
|
||||||
|
|
||||||
|
|||||||
@@ -1549,8 +1549,6 @@ failed:
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_debugfs_remove_files(struct radeon_device *rdev);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* radeon_device_fini - tear down the driver
|
* radeon_device_fini - tear down the driver
|
||||||
*
|
*
|
||||||
@@ -1577,7 +1575,6 @@ void radeon_device_fini(struct radeon_device *rdev)
|
|||||||
rdev->rmmio = NULL;
|
rdev->rmmio = NULL;
|
||||||
if (rdev->family >= CHIP_BONAIRE)
|
if (rdev->family >= CHIP_BONAIRE)
|
||||||
radeon_doorbell_fini(rdev);
|
radeon_doorbell_fini(rdev);
|
||||||
radeon_debugfs_remove_files(rdev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1954,16 +1951,3 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
|
|||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_debugfs_remove_files(struct radeon_device *rdev)
|
|
||||||
{
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
for (i = 0; i < rdev->debugfs_count; i++) {
|
|
||||||
drm_debugfs_remove_files(rdev->debugfs[i].files,
|
|
||||||
rdev->debugfs[i].num_files,
|
|
||||||
rdev->ddev->primary);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ radeon_dp_mst_init(struct radeon_connector *radeon_connector)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
radeon_connector->mst_mgr.cbs = &mst_cbs;
|
radeon_connector->mst_mgr.cbs = &mst_cbs;
|
||||||
return drm_dp_mst_topology_mgr_init(&radeon_connector->mst_mgr, dev->dev,
|
return drm_dp_mst_topology_mgr_init(&radeon_connector->mst_mgr, dev,
|
||||||
&radeon_connector->ddc_bus->aux, 16, 6,
|
&radeon_connector->ddc_bus->aux, 16, 6,
|
||||||
radeon_connector->base.base.id);
|
radeon_connector->base.base.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
|||||||
dev->dev_private = (void *)rdev;
|
dev->dev_private = (void *)rdev;
|
||||||
|
|
||||||
/* update BUS flag */
|
/* update BUS flag */
|
||||||
if (drm_pci_device_is_agp(dev)) {
|
if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) {
|
||||||
flags |= RADEON_IS_AGP;
|
flags |= RADEON_IS_AGP;
|
||||||
} else if (pci_is_pcie(dev->pdev)) {
|
} else if (pci_is_pcie(dev->pdev)) {
|
||||||
flags |= RADEON_IS_PCIE;
|
flags |= RADEON_IS_PCIE;
|
||||||
|
|||||||
@@ -89,38 +89,9 @@ static struct drm_info_list sti_drm_dbg_list[] = {
|
|||||||
{"fps_get", sti_drm_fps_dbg_show, 0},
|
{"fps_get", sti_drm_fps_dbg_show, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int sti_drm_debugfs_create(struct dentry *root,
|
|
||||||
struct drm_minor *minor,
|
|
||||||
const char *name,
|
|
||||||
const struct file_operations *fops)
|
|
||||||
{
|
|
||||||
struct drm_device *dev = minor->dev;
|
|
||||||
struct drm_info_node *node;
|
|
||||||
struct dentry *ent;
|
|
||||||
|
|
||||||
ent = debugfs_create_file(name, S_IRUGO | S_IWUSR, root, dev, fops);
|
|
||||||
if (IS_ERR(ent))
|
|
||||||
return PTR_ERR(ent);
|
|
||||||
|
|
||||||
node = kmalloc(sizeof(*node), GFP_KERNEL);
|
|
||||||
if (!node) {
|
|
||||||
debugfs_remove(ent);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
node->minor = minor;
|
|
||||||
node->dent = ent;
|
|
||||||
node->info_ent = (void *)fops;
|
|
||||||
|
|
||||||
mutex_lock(&minor->debugfs_lock);
|
|
||||||
list_add(&node->list, &minor->debugfs_list);
|
|
||||||
mutex_unlock(&minor->debugfs_lock);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sti_drm_dbg_init(struct drm_minor *minor)
|
static int sti_drm_dbg_init(struct drm_minor *minor)
|
||||||
{
|
{
|
||||||
|
struct dentry *dentry;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = drm_debugfs_create_files(sti_drm_dbg_list,
|
ret = drm_debugfs_create_files(sti_drm_dbg_list,
|
||||||
@@ -129,10 +100,13 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
ret = sti_drm_debugfs_create(minor->debugfs_root, minor, "fps_show",
|
dentry = debugfs_create_file("fps_show", S_IRUGO | S_IWUSR,
|
||||||
|
minor->debugfs_root, minor->dev,
|
||||||
&sti_drm_fps_fops);
|
&sti_drm_fps_fops);
|
||||||
if (ret)
|
if (!dentry) {
|
||||||
|
ret = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
|
DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -141,15 +115,6 @@ err:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sti_drm_dbg_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(sti_drm_dbg_list,
|
|
||||||
ARRAY_SIZE(sti_drm_dbg_list), minor);
|
|
||||||
|
|
||||||
drm_debugfs_remove_files((struct drm_info_list *)&sti_drm_fps_fops,
|
|
||||||
1, minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sti_atomic_schedule(struct sti_private *private,
|
static void sti_atomic_schedule(struct sti_private *private,
|
||||||
struct drm_atomic_state *state)
|
struct drm_atomic_state *state)
|
||||||
{
|
{
|
||||||
@@ -314,7 +279,6 @@ static struct drm_driver sti_driver = {
|
|||||||
.gem_prime_mmap = drm_gem_cma_prime_mmap,
|
.gem_prime_mmap = drm_gem_cma_prime_mmap,
|
||||||
|
|
||||||
.debugfs_init = sti_drm_dbg_init,
|
.debugfs_init = sti_drm_dbg_init,
|
||||||
.debugfs_cleanup = sti_drm_dbg_cleanup,
|
|
||||||
|
|
||||||
.name = DRIVER_NAME,
|
.name = DRIVER_NAME,
|
||||||
.desc = DRIVER_DESC,
|
.desc = DRIVER_DESC,
|
||||||
|
|||||||
@@ -195,13 +195,6 @@ static struct drm_info_list dvo_debugfs_files[] = {
|
|||||||
{ "dvo", dvo_dbg_show, 0, NULL },
|
{ "dvo", dvo_dbg_show, 0, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dvo_debugfs_exit(struct sti_dvo *dvo, struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(dvo_debugfs_files,
|
|
||||||
ARRAY_SIZE(dvo_debugfs_files),
|
|
||||||
minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
|
static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -514,9 +507,6 @@ static void sti_dvo_unbind(struct device *dev,
|
|||||||
struct device *master, void *data)
|
struct device *master, void *data)
|
||||||
{
|
{
|
||||||
struct sti_dvo *dvo = dev_get_drvdata(dev);
|
struct sti_dvo *dvo = dev_get_drvdata(dev);
|
||||||
struct drm_device *drm_dev = data;
|
|
||||||
|
|
||||||
dvo_debugfs_exit(dvo, drm_dev->primary);
|
|
||||||
|
|
||||||
drm_bridge_remove(dvo->bridge);
|
drm_bridge_remove(dvo->bridge);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,13 +365,6 @@ static struct drm_info_list hda_debugfs_files[] = {
|
|||||||
{ "hda", hda_dbg_show, 0, NULL },
|
{ "hda", hda_dbg_show, 0, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void hda_debugfs_exit(struct sti_hda *hda, struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(hda_debugfs_files,
|
|
||||||
ARRAY_SIZE(hda_debugfs_files),
|
|
||||||
minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
|
static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -739,10 +732,6 @@ err_sysfs:
|
|||||||
static void sti_hda_unbind(struct device *dev,
|
static void sti_hda_unbind(struct device *dev,
|
||||||
struct device *master, void *data)
|
struct device *master, void *data)
|
||||||
{
|
{
|
||||||
struct sti_hda *hda = dev_get_drvdata(dev);
|
|
||||||
struct drm_device *drm_dev = data;
|
|
||||||
|
|
||||||
hda_debugfs_exit(hda, drm_dev->primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct component_ops sti_hda_ops = {
|
static const struct component_ops sti_hda_ops = {
|
||||||
|
|||||||
@@ -731,13 +731,6 @@ static struct drm_info_list hdmi_debugfs_files[] = {
|
|||||||
{ "hdmi", hdmi_dbg_show, 0, NULL },
|
{ "hdmi", hdmi_dbg_show, 0, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void hdmi_debugfs_exit(struct sti_hdmi *hdmi, struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(hdmi_debugfs_files,
|
|
||||||
ARRAY_SIZE(hdmi_debugfs_files),
|
|
||||||
minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
|
static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -1356,10 +1349,6 @@ err_sysfs:
|
|||||||
static void sti_hdmi_unbind(struct device *dev,
|
static void sti_hdmi_unbind(struct device *dev,
|
||||||
struct device *master, void *data)
|
struct device *master, void *data)
|
||||||
{
|
{
|
||||||
struct sti_hdmi *hdmi = dev_get_drvdata(dev);
|
|
||||||
struct drm_device *drm_dev = data;
|
|
||||||
|
|
||||||
hdmi_debugfs_exit(hdmi, drm_dev->primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct component_ops sti_hdmi_ops = {
|
static const struct component_ops sti_hdmi_ops = {
|
||||||
|
|||||||
@@ -567,13 +567,6 @@ static struct drm_info_list tvout_debugfs_files[] = {
|
|||||||
{ "tvout", tvout_dbg_show, 0, NULL },
|
{ "tvout", tvout_dbg_show, 0, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void tvout_debugfs_exit(struct sti_tvout *tvout, struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(tvout_debugfs_files,
|
|
||||||
ARRAY_SIZE(tvout_debugfs_files),
|
|
||||||
minor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
|
static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -627,7 +620,6 @@ static void sti_tvout_early_unregister(struct drm_encoder *encoder)
|
|||||||
if (!tvout->debugfs_registered)
|
if (!tvout->debugfs_registered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tvout_debugfs_exit(tvout, encoder->dev->primary);
|
|
||||||
tvout->debugfs_registered = false;
|
tvout->debugfs_registered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -894,12 +894,6 @@ static int tegra_debugfs_init(struct drm_minor *minor)
|
|||||||
ARRAY_SIZE(tegra_debugfs_list),
|
ARRAY_SIZE(tegra_debugfs_list),
|
||||||
minor->debugfs_root, minor);
|
minor->debugfs_root, minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tegra_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(tegra_debugfs_list,
|
|
||||||
ARRAY_SIZE(tegra_debugfs_list), minor);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct drm_driver tegra_drm_driver = {
|
static struct drm_driver tegra_drm_driver = {
|
||||||
@@ -917,7 +911,6 @@ static struct drm_driver tegra_drm_driver = {
|
|||||||
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
.debugfs_init = tegra_debugfs_init,
|
.debugfs_init = tegra_debugfs_init,
|
||||||
.debugfs_cleanup = tegra_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.gem_free_object_unlocked = tegra_bo_free_object,
|
.gem_free_object_unlocked = tegra_bo_free_object,
|
||||||
|
|||||||
@@ -539,17 +539,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tilcdc_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
struct tilcdc_module *mod;
|
|
||||||
drm_debugfs_remove_files(tilcdc_debugfs_list,
|
|
||||||
ARRAY_SIZE(tilcdc_debugfs_list), minor);
|
|
||||||
|
|
||||||
list_for_each_entry(mod, &module_list, list)
|
|
||||||
if (mod->funcs->debugfs_cleanup)
|
|
||||||
mod->funcs->debugfs_cleanup(mod, minor);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct file_operations fops = {
|
static const struct file_operations fops = {
|
||||||
@@ -589,7 +578,6 @@ static struct drm_driver tilcdc_driver = {
|
|||||||
.gem_prime_mmap = drm_gem_cma_prime_mmap,
|
.gem_prime_mmap = drm_gem_cma_prime_mmap,
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
.debugfs_init = tilcdc_debugfs_init,
|
.debugfs_init = tilcdc_debugfs_init,
|
||||||
.debugfs_cleanup = tilcdc_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
.fops = &fops,
|
.fops = &fops,
|
||||||
.name = "tilcdc",
|
.name = "tilcdc",
|
||||||
|
|||||||
@@ -111,8 +111,6 @@ struct tilcdc_module_ops {
|
|||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
/* create debugfs nodes (can be NULL): */
|
/* create debugfs nodes (can be NULL): */
|
||||||
int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor);
|
int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor);
|
||||||
/* cleanup debugfs nodes (can be NULL): */
|
|
||||||
void (*debugfs_cleanup)(struct tilcdc_module *mod, struct drm_minor *minor);
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1670,7 +1670,6 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
|
|||||||
struct ttm_buffer_object *bo;
|
struct ttm_buffer_object *bo;
|
||||||
int ret = -EBUSY;
|
int ret = -EBUSY;
|
||||||
int put_count;
|
int put_count;
|
||||||
uint32_t swap_placement = (TTM_PL_FLAG_CACHED | TTM_PL_FLAG_SYSTEM);
|
|
||||||
|
|
||||||
spin_lock(&glob->lru_lock);
|
spin_lock(&glob->lru_lock);
|
||||||
list_for_each_entry(bo, &glob->swap_lru, swap) {
|
list_for_each_entry(bo, &glob->swap_lru, swap) {
|
||||||
@@ -1701,7 +1700,8 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
|
|||||||
* Move to system cached
|
* Move to system cached
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((bo->mem.placement & swap_placement) != swap_placement) {
|
if (bo->mem.mem_type != TTM_PL_SYSTEM ||
|
||||||
|
bo->ttm->caching_state != tt_cached) {
|
||||||
struct ttm_mem_reg evict_mem;
|
struct ttm_mem_reg evict_mem;
|
||||||
|
|
||||||
evict_mem = bo->mem;
|
evict_mem = bo->mem;
|
||||||
|
|||||||
@@ -36,9 +36,3 @@ vc4_debugfs_init(struct drm_minor *minor)
|
|||||||
return drm_debugfs_create_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES,
|
return drm_debugfs_create_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES,
|
||||||
minor->debugfs_root, minor);
|
minor->debugfs_root, minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
vc4_debugfs_cleanup(struct drm_minor *minor)
|
|
||||||
{
|
|
||||||
drm_debugfs_remove_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES, minor);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ static struct drm_driver vc4_drm_driver = {
|
|||||||
|
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
.debugfs_init = vc4_debugfs_init,
|
.debugfs_init = vc4_debugfs_init,
|
||||||
.debugfs_cleanup = vc4_debugfs_cleanup,
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.gem_create_object = vc4_create_object,
|
.gem_create_object = vc4_create_object,
|
||||||
|
|||||||
@@ -457,7 +457,6 @@ int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id,
|
|||||||
|
|
||||||
/* vc4_debugfs.c */
|
/* vc4_debugfs.c */
|
||||||
int vc4_debugfs_init(struct drm_minor *minor);
|
int vc4_debugfs_init(struct drm_minor *minor);
|
||||||
void vc4_debugfs_cleanup(struct drm_minor *minor);
|
|
||||||
|
|
||||||
/* vc4_drv.c */
|
/* vc4_drv.c */
|
||||||
void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index);
|
void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index);
|
||||||
|
|||||||
@@ -356,15 +356,11 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vc4_encoder->rgb_range_selectable) {
|
drm_hdmi_avi_infoframe_quant_range(&frame.avi, mode,
|
||||||
if (vc4_encoder->limited_rgb_range) {
|
vc4_encoder->limited_rgb_range ?
|
||||||
frame.avi.quantization_range =
|
HDMI_QUANTIZATION_RANGE_LIMITED :
|
||||||
HDMI_QUANTIZATION_RANGE_LIMITED;
|
HDMI_QUANTIZATION_RANGE_FULL,
|
||||||
} else {
|
vc4_encoder->rgb_range_selectable);
|
||||||
frame.avi.quantization_range =
|
|
||||||
HDMI_QUANTIZATION_RANGE_FULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vc4_hdmi_write_infoframe(encoder, &frame);
|
vc4_hdmi_write_infoframe(encoder, &frame);
|
||||||
}
|
}
|
||||||
@@ -463,7 +459,9 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder,
|
|||||||
csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR,
|
csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR,
|
||||||
VC4_HD_CSC_CTL_ORDER);
|
VC4_HD_CSC_CTL_ORDER);
|
||||||
|
|
||||||
if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) {
|
if (vc4_encoder->hdmi_monitor &&
|
||||||
|
drm_default_rgb_quant_range(mode) ==
|
||||||
|
HDMI_QUANTIZATION_RANGE_LIMITED) {
|
||||||
/* CEA VICs other than #1 requre limited range RGB
|
/* CEA VICs other than #1 requre limited range RGB
|
||||||
* output unless overridden by an AVI infoframe.
|
* output unless overridden by an AVI infoframe.
|
||||||
* Apply a colorspace conversion to squash 0-255 down
|
* Apply a colorspace conversion to squash 0-255 down
|
||||||
|
|||||||
@@ -190,12 +190,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
|
|||||||
|
|
||||||
/* Expose the fence via the dma-buf */
|
/* Expose the fence via the dma-buf */
|
||||||
ret = 0;
|
ret = 0;
|
||||||
ww_mutex_lock(&resv->lock, NULL);
|
reservation_object_lock(resv, NULL);
|
||||||
if (arg->flags & VGEM_FENCE_WRITE)
|
if (arg->flags & VGEM_FENCE_WRITE)
|
||||||
reservation_object_add_excl_fence(resv, fence);
|
reservation_object_add_excl_fence(resv, fence);
|
||||||
else if ((ret = reservation_object_reserve_shared(resv)) == 0)
|
else if ((ret = reservation_object_reserve_shared(resv)) == 0)
|
||||||
reservation_object_add_shared_fence(resv, fence);
|
reservation_object_add_shared_fence(resv, fence);
|
||||||
ww_mutex_unlock(&resv->lock);
|
reservation_object_unlock(resv);
|
||||||
|
|
||||||
/* Record the fence in our idr for later signaling */
|
/* Record the fence in our idr for later signaling */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
|||||||
@@ -790,21 +790,6 @@ extern void drm_sysfs_hotplug_event(struct drm_device *dev);
|
|||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/* PCI section */
|
|
||||||
static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
if (dev->driver->device_is_agp != NULL) {
|
|
||||||
int err = (*dev->driver->device_is_agp) (dev);
|
|
||||||
|
|
||||||
if (err != 2) {
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
|
|
||||||
}
|
|
||||||
void drm_pci_agp_destroy(struct drm_device *dev);
|
|
||||||
|
|
||||||
extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
|
extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
|
||||||
extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
|
extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ struct drm_crtc_commit {
|
|||||||
/**
|
/**
|
||||||
* @commit_entry:
|
* @commit_entry:
|
||||||
*
|
*
|
||||||
* Entry on the per-CRTC commit_list. Protected by crtc->commit_lock.
|
* Entry on the per-CRTC &drm_crtc.commit_list. Protected by
|
||||||
|
* $drm_crtc.commit_lock.
|
||||||
*/
|
*/
|
||||||
struct list_head commit_entry;
|
struct list_head commit_entry;
|
||||||
|
|
||||||
@@ -429,7 +430,8 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
|||||||
*
|
*
|
||||||
* For example if the CRTC mode has changed, and the hardware is able to enact
|
* For example if the CRTC mode has changed, and the hardware is able to enact
|
||||||
* the requested mode change without going through a full modeset, the driver
|
* the requested mode change without going through a full modeset, the driver
|
||||||
* should clear mode_changed during its ->atomic_check.
|
* should clear mode_changed in its &drm_mode_config_funcs.atomic_check
|
||||||
|
* implementation.
|
||||||
*/
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
drm_atomic_crtc_needs_modeset(const struct drm_crtc_state *state)
|
drm_atomic_crtc_needs_modeset(const struct drm_crtc_state *state)
|
||||||
|
|||||||
@@ -177,7 +177,8 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
|
|||||||
*
|
*
|
||||||
* This iterates over the current state, useful (for example) when applying
|
* This iterates over the current state, useful (for example) when applying
|
||||||
* atomic state after it has been checked and swapped. To iterate over the
|
* atomic state after it has been checked and swapped. To iterate over the
|
||||||
* planes which *will* be attached (for ->atomic_check()) see
|
* planes which *will* be attached (more useful in code called from
|
||||||
|
* &drm_mode_config_funcs.atomic_check) see
|
||||||
* drm_atomic_crtc_state_for_each_plane().
|
* drm_atomic_crtc_state_for_each_plane().
|
||||||
*/
|
*/
|
||||||
#define drm_atomic_crtc_for_each_plane(plane, crtc) \
|
#define drm_atomic_crtc_for_each_plane(plane, crtc) \
|
||||||
@@ -189,8 +190,9 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
|
|||||||
* @crtc_state: the incoming crtc-state
|
* @crtc_state: the incoming crtc-state
|
||||||
*
|
*
|
||||||
* Similar to drm_crtc_for_each_plane(), but iterates the planes that will be
|
* Similar to drm_crtc_for_each_plane(), but iterates the planes that will be
|
||||||
* attached if the specified state is applied. Useful during (for example)
|
* attached if the specified state is applied. Useful during for example
|
||||||
* ->atomic_check() operations, to validate the incoming state.
|
* in code called from &drm_mode_config_funcs.atomic_check operations, to
|
||||||
|
* validate the incoming state.
|
||||||
*/
|
*/
|
||||||
#define drm_atomic_crtc_state_for_each_plane(plane, crtc_state) \
|
#define drm_atomic_crtc_state_for_each_plane(plane, crtc_state) \
|
||||||
drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask)
|
drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask)
|
||||||
@@ -202,8 +204,9 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
|
|||||||
* @crtc_state: the incoming crtc-state
|
* @crtc_state: the incoming crtc-state
|
||||||
*
|
*
|
||||||
* Similar to drm_crtc_for_each_plane(), but iterates the planes that will be
|
* Similar to drm_crtc_for_each_plane(), but iterates the planes that will be
|
||||||
* attached if the specified state is applied. Useful during (for example)
|
* attached if the specified state is applied. Useful during for example
|
||||||
* ->atomic_check() operations, to validate the incoming state.
|
* in code called from &drm_mode_config_funcs.atomic_check operations, to
|
||||||
|
* validate the incoming state.
|
||||||
*
|
*
|
||||||
* Compared to just drm_atomic_crtc_state_for_each_plane() this also fills in a
|
* Compared to just drm_atomic_crtc_state_for_each_plane() this also fills in a
|
||||||
* const plane_state. This is useful when a driver just wants to peek at other
|
* const plane_state. This is useful when a driver just wants to peek at other
|
||||||
|
|||||||
@@ -43,18 +43,18 @@ struct drm_master {
|
|||||||
struct kref refcount;
|
struct kref refcount;
|
||||||
struct drm_device *dev;
|
struct drm_device *dev;
|
||||||
/**
|
/**
|
||||||
* @unique: Unique identifier: e.g. busid. Protected by struct
|
* @unique: Unique identifier: e.g. busid. Protected by
|
||||||
* &drm_device master_mutex.
|
* &drm_device.master_mutex.
|
||||||
*/
|
*/
|
||||||
char *unique;
|
char *unique;
|
||||||
/**
|
/**
|
||||||
* @unique_len: Length of unique field. Protected by &struct drm_device
|
* @unique_len: Length of unique field. Protected by
|
||||||
* master_mutex.
|
* &drm_device.master_mutex.
|
||||||
*/
|
*/
|
||||||
int unique_len;
|
int unique_len;
|
||||||
/**
|
/**
|
||||||
* @magic_map: Map of used authentication tokens. Protected by struct
|
* @magic_map: Map of used authentication tokens. Protected by
|
||||||
* &drm_device master_mutex.
|
* &drm_device.master_mutex.
|
||||||
*/
|
*/
|
||||||
struct idr magic_map;
|
struct idr magic_map;
|
||||||
struct drm_lock_data lock;
|
struct drm_lock_data lock;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
|
|||||||
int gamma_size);
|
int gamma_size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_color_lut_extract - clamp&round LUT entries
|
* drm_color_lut_extract - clamp and round LUT entries
|
||||||
* @user_input: input value
|
* @user_input: input value
|
||||||
* @bit_precision: number of bits the hw LUT supports
|
* @bit_precision: number of bits the hw LUT supports
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -331,15 +331,15 @@ struct drm_connector_funcs {
|
|||||||
*
|
*
|
||||||
* Entry point for output detection and basic mode validation. The
|
* Entry point for output detection and basic mode validation. The
|
||||||
* driver should reprobe the output if needed (e.g. when hotplug
|
* driver should reprobe the output if needed (e.g. when hotplug
|
||||||
* handling is unreliable), add all detected modes to connector->modes
|
* handling is unreliable), add all detected modes to &drm_connector.modes
|
||||||
* and filter out any the device can't support in any configuration. It
|
* and filter out any the device can't support in any configuration. It
|
||||||
* also needs to filter out any modes wider or higher than the
|
* also needs to filter out any modes wider or higher than the
|
||||||
* parameters max_width and max_height indicate.
|
* parameters max_width and max_height indicate.
|
||||||
*
|
*
|
||||||
* The drivers must also prune any modes no longer valid from
|
* The drivers must also prune any modes no longer valid from
|
||||||
* connector->modes. Furthermore it must update connector->status and
|
* &drm_connector.modes. Furthermore it must update
|
||||||
* connector->edid. If no EDID has been received for this output
|
* &drm_connector.status and &drm_connector.edid. If no EDID has been
|
||||||
* connector->edid must be NULL.
|
* received for this output connector->edid must be NULL.
|
||||||
*
|
*
|
||||||
* Drivers using the probe helpers should use
|
* Drivers using the probe helpers should use
|
||||||
* drm_helper_probe_single_connector_modes() or
|
* drm_helper_probe_single_connector_modes() or
|
||||||
@@ -348,7 +348,7 @@ struct drm_connector_funcs {
|
|||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
*
|
*
|
||||||
* The number of modes detected and filled into connector->modes.
|
* The number of modes detected and filled into &drm_connector.modes.
|
||||||
*/
|
*/
|
||||||
int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
|
int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ struct drm_connector_funcs {
|
|||||||
* core drm connector interfaces. Everything added from this callback
|
* core drm connector interfaces. Everything added from this callback
|
||||||
* should be unregistered in the early_unregister callback.
|
* should be unregistered in the early_unregister callback.
|
||||||
*
|
*
|
||||||
* This is called while holding drm_connector->mutex.
|
* This is called while holding &drm_connector.mutex.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
*
|
*
|
||||||
@@ -398,7 +398,7 @@ struct drm_connector_funcs {
|
|||||||
* early in the driver unload sequence to disable userspace access
|
* early in the driver unload sequence to disable userspace access
|
||||||
* before data structures are torndown.
|
* before data structures are torndown.
|
||||||
*
|
*
|
||||||
* This is called while holding drm_connector->mutex.
|
* This is called while holding &drm_connector.mutex.
|
||||||
*/
|
*/
|
||||||
void (*early_unregister)(struct drm_connector *connector);
|
void (*early_unregister)(struct drm_connector *connector);
|
||||||
|
|
||||||
@@ -418,9 +418,9 @@ struct drm_connector_funcs {
|
|||||||
* Duplicate the current atomic state for this connector and return it.
|
* Duplicate the current atomic state for this connector and return it.
|
||||||
* The core and helpers guarantee that any atomic state duplicated with
|
* The core and helpers guarantee that any atomic state duplicated with
|
||||||
* this hook and still owned by the caller (i.e. not transferred to the
|
* this hook and still owned by the caller (i.e. not transferred to the
|
||||||
* driver by calling ->atomic_commit() from struct
|
* driver by calling &drm_mode_config_funcs.atomic_commit) will be
|
||||||
* &drm_mode_config_funcs) will be cleaned up by calling the
|
* cleaned up by calling the @atomic_destroy_state hook in this
|
||||||
* @atomic_destroy_state hook in this structure.
|
* structure.
|
||||||
*
|
*
|
||||||
* Atomic drivers which don't subclass &struct drm_connector_state should use
|
* Atomic drivers which don't subclass &struct drm_connector_state should use
|
||||||
* drm_atomic_helper_connector_duplicate_state(). Drivers that subclass the
|
* drm_atomic_helper_connector_duplicate_state(). Drivers that subclass the
|
||||||
@@ -428,7 +428,7 @@ struct drm_connector_funcs {
|
|||||||
* __drm_atomic_helper_connector_duplicate_state() to make sure shared state is
|
* __drm_atomic_helper_connector_duplicate_state() to make sure shared state is
|
||||||
* duplicated in a consistent fashion across drivers.
|
* duplicated in a consistent fashion across drivers.
|
||||||
*
|
*
|
||||||
* It is an error to call this hook before connector->state has been
|
* It is an error to call this hook before &drm_connector.state has been
|
||||||
* initialized correctly.
|
* initialized correctly.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
@@ -609,8 +609,8 @@ struct drm_connector {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @mutex: Lock for general connector state, but currently only protects
|
* @mutex: Lock for general connector state, but currently only protects
|
||||||
* @registered. Most of the connector state is still protected by the
|
* @registered. Most of the connector state is still protected by
|
||||||
* mutex in &drm_mode_config.
|
* &drm_mode_config.mutex.
|
||||||
*/
|
*/
|
||||||
struct mutex mutex;
|
struct mutex mutex;
|
||||||
|
|
||||||
@@ -636,22 +636,22 @@ struct drm_connector {
|
|||||||
/**
|
/**
|
||||||
* @modes:
|
* @modes:
|
||||||
* Modes available on this connector (from fill_modes() + user).
|
* Modes available on this connector (from fill_modes() + user).
|
||||||
* Protected by dev->mode_config.mutex.
|
* Protected by &drm_mode_config.mutex.
|
||||||
*/
|
*/
|
||||||
struct list_head modes; /* list of modes on this connector */
|
struct list_head modes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @status:
|
* @status:
|
||||||
* One of the drm_connector_status enums (connected, not, or unknown).
|
* One of the drm_connector_status enums (connected, not, or unknown).
|
||||||
* Protected by dev->mode_config.mutex.
|
* Protected by &drm_mode_config.mutex.
|
||||||
*/
|
*/
|
||||||
enum drm_connector_status status;
|
enum drm_connector_status status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @probed_modes:
|
* @probed_modes:
|
||||||
* These are modes added by probing with DDC or the BIOS, before
|
* These are modes added by probing with DDC or the BIOS, before
|
||||||
* filtering is applied. Used by the probe helpers.Protected by
|
* filtering is applied. Used by the probe helpers. Protected by
|
||||||
* dev->mode_config.mutex.
|
* &drm_mode_config.mutex.
|
||||||
*/
|
*/
|
||||||
struct list_head probed_modes;
|
struct list_head probed_modes;
|
||||||
|
|
||||||
@@ -659,10 +659,10 @@ struct drm_connector {
|
|||||||
* @display_info: Display information is filled from EDID information
|
* @display_info: Display information is filled from EDID information
|
||||||
* when a display is detected. For non hot-pluggable displays such as
|
* when a display is detected. For non hot-pluggable displays such as
|
||||||
* flat panels in embedded systems, the driver should initialize the
|
* flat panels in embedded systems, the driver should initialize the
|
||||||
* display_info.width_mm and display_info.height_mm fields with the
|
* &drm_display_info.width_mm and &drm_display_info.height_mm fields
|
||||||
* physical size of the display.
|
* with the physical size of the display.
|
||||||
*
|
*
|
||||||
* Protected by dev->mode_config.mutex.
|
* Protected by &drm_mode_config.mutex.
|
||||||
*/
|
*/
|
||||||
struct drm_display_info display_info;
|
struct drm_display_info display_info;
|
||||||
const struct drm_connector_funcs *funcs;
|
const struct drm_connector_funcs *funcs;
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ struct drm_plane_helper_funcs;
|
|||||||
* @enable: whether the CRTC should be enabled, gates all other state
|
* @enable: whether the CRTC should be enabled, gates all other state
|
||||||
* @active: whether the CRTC is actively displaying (used for DPMS)
|
* @active: whether the CRTC is actively displaying (used for DPMS)
|
||||||
* @planes_changed: planes on this crtc are updated
|
* @planes_changed: planes on this crtc are updated
|
||||||
* @mode_changed: crtc_state->mode or crtc_state->enable has been changed
|
* @mode_changed: @mode or @enable has been changed
|
||||||
* @active_changed: crtc_state->active has been toggled.
|
* @active_changed: @active has been toggled.
|
||||||
* @connectors_changed: connectors to this crtc have been updated
|
* @connectors_changed: connectors to this crtc have been updated
|
||||||
* @zpos_changed: zpos values of planes on this crtc have been updated
|
* @zpos_changed: zpos values of planes on this crtc have been updated
|
||||||
* @color_mgmt_changed: color management properties have changed (degamma or
|
* @color_mgmt_changed: color management properties have changed (degamma or
|
||||||
@@ -102,9 +102,10 @@ struct drm_plane_helper_funcs;
|
|||||||
*
|
*
|
||||||
* Note that the distinction between @enable and @active is rather subtile:
|
* Note that the distinction between @enable and @active is rather subtile:
|
||||||
* Flipping @active while @enable is set without changing anything else may
|
* Flipping @active while @enable is set without changing anything else may
|
||||||
* never return in a failure from the ->atomic_check callback. Userspace assumes
|
* never return in a failure from the &drm_mode_config_funcs.atomic_check
|
||||||
* that a DPMS On will always succeed. In other words: @enable controls resource
|
* callback. Userspace assumes that a DPMS On will always succeed. In other
|
||||||
* assignment, @active controls the actual hardware state.
|
* words: @enable controls resource assignment, @active controls the actual
|
||||||
|
* hardware state.
|
||||||
*
|
*
|
||||||
* The three booleans active_changed, connectors_changed and mode_changed are
|
* The three booleans active_changed, connectors_changed and mode_changed are
|
||||||
* intended to indicate whether a full modeset is needed, rather than strictly
|
* intended to indicate whether a full modeset is needed, rather than strictly
|
||||||
@@ -346,8 +347,8 @@ struct drm_crtc_funcs {
|
|||||||
* through the DRM_MODE_PAGE_FLIP_ASYNC flag). When an application
|
* through the DRM_MODE_PAGE_FLIP_ASYNC flag). When an application
|
||||||
* requests a page flip the DRM core verifies that the new frame buffer
|
* requests a page flip the DRM core verifies that the new frame buffer
|
||||||
* is large enough to be scanned out by the CRTC in the currently
|
* is large enough to be scanned out by the CRTC in the currently
|
||||||
* configured mode and then calls the CRTC ->page_flip() operation with a
|
* configured mode and then calls this hook with a pointer to the new
|
||||||
* pointer to the new frame buffer.
|
* frame buffer.
|
||||||
*
|
*
|
||||||
* The driver must wait for any pending rendering to the new framebuffer
|
* The driver must wait for any pending rendering to the new framebuffer
|
||||||
* to complete before executing the flip. It should also wait for any
|
* to complete before executing the flip. It should also wait for any
|
||||||
@@ -382,7 +383,7 @@ struct drm_crtc_funcs {
|
|||||||
* RETURNS:
|
* RETURNS:
|
||||||
*
|
*
|
||||||
* 0 on success or a negative error code on failure. Note that if a
|
* 0 on success or a negative error code on failure. Note that if a
|
||||||
* ->page_flip() operation is already pending the callback should return
|
* page flip operation is already pending the callback should return
|
||||||
* -EBUSY. Pageflips on a disabled CRTC (either by setting a NULL mode
|
* -EBUSY. Pageflips on a disabled CRTC (either by setting a NULL mode
|
||||||
* or just runtime disabled through DPMS respectively the new atomic
|
* or just runtime disabled through DPMS respectively the new atomic
|
||||||
* "ACTIVE" state) should result in an -EINVAL error code. Note that
|
* "ACTIVE" state) should result in an -EINVAL error code. Note that
|
||||||
@@ -434,19 +435,19 @@ struct drm_crtc_funcs {
|
|||||||
* @atomic_duplicate_state:
|
* @atomic_duplicate_state:
|
||||||
*
|
*
|
||||||
* Duplicate the current atomic state for this CRTC and return it.
|
* Duplicate the current atomic state for this CRTC and return it.
|
||||||
* The core and helpers gurantee that any atomic state duplicated with
|
* The core and helpers guarantee that any atomic state duplicated with
|
||||||
* this hook and still owned by the caller (i.e. not transferred to the
|
* this hook and still owned by the caller (i.e. not transferred to the
|
||||||
* driver by calling ->atomic_commit() from struct
|
* driver by calling &drm_mode_config_funcs.atomic_commit) will be
|
||||||
* &drm_mode_config_funcs) will be cleaned up by calling the
|
* cleaned up by calling the @atomic_destroy_state hook in this
|
||||||
* @atomic_destroy_state hook in this structure.
|
* structure.
|
||||||
*
|
*
|
||||||
* Atomic drivers which don't subclass &struct drm_crtc should use
|
* Atomic drivers which don't subclass &struct drm_crtc_state should use
|
||||||
* drm_atomic_helper_crtc_duplicate_state(). Drivers that subclass the
|
* drm_atomic_helper_crtc_duplicate_state(). Drivers that subclass the
|
||||||
* state structure to extend it with driver-private state should use
|
* state structure to extend it with driver-private state should use
|
||||||
* __drm_atomic_helper_crtc_duplicate_state() to make sure shared state is
|
* __drm_atomic_helper_crtc_duplicate_state() to make sure shared state is
|
||||||
* duplicated in a consistent fashion across drivers.
|
* duplicated in a consistent fashion across drivers.
|
||||||
*
|
*
|
||||||
* It is an error to call this hook before crtc->state has been
|
* It is an error to call this hook before &drm_crtc.state has been
|
||||||
* initialized correctly.
|
* initialized correctly.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
@@ -559,7 +560,7 @@ struct drm_crtc_funcs {
|
|||||||
*
|
*
|
||||||
* This optional hook should be used to unregister the additional
|
* This optional hook should be used to unregister the additional
|
||||||
* userspace interfaces attached to the crtc from
|
* userspace interfaces attached to the crtc from
|
||||||
* late_unregister(). It is called from drm_dev_unregister(),
|
* @late_register. It is called from drm_dev_unregister(),
|
||||||
* early in the driver unload sequence to disable userspace access
|
* early in the driver unload sequence to disable userspace access
|
||||||
* before data structures are torndown.
|
* before data structures are torndown.
|
||||||
*/
|
*/
|
||||||
@@ -640,8 +641,8 @@ struct drm_crtc {
|
|||||||
*
|
*
|
||||||
* This provides a read lock for the overall crtc state (mode, dpms
|
* This provides a read lock for the overall crtc state (mode, dpms
|
||||||
* state, ...) and a write lock for everything which can be update
|
* state, ...) and a write lock for everything which can be update
|
||||||
* without a full modeset (fb, cursor data, crtc properties ...). Full
|
* without a full modeset (fb, cursor data, crtc properties ...). A full
|
||||||
* modeset also need to grab dev->mode_config.connection_mutex.
|
* modeset also need to grab &drm_mode_config.connection_mutex.
|
||||||
*/
|
*/
|
||||||
struct drm_modeset_lock mutex;
|
struct drm_modeset_lock mutex;
|
||||||
|
|
||||||
@@ -773,10 +774,8 @@ struct drm_crtc {
|
|||||||
* @connectors: array of connectors to drive with this CRTC if possible
|
* @connectors: array of connectors to drive with this CRTC if possible
|
||||||
* @num_connectors: size of @connectors array
|
* @num_connectors: size of @connectors array
|
||||||
*
|
*
|
||||||
* Represents a single crtc the connectors that it drives with what mode
|
* This represents a modeset configuration for the legacy SETCRTC ioctl and is
|
||||||
* and from which framebuffer it scans out from.
|
* also used internally. Atomic drivers instead use &drm_atomic_state.
|
||||||
*
|
|
||||||
* This is used to set modes.
|
|
||||||
*/
|
*/
|
||||||
struct drm_mode_set {
|
struct drm_mode_set {
|
||||||
struct drm_framebuffer *fb;
|
struct drm_framebuffer *fb;
|
||||||
@@ -825,15 +824,21 @@ static inline uint32_t drm_crtc_mask(const struct drm_crtc *crtc)
|
|||||||
return 1 << drm_crtc_index(crtc);
|
return 1 << drm_crtc_index(crtc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
|
|
||||||
int *hdisplay, int *vdisplay);
|
|
||||||
int drm_crtc_force_disable(struct drm_crtc *crtc);
|
int drm_crtc_force_disable(struct drm_crtc *crtc);
|
||||||
int drm_crtc_force_disable_all(struct drm_device *dev);
|
int drm_crtc_force_disable_all(struct drm_device *dev);
|
||||||
|
|
||||||
int drm_mode_set_config_internal(struct drm_mode_set *set);
|
int drm_mode_set_config_internal(struct drm_mode_set *set);
|
||||||
struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx);
|
struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx);
|
||||||
|
|
||||||
/* Helpers */
|
/**
|
||||||
|
* drm_crtc_find - look up a CRTC object from its ID
|
||||||
|
* @dev: DRM device
|
||||||
|
* @id: &drm_mode_object ID
|
||||||
|
*
|
||||||
|
* This can be used to look up a CRTC from its userspace ID. Only used by
|
||||||
|
* drivers for legacy IOCTLs and interface, nowadays extensions to the KMS
|
||||||
|
* userspace interface should be done using &drm_property.
|
||||||
|
*/
|
||||||
static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
|
static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
|
||||||
uint32_t id)
|
uint32_t id)
|
||||||
{
|
{
|
||||||
@@ -842,6 +847,13 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
|
|||||||
return mo ? obj_to_crtc(mo) : NULL;
|
return mo ? obj_to_crtc(mo) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_for_each_crtc - iterate over all CRTCs
|
||||||
|
* @crtc: a &struct drm_crtc as the loop cursor
|
||||||
|
* @dev: the &struct drm_device
|
||||||
|
*
|
||||||
|
* Iterate over all CRTCs of @dev.
|
||||||
|
*/
|
||||||
#define drm_for_each_crtc(crtc, dev) \
|
#define drm_for_each_crtc(crtc, dev) \
|
||||||
list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
|
list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
|
||||||
|
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ struct drm_dp_mst_topology_mgr {
|
|||||||
/**
|
/**
|
||||||
* @dev: device pointer for adding i2c devices etc.
|
* @dev: device pointer for adding i2c devices etc.
|
||||||
*/
|
*/
|
||||||
struct device *dev;
|
struct drm_device *dev;
|
||||||
/**
|
/**
|
||||||
* @cbs: callbacks for connector addition and destruction.
|
* @cbs: callbacks for connector addition and destruction.
|
||||||
*/
|
*/
|
||||||
@@ -493,8 +493,8 @@ struct drm_dp_mst_topology_mgr {
|
|||||||
int total_pbn;
|
int total_pbn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @qlock: protects @tx_msg_downq, the tx_slots in struct
|
* @qlock: protects @tx_msg_downq, the &drm_dp_mst_branch.txslost and
|
||||||
* &drm_dp_mst_branch and txmsg->state once they are queued
|
* &drm_dp_sideband_msg_tx.state once they are queued
|
||||||
*/
|
*/
|
||||||
struct mutex qlock;
|
struct mutex qlock;
|
||||||
/**
|
/**
|
||||||
@@ -508,8 +508,7 @@ struct drm_dp_mst_topology_mgr {
|
|||||||
struct mutex payload_lock;
|
struct mutex payload_lock;
|
||||||
/**
|
/**
|
||||||
* @proposed_vcpis: Array of pointers for the new VCPI allocation. The
|
* @proposed_vcpis: Array of pointers for the new VCPI allocation. The
|
||||||
* VCPI structure itself is embedded into the corresponding
|
* VCPI structure itself is &drm_dp_mst_port.vcpi.
|
||||||
* &drm_dp_mst_port structure.
|
|
||||||
*/
|
*/
|
||||||
struct drm_dp_vcpi **proposed_vcpis;
|
struct drm_dp_vcpi **proposed_vcpis;
|
||||||
/**
|
/**
|
||||||
@@ -556,7 +555,10 @@ struct drm_dp_mst_topology_mgr {
|
|||||||
struct work_struct destroy_connector_work;
|
struct work_struct destroy_connector_work;
|
||||||
};
|
};
|
||||||
|
|
||||||
int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, struct device *dev, struct drm_dp_aux *aux, int max_dpcd_transaction_bytes, int max_payloads, int conn_base_id);
|
int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
|
||||||
|
struct drm_device *dev, struct drm_dp_aux *aux,
|
||||||
|
int max_dpcd_transaction_bytes,
|
||||||
|
int max_payloads, int conn_base_id);
|
||||||
|
|
||||||
void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr);
|
void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr);
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ struct drm_driver {
|
|||||||
* Zero on success, non-zero value on failure.
|
* Zero on success, non-zero value on failure.
|
||||||
*/
|
*/
|
||||||
int (*load) (struct drm_device *, unsigned long flags);
|
int (*load) (struct drm_device *, unsigned long flags);
|
||||||
int (*firstopen) (struct drm_device *);
|
|
||||||
int (*open) (struct drm_device *, struct drm_file *);
|
int (*open) (struct drm_device *, struct drm_file *);
|
||||||
void (*preclose) (struct drm_device *, struct drm_file *file_priv);
|
void (*preclose) (struct drm_device *, struct drm_file *file_priv);
|
||||||
void (*postclose) (struct drm_device *, struct drm_file *);
|
void (*postclose) (struct drm_device *, struct drm_file *);
|
||||||
@@ -103,9 +102,6 @@ struct drm_driver {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void (*unload) (struct drm_device *);
|
void (*unload) (struct drm_device *);
|
||||||
int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
|
|
||||||
int (*dma_quiescent) (struct drm_device *);
|
|
||||||
int (*context_dtor) (struct drm_device *dev, int context);
|
|
||||||
int (*set_busid)(struct drm_device *dev, struct drm_master *master);
|
int (*set_busid)(struct drm_device *dev, struct drm_master *master);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,20 +146,6 @@ struct drm_driver {
|
|||||||
*/
|
*/
|
||||||
void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
|
void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
|
||||||
|
|
||||||
/**
|
|
||||||
* @device_is_agp:
|
|
||||||
*
|
|
||||||
* Called by drm_device_is_agp(). Typically used to determine if a card
|
|
||||||
* is really attached to AGP or not.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
*
|
|
||||||
* One of three values is returned depending on whether or not the
|
|
||||||
* card is absolutely not AGP (return of 0), absolutely is AGP
|
|
||||||
* (return of 1), or may or may not be AGP (return of 2).
|
|
||||||
*/
|
|
||||||
int (*device_is_agp) (struct drm_device *dev);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @get_scanout_position:
|
* @get_scanout_position:
|
||||||
*
|
*
|
||||||
@@ -314,7 +296,7 @@ struct drm_driver {
|
|||||||
/**
|
/**
|
||||||
* @gem_free_object_unlocked: deconstructor for drm_gem_objects
|
* @gem_free_object_unlocked: deconstructor for drm_gem_objects
|
||||||
*
|
*
|
||||||
* This is for drivers which are not encumbered with dev->struct_mutex
|
* This is for drivers which are not encumbered with &drm_device.struct_mutex
|
||||||
* legacy locking schemes. Use this hook instead of @gem_free_object.
|
* legacy locking schemes. Use this hook instead of @gem_free_object.
|
||||||
*/
|
*/
|
||||||
void (*gem_free_object_unlocked) (struct drm_gem_object *obj);
|
void (*gem_free_object_unlocked) (struct drm_gem_object *obj);
|
||||||
@@ -359,9 +341,6 @@ struct drm_driver {
|
|||||||
int (*gem_prime_mmap)(struct drm_gem_object *obj,
|
int (*gem_prime_mmap)(struct drm_gem_object *obj,
|
||||||
struct vm_area_struct *vma);
|
struct vm_area_struct *vma);
|
||||||
|
|
||||||
/* vga arb irq handler */
|
|
||||||
void (*vgaarb_irq)(struct drm_device *dev, bool state);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dumb_create:
|
* @dumb_create:
|
||||||
*
|
*
|
||||||
@@ -430,13 +409,20 @@ struct drm_driver {
|
|||||||
char *date;
|
char *date;
|
||||||
|
|
||||||
u32 driver_features;
|
u32 driver_features;
|
||||||
int dev_priv_size;
|
|
||||||
const struct drm_ioctl_desc *ioctls;
|
const struct drm_ioctl_desc *ioctls;
|
||||||
int num_ioctls;
|
int num_ioctls;
|
||||||
const struct file_operations *fops;
|
const struct file_operations *fops;
|
||||||
|
|
||||||
|
/* Everything below here is for legacy driver, never use! */
|
||||||
|
/* private: */
|
||||||
|
|
||||||
/* List of devices hanging off this driver with stealth attach. */
|
/* List of devices hanging off this driver with stealth attach. */
|
||||||
struct list_head legacy_dev_list;
|
struct list_head legacy_dev_list;
|
||||||
|
int (*firstopen) (struct drm_device *);
|
||||||
|
int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
|
||||||
|
int (*dma_quiescent) (struct drm_device *);
|
||||||
|
int (*context_dtor) (struct drm_device *dev, int context);
|
||||||
|
int dev_priv_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern __printf(6, 7)
|
extern __printf(6, 7)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#define __DRM_EDID_H__
|
#define __DRM_EDID_H__
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
#include <linux/hdmi.h>
|
||||||
|
|
||||||
struct drm_device;
|
struct drm_device;
|
||||||
struct i2c_adapter;
|
struct i2c_adapter;
|
||||||
@@ -322,8 +323,6 @@ struct cea_sad {
|
|||||||
struct drm_encoder;
|
struct drm_encoder;
|
||||||
struct drm_connector;
|
struct drm_connector;
|
||||||
struct drm_display_mode;
|
struct drm_display_mode;
|
||||||
struct hdmi_avi_infoframe;
|
|
||||||
struct hdmi_vendor_infoframe;
|
|
||||||
|
|
||||||
void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
|
void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
|
||||||
int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
|
int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
|
||||||
@@ -346,6 +345,11 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
|
|||||||
int
|
int
|
||||||
drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
|
drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
|
||||||
const struct drm_display_mode *mode);
|
const struct drm_display_mode *mode);
|
||||||
|
void
|
||||||
|
drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
|
||||||
|
const struct drm_display_mode *mode,
|
||||||
|
enum hdmi_quantization_range rgb_quant_range,
|
||||||
|
bool rgb_quant_range_selectable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_eld_mnl - Get ELD monitor name length in bytes.
|
* drm_eld_mnl - Get ELD monitor name length in bytes.
|
||||||
@@ -442,6 +446,8 @@ enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
|
|||||||
bool drm_detect_hdmi_monitor(struct edid *edid);
|
bool drm_detect_hdmi_monitor(struct edid *edid);
|
||||||
bool drm_detect_monitor_audio(struct edid *edid);
|
bool drm_detect_monitor_audio(struct edid *edid);
|
||||||
bool drm_rgb_quant_range_selectable(struct edid *edid);
|
bool drm_rgb_quant_range_selectable(struct edid *edid);
|
||||||
|
enum hdmi_quantization_range
|
||||||
|
drm_default_rgb_quant_range(const struct drm_display_mode *mode);
|
||||||
int drm_add_modes_noedid(struct drm_connector *connector,
|
int drm_add_modes_noedid(struct drm_connector *connector,
|
||||||
int hdisplay, int vdisplay);
|
int hdisplay, int vdisplay);
|
||||||
void drm_set_preferred_mode(struct drm_connector *connector,
|
void drm_set_preferred_mode(struct drm_connector *connector,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ struct drm_encoder_funcs {
|
|||||||
*
|
*
|
||||||
* This optional hook should be used to unregister the additional
|
* This optional hook should be used to unregister the additional
|
||||||
* userspace interfaces attached to the encoder from
|
* userspace interfaces attached to the encoder from
|
||||||
* late_unregister(). It is called from drm_dev_unregister(),
|
* @late_register. It is called from drm_dev_unregister(),
|
||||||
* early in the driver unload sequence to disable userspace access
|
* early in the driver unload sequence to disable userspace access
|
||||||
* before data structures are torndown.
|
* before data structures are torndown.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
|
|||||||
void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
|
void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
|
||||||
void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
|
void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
|
||||||
void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);
|
void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);
|
||||||
|
void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
|
||||||
|
int state);
|
||||||
|
|
||||||
void drm_fb_cma_destroy(struct drm_framebuffer *fb);
|
void drm_fb_cma_destroy(struct drm_framebuffer *fb);
|
||||||
int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
|
int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ typedef void (*drm_flip_func_t)(struct drm_flip_work *work, void *val);
|
|||||||
/**
|
/**
|
||||||
* struct drm_flip_task - flip work task
|
* struct drm_flip_task - flip work task
|
||||||
* @node: list entry element
|
* @node: list entry element
|
||||||
* @data: data to pass to work->func
|
* @data: data to pass to &drm_flip_work.func
|
||||||
*/
|
*/
|
||||||
struct drm_flip_task {
|
struct drm_flip_task {
|
||||||
struct list_head node;
|
struct list_head node;
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ struct drm_framebuffer_funcs {
|
|||||||
*
|
*
|
||||||
* Clean up framebuffer resources, specifically also unreference the
|
* Clean up framebuffer resources, specifically also unreference the
|
||||||
* backing storage. The core guarantees to call this function for every
|
* backing storage. The core guarantees to call this function for every
|
||||||
* framebuffer successfully created by ->fb_create() in
|
* framebuffer successfully created by calling
|
||||||
* &drm_mode_config_funcs. Drivers must also call
|
* &drm_mode_config_funcs.fb_create. Drivers must also call
|
||||||
* drm_framebuffer_cleanup() to release DRM core resources for this
|
* drm_framebuffer_cleanup() to release DRM core resources for this
|
||||||
* framebuffer.
|
* framebuffer.
|
||||||
*/
|
*/
|
||||||
@@ -112,8 +112,8 @@ struct drm_framebuffer {
|
|||||||
*/
|
*/
|
||||||
struct drm_device *dev;
|
struct drm_device *dev;
|
||||||
/**
|
/**
|
||||||
* @head: Place on the dev->mode_config.fb_list, access protected by
|
* @head: Place on the &drm_mode_config.fb_list, access protected by
|
||||||
* dev->mode_config.fb_lock.
|
* &drm_mode_config.fb_lock.
|
||||||
*/
|
*/
|
||||||
struct list_head head;
|
struct list_head head;
|
||||||
|
|
||||||
@@ -187,8 +187,7 @@ struct drm_framebuffer {
|
|||||||
*/
|
*/
|
||||||
int hot_y;
|
int hot_y;
|
||||||
/**
|
/**
|
||||||
* @filp_head: Placed on &struct drm_file fbs list_head, protected by
|
* @filp_head: Placed on &drm_file.fbs, protected by &drm_file.fbs_lock.
|
||||||
* fbs_lock in the same structure.
|
|
||||||
*/
|
*/
|
||||||
struct list_head filp_head;
|
struct list_head filp_head;
|
||||||
};
|
};
|
||||||
@@ -260,8 +259,8 @@ static inline void drm_framebuffer_assign(struct drm_framebuffer **p,
|
|||||||
* @fb: the loop cursor
|
* @fb: the loop cursor
|
||||||
* @dev: the DRM device
|
* @dev: the DRM device
|
||||||
*
|
*
|
||||||
* Iterate over all framebuffers of @dev. User must hold the fb_lock from
|
* Iterate over all framebuffers of @dev. User must hold
|
||||||
* &drm_mode_config.
|
* &drm_mode_config.fb_lock.
|
||||||
*/
|
*/
|
||||||
#define drm_for_each_fb(fb, dev) \
|
#define drm_for_each_fb(fb, dev) \
|
||||||
for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.fb_lock)), \
|
for (WARN_ON(!mutex_is_locked(&(dev)->mode_config.fb_lock)), \
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ struct drm_gem_object {
|
|||||||
* drops to 0 any global names (e.g. the id in the flink namespace) will
|
* drops to 0 any global names (e.g. the id in the flink namespace) will
|
||||||
* be cleared.
|
* be cleared.
|
||||||
*
|
*
|
||||||
* Protected by dev->object_name_lock.
|
* Protected by &drm_device.object_name_lock.
|
||||||
*/
|
*/
|
||||||
unsigned handle_count;
|
unsigned handle_count;
|
||||||
|
|
||||||
@@ -106,8 +106,8 @@ struct drm_gem_object {
|
|||||||
* @name:
|
* @name:
|
||||||
*
|
*
|
||||||
* Global name for this object, starts at 1. 0 means unnamed.
|
* Global name for this object, starts at 1. 0 means unnamed.
|
||||||
* Access is covered by dev->object_name_lock. This is used by the GEM_FLINK
|
* Access is covered by &drm_device.object_name_lock. This is used by
|
||||||
* and GEM_OPEN ioctls.
|
* the GEM_FLINK and GEM_OPEN ioctls.
|
||||||
*/
|
*/
|
||||||
int name;
|
int name;
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ struct drm_gem_object {
|
|||||||
* through importing or exporting). We break the resulting reference
|
* through importing or exporting). We break the resulting reference
|
||||||
* loop when the last gem handle for this object is released.
|
* loop when the last gem handle for this object is released.
|
||||||
*
|
*
|
||||||
* Protected by obj->object_name_lock.
|
* Protected by &drm_device.object_name_lock.
|
||||||
*/
|
*/
|
||||||
struct dma_buf *dma_buf;
|
struct dma_buf *dma_buf;
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ struct drm_gem_object {
|
|||||||
* attachment point for the device. This is invariant over the lifetime
|
* attachment point for the device. This is invariant over the lifetime
|
||||||
* of a gem object.
|
* of a gem object.
|
||||||
*
|
*
|
||||||
* The driver's ->gem_free_object callback is responsible for cleaning
|
* The &drm_driver.gem_free_object callback is responsible for cleaning
|
||||||
* up the dma_buf attachment and references acquired at import time.
|
* up the dma_buf attachment and references acquired at import time.
|
||||||
*
|
*
|
||||||
* Note that the drm gem/prime core does not depend upon drivers setting
|
* Note that the drm gem/prime core does not depend upon drivers setting
|
||||||
@@ -204,7 +204,7 @@ drm_gem_object_reference(struct drm_gem_object *obj)
|
|||||||
* @obj: GEM buffer object
|
* @obj: GEM buffer object
|
||||||
*
|
*
|
||||||
* This function is meant to be used by drivers which are not encumbered with
|
* This function is meant to be used by drivers which are not encumbered with
|
||||||
* dev->struct_mutex legacy locking and which are using the
|
* &drm_device.struct_mutex legacy locking and which are using the
|
||||||
* gem_free_object_unlocked callback. It avoids all the locking checks and
|
* gem_free_object_unlocked callback. It avoids all the locking checks and
|
||||||
* locking overhead of drm_gem_object_unreference() and
|
* locking overhead of drm_gem_object_unreference() and
|
||||||
* drm_gem_object_unreference_unlocked().
|
* drm_gem_object_unreference_unlocked().
|
||||||
@@ -212,8 +212,8 @@ drm_gem_object_reference(struct drm_gem_object *obj)
|
|||||||
* Drivers should never call this directly in their code. Instead they should
|
* Drivers should never call this directly in their code. Instead they should
|
||||||
* wrap it up into a ``driver_gem_object_unreference(struct driver_gem_object
|
* wrap it up into a ``driver_gem_object_unreference(struct driver_gem_object
|
||||||
* *obj)`` wrapper function, and use that. Shared code should never call this, to
|
* *obj)`` wrapper function, and use that. Shared code should never call this, to
|
||||||
* avoid breaking drivers by accident which still depend upon dev->struct_mutex
|
* avoid breaking drivers by accident which still depend upon
|
||||||
* locking.
|
* &drm_device.struct_mutex locking.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
__drm_gem_object_unreference(struct drm_gem_object *obj)
|
__drm_gem_object_unreference(struct drm_gem_object *obj)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ struct drm_vblank_crtc {
|
|||||||
* @disable_timer: Disable timer for the delayed vblank disabling
|
* @disable_timer: Disable timer for the delayed vblank disabling
|
||||||
* hysteresis logic. Vblank disabling is controlled through the
|
* hysteresis logic. Vblank disabling is controlled through the
|
||||||
* drm_vblank_offdelay module option and the setting of the
|
* drm_vblank_offdelay module option and the setting of the
|
||||||
* max_vblank_count value in the &drm_device structure.
|
* &drm_device.max_vblank_count value.
|
||||||
*/
|
*/
|
||||||
struct timer_list disable_timer;
|
struct timer_list disable_timer;
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ struct drm_vblank_crtc {
|
|||||||
*/
|
*/
|
||||||
atomic_t refcount; /* number of users of vblank interruptsper crtc */
|
atomic_t refcount; /* number of users of vblank interruptsper crtc */
|
||||||
/**
|
/**
|
||||||
* @last: Protected by dev->vbl_lock, used for wraparound handling.
|
* @last: Protected by &drm_device.vbl_lock, used for wraparound handling.
|
||||||
*/
|
*/
|
||||||
u32 last;
|
u32 last;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ struct drm_mode_config_funcs {
|
|||||||
* that before calling this hook.
|
* that before calling this hook.
|
||||||
*
|
*
|
||||||
* See the documentation of @atomic_commit for an exhaustive list of
|
* See the documentation of @atomic_commit for an exhaustive list of
|
||||||
* error conditions which don't have to be checked at the
|
* error conditions which don't have to be checked at the in this
|
||||||
* ->atomic_check() stage?
|
* callback.
|
||||||
*
|
*
|
||||||
* See the documentation for &struct drm_atomic_state for how exactly
|
* See the documentation for &struct drm_atomic_state for how exactly
|
||||||
* an atomic modeset update is described.
|
* an atomic modeset update is described.
|
||||||
@@ -198,10 +198,10 @@ struct drm_mode_config_funcs {
|
|||||||
* completed. These events are per-CRTC and can be distinguished by the
|
* completed. These events are per-CRTC and can be distinguished by the
|
||||||
* CRTC index supplied in &drm_event to userspace.
|
* CRTC index supplied in &drm_event to userspace.
|
||||||
*
|
*
|
||||||
* The drm core will supply a &struct drm_event in the event
|
* The drm core will supply a &struct drm_event in each CRTC's
|
||||||
* member of each CRTC's &drm_crtc_state structure. See the
|
* &drm_crtc_state.event. See the documentation for
|
||||||
* documentation for &drm_crtc_state for more details about the precise
|
* &drm_crtc_state.event for more details about the precise semantics of
|
||||||
* semantics of this event.
|
* this event.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -86,10 +86,15 @@ struct drm_object_properties {
|
|||||||
*
|
*
|
||||||
* Note that atomic drivers do not store mutable properties in this
|
* Note that atomic drivers do not store mutable properties in this
|
||||||
* array, but only the decoded values in the corresponding state
|
* array, but only the decoded values in the corresponding state
|
||||||
* structure. The decoding is done using the ->atomic_get_property and
|
* structure. The decoding is done using the &drm_crtc.atomic_get_property and
|
||||||
* ->atomic_set_property hooks of the corresponding object. Hence atomic
|
* &drm_crtc.atomic_set_property hooks for &struct drm_crtc. For
|
||||||
* drivers should not use drm_object_property_set_value() and
|
* &struct drm_plane the hooks are &drm_plane_funcs.atomic_get_property and
|
||||||
* drm_object_property_get_value() on mutable objects, i.e. those
|
* &drm_plane_funcs.atomic_set_property. And for &struct drm_connector
|
||||||
|
* the hooks are &drm_connector_funcs.atomic_get_property and
|
||||||
|
* &drm_connector_funcs.atomic_set_property .
|
||||||
|
*
|
||||||
|
* Hence atomic drivers should not use drm_object_property_set_value()
|
||||||
|
* and drm_object_property_get_value() on mutable objects, i.e. those
|
||||||
* without the DRM_MODE_PROP_IMMUTABLE flag set.
|
* without the DRM_MODE_PROP_IMMUTABLE flag set.
|
||||||
*/
|
*/
|
||||||
uint64_t values[DRM_OBJECT_MAX_PROPERTY];
|
uint64_t values[DRM_OBJECT_MAX_PROPERTY];
|
||||||
|
|||||||
@@ -459,6 +459,8 @@ int of_get_drm_display_mode(struct device_node *np,
|
|||||||
void drm_mode_set_name(struct drm_display_mode *mode);
|
void drm_mode_set_name(struct drm_display_mode *mode);
|
||||||
int drm_mode_hsync(const struct drm_display_mode *mode);
|
int drm_mode_hsync(const struct drm_display_mode *mode);
|
||||||
int drm_mode_vrefresh(const struct drm_display_mode *mode);
|
int drm_mode_vrefresh(const struct drm_display_mode *mode);
|
||||||
|
void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
|
||||||
|
int *hdisplay, int *vdisplay);
|
||||||
|
|
||||||
void drm_mode_set_crtcinfo(struct drm_display_mode *p,
|
void drm_mode_set_crtcinfo(struct drm_display_mode *p,
|
||||||
int adjust_flags);
|
int adjust_flags);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user