Base URL
https://www.promptbox.cn/api/edp.phpProtocol
HTTPS
Auth
None (public)
Formats
Request: GET POST (JSON) • Response: application/json
Rate limits
No formal limit; please cache and be considerate.
Version
1.0.0 (Calculator parity with UI tool provided by user)Overview
This endpoint calculates the active pixel clock and required DisplayPort/eDP transport bandwidth for a given timing using CVT v1 r1.2 Reduced Blanking assumptions. It also suggests a minimal lane/rate configuration that meets the transport requirement. Optional DSC 3:1 transport compression can be applied.
Model: CVT v1 r1.2 (RB). Horizontal blanking fixed to 80 px. Vertical blank minimum 460 µs.
Pixel clock is rounded down to the nearest 1 kHz step. DisplayPort 8b/10b encoding overhead included.
Endpoint
GET /api/edp.php?resolution=2560x1600&refresh=120&bpp=30&dsc=1
POST /api/edp.php
Content-Type: application/json
{
"resolution": "2560x1600",
"refresh": 120,
"bpp": 30,
"dsc": true
}
Request Parameters
| Name | Type | Required | Description | Examples |
|---|---|---|---|---|
resolution |
string | yes | Active resolution in H×V. H is rounded down to a multiple of 8 cells. |
2560x1600, 2880x1800, 3840x2400 |
refresh |
number | yes | Vertical refresh rate in Hz. Must be > 0. Supports fractional values. | 60, 120, 59.94 |
bpp |
number | yes | Transport bits per pixel (e.g., 24 for 8bpc RGB, 30 for 10bpc RGB). | 24, 30 |
dsc |
boolean | number | no | Apply 3:1 DSC transport scaling if true/1. | true, false, 1, 0 |
Response Schema
| Field | Type | Description |
|---|---|---|
pixel_clock_mhz |
number | Active pixel clock after RB rounding (MHz, 3 decimals). |
required_bandwidth_gbps |
number | Raw DP transport including 8b/10b overhead (Gbps) without DSC. |
effective_bandwidth_gbps |
number | Transport after optional DSC 3:1 scaling; equals required_bandwidth_gbps if DSC disabled. |
dsc_applied |
boolean | Whether DSC reduction was applied. |
recommended_link |
string | Suggested minimal lanes/rate among {1/2/4 lanes} × {1.62, 2.7, 5.4, 8.1 Gbps}. |
HTTP Status Codes
- 200 OK — Successful calculation.
- 400 Bad Request — Validation error (missing/invalid parameters).
- 5xx Server Error — Unexpected error.
Error Format
{
"error": "Parameter 'resolution' is required (e.g. 2560x1600)."
}
Validation & Calculation Notes
- Horizontal active is rounded down to the nearest multiple of
8pixels. - RB horizontal blanking fixed at
80px (RBv2-style simplification). - Minimum vertical blank time:
460 µs. - Pixel clock rounding: floor to
1 kHzsteps. - Encoding overhead:
8b/10b(×10/8). - DSC option scales transport by ~
1/3(i.e., 3:1 compression) for link sizing. - Recommended link chooses minimal lanes first, then the lowest per-lane rate that meets required Gbps.
Security
No authentication is required. Use HTTPS. Consider client-side caching and input validation.
Fair Use
No formal rate limit; please avoid high-frequency polling. Batch inputs on your side when possible.
Versioning
1.0.0— Initial public release; parity with the provided HTML tool logic.
License & Warranty
Provided “as is,” without warranty of any kind. Engineering due diligence is recommended before production decisions.