The combustible mixture in a gasoline engine is uniform with stoichiometric ratio near to one. When combustion is initiated by the spark plug a flame front forms and and proceed in the combustion chamber thus compressing the end gas at the far end. If the temperature and pressure of the end gas exceed certain limits the end gas may ignite before the flame front reaches it and creates opposite pressure waves which when they meet with those created by the flame front they make a ringing sound called spark ignition knock which is known as one of the spark ignition combustion failure. Other types of failure is pre-ignition that is the ignition of the charge even before the initiation of the spark. This the reason behind having a low compression efficiency in gasoline engines.
I guess you have misunderstood both the engine technologies, i.e., tech of Diesel engine and gasoline engine. DI (Direction Ignition) is related to Diesel engines hence you cant related that to a gasoline engine.
To know how a compression ratio is calculated plz go through this link http://www.muller.net/sonny/crx/compression/
Gasoline is very much volatile it immediately evaporates into the air to form a homogeneous mixture of air and fuel at near chemical correct ratio suitable to be ignited by a spark. Then combustion will start at the spark and spread uniformly to engulf the whole mixture. Injection of gasoline does not require a high injection pressure. In diesel engines you need very high injection pressure to overcome the high cylinder pressure and to make the fuel break into small droplets and penetrate as far as possible into the combustion chamber to mix with air. Here the mixture is not uniform and combustion may start any where in the combustion chamber after the start of injection spontaneously. IT does not need a spark to ignite the mixture. I think you better read more about the difference between the two engines in any book about the internal combustion engine. I suggest the book by Heywood," Internal Combustion Engine Fundamentals"