#ifndef __DRM_OF_H__ #define __DRM_OF_H__ #include struct component_master_ops; struct component_match; struct device; struct drm_device; struct drm_encoder; struct device_node; #ifdef CONFIG_OF extern uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, struct device_node *port); extern void drm_of_component_match_add(struct device *master, struct component_match **matchptr, int (*compare)(struct device *, void *), struct device_node *node); extern int drm_of_component_probe(struct device *dev, int (*compare_of)(struct device *, void *), const struct component_master_ops *m_ops); extern int drm_of_encoder_active_endpoint(struct device_node *node, struct drm_encoder *encoder, struct of_endpoint *endpoint); #else static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, struct device_node *port) { return 0; } static inline void drm_of_component_match_add(struct device *master, struct component_match **matchptr, int (*compare)(struct device *, void *), struct device_node *node) { } static inline int drm_of_component_probe(struct device *dev, int (*compare_of)(struct device *, void *), const struct component_master_ops *m_ops) { return -EINVAL; } static inline int drm_of_encoder_active_endpoint(struct device_node *node, struct drm_encoder *encoder, struct of_endpoint *endpoint) { return -EINVAL; } #endif static inline int drm_of_encoder_active_endpoint_id(struct device_node *node, struct drm_encoder *encoder) { struct of_endpoint endpoint; int ret = drm_of_encoder_active_endpoint(node, encoder, &endpoint); return ret ?: endpoint.id; } static inline int drm_of_encoder_active_port_id(struct device_node *node, struct drm_encoder *encoder) { struct of_endpoint endpoint; int ret = drm_of_encoder_active_endpoint(node, encoder, &endpoint); return ret ?: endpoint.port; } #endif /* __DRM_OF_H__ */ hod='get' action='/cgit.cgi/linux/net-next.git/log/'>
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-12-12 14:46:49 +0800
committerMichael S. Tsirkin <mst@redhat.com>2016-12-16 00:12:50 +0200
commit809ecb9bca6a9424ccd392d67e368160f8b76c92 (patch)
tree606dee0e521208955dee5b5bdda763b3c30425cb
parent6c083c2b8a0a110cad936bc0a2c089f0d8115175 (diff)
vhost: cache used event for better performance
When event index was enabled, we need to fetch used event from userspace memory each time. This userspace fetch (with memory barrier) could be saved sometime when 1) caching used event and 2) if used event is ahead of new and old to new updating does not cross it, we're sure there's no need to notify guest. This will be useful for heavy tx load e.g guest pktgen test with Linux driver shows ~3.5% improvement. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>