mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-24 16:00:13 +01:00
libdrm/intel: Make get_pipe_from_crtc_id per-bufmgr. Return -1 on failure.
The convention is that all APIs are per-bufmgr, so make this one the same. Then, have it return -1 on failure so that the application can know what's going on and do something sensible. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
afd245dd7f
commit
f57d7f4b0b
4 changed files with 32 additions and 9 deletions
|
|
@ -19,7 +19,7 @@
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([libdrm], 2.4.10, [dri-devel@lists.sourceforge.net], libdrm)
|
AC_INIT([libdrm], 2.4.11, [dri-devel@lists.sourceforge.net], libdrm)
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -219,3 +219,12 @@ int drm_intel_bo_disable_reuse(drm_intel_bo *bo)
|
||||||
return bo->bufmgr->bo_disable_reuse(bo);
|
return bo->bufmgr->bo_disable_reuse(bo);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
drm_intel_get_pipe_from_crtc_id (drm_intel_bufmgr *bufmgr, int crtc_id)
|
||||||
|
{
|
||||||
|
if (bufmgr->get_pipe_from_crtc_id)
|
||||||
|
return bufmgr->get_pipe_from_crtc_id(bufmgr, crtc_id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -815,8 +815,8 @@ drm_intel_gem_bo_subdata (drm_intel_bo *bo, unsigned long offset,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
drm_intel_get_pipe_from_crtc_id (drm_intel_bufmgr *bufmgr, int crtc_id)
|
drm_intel_gem_get_pipe_from_crtc_id (drm_intel_bufmgr *bufmgr, int crtc_id)
|
||||||
{
|
{
|
||||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr;
|
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr;
|
||||||
struct drm_i915_get_pipe_from_crtc_id get_pipe_from_crtc_id;
|
struct drm_i915_get_pipe_from_crtc_id get_pipe_from_crtc_id;
|
||||||
|
|
@ -826,13 +826,13 @@ drm_intel_get_pipe_from_crtc_id (drm_intel_bufmgr *bufmgr, int crtc_id)
|
||||||
ret = ioctl (bufmgr_gem->fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID,
|
ret = ioctl (bufmgr_gem->fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID,
|
||||||
&get_pipe_from_crtc_id);
|
&get_pipe_from_crtc_id);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
/* We're intentionally silent here so that there is no
|
/* We return -1 here to signal that we don't
|
||||||
* complaint when simply running with an older kernel that
|
* know which pipe is associated with this crtc.
|
||||||
* doesn't have the GET_PIPE_FROM_CRTC_ID ioctly. In that
|
* This lets the caller know that this information
|
||||||
* case, we just punt and try to sync on pipe 0, which is
|
* isn't available; using the wrong pipe for
|
||||||
* hopefully the right pipe in some cases at least.
|
* vblank waiting can cause the chipset to lock up
|
||||||
*/
|
*/
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return get_pipe_from_crtc_id.pipe;
|
return get_pipe_from_crtc_id.pipe;
|
||||||
|
|
@ -1482,6 +1482,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
|
||||||
bufmgr_gem->bufmgr.debug = 0;
|
bufmgr_gem->bufmgr.debug = 0;
|
||||||
bufmgr_gem->bufmgr.check_aperture_space = drm_intel_gem_check_aperture_space;
|
bufmgr_gem->bufmgr.check_aperture_space = drm_intel_gem_check_aperture_space;
|
||||||
bufmgr_gem->bufmgr.bo_disable_reuse = drm_intel_gem_bo_disable_reuse;
|
bufmgr_gem->bufmgr.bo_disable_reuse = drm_intel_gem_bo_disable_reuse;
|
||||||
|
bufmgr_gem->bufmgr.get_pipe_from_crtc_id = drm_intel_gem_get_pipe_from_crtc_id;
|
||||||
/* Initialize the linked lists for BO reuse cache. */
|
/* Initialize the linked lists for BO reuse cache. */
|
||||||
for (i = 0; i < DRM_INTEL_GEM_BO_BUCKETS; i++)
|
for (i = 0; i < DRM_INTEL_GEM_BO_BUCKETS; i++)
|
||||||
DRMINITLISTHEAD(&bufmgr_gem->cache_bucket[i].head);
|
DRMINITLISTHEAD(&bufmgr_gem->cache_bucket[i].head);
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,19 @@ struct _drm_intel_bufmgr {
|
||||||
*/
|
*/
|
||||||
int (*bo_disable_reuse)(drm_intel_bo *bo);
|
int (*bo_disable_reuse)(drm_intel_bo *bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the pipe associated with a crtc_id so that vblank
|
||||||
|
* synchronization can use the correct data in the request.
|
||||||
|
* This is only supported for KMS and gem at this point, when
|
||||||
|
* unsupported, this function returns -1 and leaves the decision
|
||||||
|
* of what to do in that case to the caller
|
||||||
|
*
|
||||||
|
* \param bufmgr the associated buffer manager
|
||||||
|
* \param crtc_id the crtc identifier
|
||||||
|
*/
|
||||||
|
int (*get_pipe_from_crtc_id)(drm_intel_bufmgr *bufmgr, int crtc_id);
|
||||||
|
|
||||||
int debug; /**< Enables verbose debugging printouts */
|
int debug; /**< Enables verbose debugging printouts */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue