The liquid crystal spatial light modulator is able to provide flexible wavefront modulation, whereas its nonlinear and spatial varying phase response will influence the modulation accuracy. In this paper, a software based C++ algorithm are designed to calibrate these distortions regionally. Twyman-Green interference method is utilized for gray versus phase shift measurement. The curvature of cover glass is measured by phase shift algorithm. Finally the entire panel is divided into several local regions to overcome the spatial varying phase response. For each sub-region, the nonlinear phase response is calibrated by remapping table. For a Jasper 4K SLM panel, when three local regions are built, the root mean error of linear phase shift is reduced to approximate 0.1 rad. The calibrated SLM is applied for holographic display and the improvement ratios of structural similarity index reach 30.6%, 62.5%, and 43.6% for R, G, and B reconstructed components respectively.